I moved my WordPress site to the main directory and now I can’t access my admin

You’re almost there, it’s just the other way around:

define('WP_HOME','http://www.m2comm-semi.com/new');  
define('WP_SITEURL','http://www.m2comm-semi.com');

WP_HOMEis the URL where the actual files are and WP_SITEURL is the URL under which you access the site. Also be aware that this doesn’t go in the functions.php but in the wp-config.php

The Admin is always accessible via the actual location of the files, so in this case:

http://www.m2comm-semi.com/new/wp-admin

Some more info in the Codex:

https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory