From: Song, J. K. <jin...@in...> - 2013-08-26 12:25:43
|
At first I considered smac way of counting braces. But for a better flexibility of macro, I decided not to follow that way. When the number of braces in a grouped parameter is odd, the macro expander would be confused again. This example might not be a good one but shows what I thought about. === example === %macro mmacro 1 vcvtph2ps zmm1{%1 %endmacro mmacro {k1\}\{z\},zmm3} === result ==== vcvtph2ps zmm1{k1}{z},zmm3 =============== This is why I chose to use a backslash escaping - eliminating any special meaning from braces in a grouped parameter. And it also give the same benefit to smac code, too. === example === %define smacro(x) vaddpd zmm1{x,zmm3 smacro({k1\}\{z\},zmm2}) === result ==== vaddpd zmm1{k1}{z},zmm2,zmm3 =============== And please note that current code patch searches for two specific strings of "\{" and "\}", so it might not break any existing code that have used backslashes in macro parameters. Please let me know if there is no such a case I was concerned about like shown above. Thanks, Jin > -----Original Message----- > From: anonymous coward [mailto:nas...@us...] > Sent: Sunday, August 25, 2013 12:35 PM > To: nas...@li... > Subject: Re: [Nasm-devel] [PATCH 0/6] AVX-512: Bug fixes and additional > features > > Instead of trying to introduce backslash escaping, you want to > fix the mmac code to match the smac code, i.e. keep a count > of curly braces. > > === example === > > %define smacro(x) [x] > > smacro ({{a,b}}) > > %macro mmacro 1 > <%1> > %endmacro > > mmacro {{a,b}} > > === current === > > %line 2+1 0.asm > > [{a,b}] > > %line 8+1 0.asm > > 0.asm:9: error: braces do not enclose all of macro parameter > <{a,b> > > === desired === > > %line 2+1 0.asm > > [{a,b}] > > %line 8+1 0.asm > > <{a,b}> > > -------------------------------------------------------------------------- > ---- > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktr > k > _______________________________________________ > Nasm-devel mailing list > Nas...@li... > https://lists.sourceforge.net/lists/listinfo/nasm-devel |