You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(208) |
Jun
(43) |
Jul
|
Aug
(2) |
Sep
(17) |
Oct
|
Nov
(4) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
(11) |
Mar
(3) |
Apr
(2) |
May
|
Jun
(3) |
Jul
(29) |
Aug
(29) |
Sep
(48) |
Oct
|
Nov
|
Dec
(5) |
2004 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2005 |
Jan
(12) |
Feb
(1) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(1) |
Dec
(2) |
2006 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(21) |
Nov
(25) |
Dec
(16) |
2007 |
Jan
(26) |
Feb
(26) |
Mar
(18) |
Apr
(51) |
May
(45) |
Jun
(26) |
Jul
(6) |
Aug
(85) |
Sep
(161) |
Oct
(111) |
Nov
(83) |
Dec
(18) |
2008 |
Jan
(31) |
Feb
(27) |
Mar
|
Apr
(16) |
May
(142) |
Jun
(136) |
Jul
(51) |
Aug
(21) |
Sep
(47) |
Oct
(428) |
Nov
(19) |
Dec
(6) |
2009 |
Jan
(11) |
Feb
(37) |
Mar
(17) |
Apr
(15) |
May
(13) |
Jun
(61) |
Jul
(127) |
Aug
(15) |
Sep
(22) |
Oct
(28) |
Nov
(37) |
Dec
(10) |
2010 |
Jan
(18) |
Feb
(22) |
Mar
(10) |
Apr
(41) |
May
|
Jun
(48) |
Jul
(61) |
Aug
(54) |
Sep
(34) |
Oct
(15) |
Nov
(49) |
Dec
(11) |
2011 |
Jan
|
Feb
(24) |
Mar
(10) |
Apr
(9) |
May
|
Jun
(33) |
Jul
(41) |
Aug
(20) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
(86) |
Mar
(12) |
Apr
|
May
(10) |
Jun
|
Jul
(9) |
Aug
(4) |
Sep
(11) |
Oct
(3) |
Nov
(3) |
Dec
(10) |
2013 |
Jan
(1) |
Feb
(23) |
Mar
(15) |
Apr
(7) |
May
(20) |
Jun
(3) |
Jul
(15) |
Aug
|
Sep
(29) |
Oct
(16) |
Nov
(69) |
Dec
(18) |
2014 |
Jan
|
Feb
(8) |
Mar
|
Apr
|
May
(16) |
Jun
(7) |
Jul
|
Aug
(5) |
Sep
(2) |
Oct
(4) |
Nov
(25) |
Dec
(8) |
2015 |
Jan
(6) |
Feb
(6) |
Mar
|
Apr
(1) |
May
(2) |
Jun
(1) |
Jul
(7) |
Aug
|
Sep
(2) |
Oct
(1) |
Nov
(6) |
Dec
|
2016 |
Jan
(12) |
Feb
(97) |
Mar
(57) |
Apr
(52) |
May
(33) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
(3) |
Nov
(3) |
Dec
|
2017 |
Jan
(4) |
Feb
|
Mar
(23) |
Apr
(5) |
May
|
Jun
(2) |
Jul
(3) |
Aug
(2) |
Sep
|
Oct
(6) |
Nov
(3) |
Dec
(3) |
2018 |
Jan
(4) |
Feb
(11) |
Mar
|
Apr
(1) |
May
(3) |
Jun
(6) |
Jul
|
Aug
(5) |
Sep
(5) |
Oct
(36) |
Nov
(128) |
Dec
(18) |
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(24) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: nasm-bot f. C. G. <gor...@gm...> - 2014-08-25 16:06:20
|
Commit-ID: 8a5d3e68a4a0bb65a5768f004dc8d06ff4dbff30 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=8a5d3e68a4a0bb65a5768f004dc8d06ff4dbff30 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Mon, 25 Aug 2014 20:04:30 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Mon, 25 Aug 2014 20:04:30 +0400 insns: Move 'np' mnemonic into @plain_codes This is literal mnemonic so no need to special handling, move it to @plain_codes instead. Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- assemble.c | 2 +- insns.pl | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/assemble.c b/assemble.c index fd56f5b..38add4f 100644 --- a/assemble.c +++ b/assemble.c @@ -160,7 +160,7 @@ * \340 resb reserve <operand 0> bytes of uninitialized storage. * Operand 0 had better be a segmentless constant. * \341 wait this instruction needs a WAIT "prefix" - * \360 no SSE prefix (== \364\331) + * \360 np no SSE prefix (== \364\331) * \361 66 SSE prefix (== \366\331) * \364 !osp operand-size prefix (0x66) not permitted * \365 !asp address-size prefix (0x67) not permitted diff --git a/insns.pl b/insns.pl index 451c4f2..2504981 100755 --- a/insns.pl +++ b/insns.pl @@ -772,6 +772,7 @@ sub byte_code_compile($$) { 'norep' => 0331, # No REP prefix permitted 'wait' => 0341, # Needs a wait prefix 'resb' => 0340, + 'np' => 0360, # No prefix 'jcc8' => 0370, # Match only if Jcc possible with single byte 'jmp8' => 0371, # Match only if JMP possible with single byte 'jlen' => 0373, # Length of jump @@ -825,16 +826,14 @@ sub byte_code_compile($$) { if (defined $pc) { # Plain code push(@codes, $pc); - } elsif ($prefix_ok && $op =~ /^(66|f2|f3|np)$/) { - # 66/F2/F3 prefix used as an opcode extension, or np = no prefix + } elsif ($prefix_ok && $op =~ /^(66|f2|f3)$/) { + # 66/F2/F3 prefix used as an opcode extension if ($op eq '66') { push(@codes, 0361); } elsif ($op eq 'f2') { push(@codes, 0332); - } elsif ($op eq 'f3') { - push(@codes, 0333); } else { - push(@codes, 0360); + push(@codes, 0333); } } elsif ($op =~ /^[0-9a-f]{2}$/) { if (defined($litix) && $litix+$codes[$litix]+1 == scalar @codes && |
From: nasm-bot f. C. G. <gor...@gm...> - 2014-08-25 15:36:35
|
Commit-ID: 5d488a30a45e781178f5beeb2c5c0328aea695d5 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=5d488a30a45e781178f5beeb2c5c0328aea695d5 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Mon, 25 Aug 2014 17:50:53 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Mon, 25 Aug 2014 19:32:02 +0400 assemble.c: Introduce mnemonics into bytecode spec There are a number of mnemonics used in instns.pl plus insns.dat files, lets document them. This is first attempt to document mnemonics, so something might be still missing, need review and updates. No functional changes. Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- assemble.c | 192 +++++++++++++++++++++++++++++++------------------------------ 1 file changed, 99 insertions(+), 93 deletions(-) diff --git a/assemble.c b/assemble.c index 7ba3869..fd56f5b 100644 --- a/assemble.c +++ b/assemble.c @@ -34,45 +34,51 @@ /* * assemble.c code generation for the Netwide Assembler * - * the actual codes (C syntax, i.e. octal): - * \0 - terminates the code. (Unless it's a literal of course.) - * \1..\4 - that many literal bytes follow in the code stream - * \5 - add 4 to the primary operand number (b, low octdigit) - * \6 - add 4 to the secondary operand number (a, middle octdigit) - * \7 - add 4 to both the primary and the secondary operand number - * \10..\13 - a literal byte follows in the code stream, to be added - * to the register value of operand 0..3 - * \14..\17 - the position of index register operand in MIB (BND insns) - * \20..\23 - a byte immediate operand, from operand 0..3 - * \24..\27 - a zero-extended byte immediate operand, from operand 0..3 - * \30..\33 - a word immediate operand, from operand 0..3 - * \34..\37 - select between \3[0-3] and \4[0-3] depending on 16/32 bit - * assembly mode or the operand-size override on the operand - * \40..\43 - a long immediate operand, from operand 0..3 - * \44..\47 - select between \3[0-3], \4[0-3] and \5[4-7] - * depending on the address size of the instruction. - * \50..\53 - a byte relative operand, from operand 0..3 - * \54..\57 - a qword immediate operand, from operand 0..3 - * \60..\63 - a word relative operand, from operand 0..3 - * \64..\67 - select between \6[0-3] and \7[0-3] depending on 16/32 bit - * assembly mode or the operand-size override on the operand - * \70..\73 - a long relative operand, from operand 0..3 - * \74..\77 - a word constant, from the _segment_ part of operand 0..3 - * \1ab - a ModRM, calculated on EA in operand a, with the spare - * field the register value of operand b. - * \172\ab - the register number from operand a in bits 7..4, with - * the 4-bit immediate from operand b in bits 3..0. - * \173\xab - the register number from operand a in bits 7..4, with - * the value b in bits 3..0. - * \174..\177 - the register number from operand 0..3 in bits 7..4, and - * an arbitrary value in bits 3..0 (assembled as zero.) - * \2ab - a ModRM, calculated on EA in operand a, with the spare - * field equal to digit b. + * Bytecode specification + * ---------------------- + * + * + * Codes Mnemonic Explanation + * + * \0 terminates the code. (Unless it's a literal of course.) + * \1..\4 that many literal bytes follow in the code stream + * \5 add 4 to the primary operand number (b, low octdigit) + * \6 add 4 to the secondary operand number (a, middle octdigit) + * \7 add 4 to both the primary and the secondary operand number + * \10..\13 a literal byte follows in the code stream, to be added + * to the register value of operand 0..3 + * \14..\17 the position of index register operand in MIB (BND insns) + * \20..\23 ib a byte immediate operand, from operand 0..3 + * \24..\27 ib,u a zero-extended byte immediate operand, from operand 0..3 + * \30..\33 iw a word immediate operand, from operand 0..3 + * \34..\37 iwd select between \3[0-3] and \4[0-3] depending on 16/32 bit + * assembly mode or the operand-size override on the operand + * \40..\43 id a long immediate operand, from operand 0..3 + * \44..\47 iwdq select between \3[0-3], \4[0-3] and \5[4-7] + * depending on the address size of the instruction. + * \50..\53 rel8 a byte relative operand, from operand 0..3 + * \54..\57 iq a qword immediate operand, from operand 0..3 + * \60..\63 rel16 a word relative operand, from operand 0..3 + * \64..\67 rel select between \6[0-3] and \7[0-3] depending on 16/32 bit + * assembly mode or the operand-size override on the operand + * \70..\73 rel32 a long relative operand, from operand 0..3 + * \74..\77 seg a word constant, from the _segment_ part of operand 0..3 + * \1ab a ModRM, calculated on EA in operand a, with the spare + * field the register value of operand b. + * \172\ab the register number from operand a in bits 7..4, with + * the 4-bit immediate from operand b in bits 3..0. + * \173\xab the register number from operand a in bits 7..4, with + * the value b in bits 3..0. + * \174..\177 the register number from operand 0..3 in bits 7..4, and + * an arbitrary value in bits 3..0 (assembled as zero.) + * \2ab a ModRM, calculated on EA in operand a, with the spare + * field equal to digit b. + * + * \240..\243 this instruction uses EVEX rather than REX or VEX/XOP, with the + * V field taken from operand 0..3. + * \250 this instruction uses EVEX rather than REX or VEX/XOP, with the + * V field set to 1111b. * - * \240..\243 - this instruction uses EVEX rather than REX or VEX/XOP, with the - * V field taken from operand 0..3. - * \250 - this instruction uses EVEX rather than REX or VEX/XOP, with the - * V field set to 1111b. * EVEX prefixes are followed by the sequence: * \cm\wlp\tup where cm is: * cc 000 0mm @@ -97,11 +103,11 @@ * tup is tuple type for Disp8*N from %tuple_codes in insns.pl * (compressed displacement encoding) * - * \254..\257 - a signed 32-bit operand to be extended to 64 bits. - * \260..\263 - this instruction uses VEX/XOP rather than REX, with the - * V field taken from operand 0..3. - * \270 - this instruction uses VEX/XOP rather than REX, with the - * V field set to 1111b. + * \254..\257 id,s a signed 32-bit operand to be extended to 64 bits. + * \260..\263 this instruction uses VEX/XOP rather than REX, with the + * V field taken from operand 0..3. + * \270 this instruction uses VEX/XOP rather than REX, with the + * V field set to 1111b. * * VEX/XOP prefixes are followed by the sequence: * \tmm\wlp where mm is the M field; and wlp is: @@ -117,56 +123,56 @@ * * t = 0 for VEX (C4/C5), t = 1 for XOP (8F). * - * \271 - instruction takes XRELEASE (F3) with or without lock - * \272 - instruction takes XACQUIRE/XRELEASE with or without lock - * \273 - instruction takes XACQUIRE/XRELEASE with lock only - * \274..\277 - a byte immediate operand, from operand 0..3, sign-extended - * to the operand size (if o16/o32/o64 present) or the bit size - * \310 - indicates fixed 16-bit address size, i.e. optional 0x67. - * \311 - indicates fixed 32-bit address size, i.e. optional 0x67. - * \312 - (disassembler only) invalid with non-default address size. - * \313 - indicates fixed 64-bit address size, 0x67 invalid. - * \314 - (disassembler only) invalid with REX.B - * \315 - (disassembler only) invalid with REX.X - * \316 - (disassembler only) invalid with REX.R - * \317 - (disassembler only) invalid with REX.W - * \320 - indicates fixed 16-bit operand size, i.e. optional 0x66. - * \321 - indicates fixed 32-bit operand size, i.e. optional 0x66. - * \322 - indicates that this instruction is only valid when the - * operand size is the default (instruction to disassembler, - * generates no code in the assembler) - * \323 - indicates fixed 64-bit operand size, REX on extensions only. - * \324 - indicates 64-bit operand size requiring REX prefix. - * \325 - instruction which always uses spl/bpl/sil/dil - * \326 - instruction not valid with 0xF3 REP prefix. Hint for - disassembler only; for SSE instructions. - * \330 - a literal byte follows in the code stream, to be added - * to the condition code value of the instruction. - * \331 - instruction not valid with REP prefix. Hint for - * disassembler only; for SSE instructions. - * \332 - REP prefix (0xF2 byte) used as opcode extension. - * \333 - REP prefix (0xF3 byte) used as opcode extension. - * \334 - LOCK prefix used as REX.R (used in non-64-bit mode) - * \335 - disassemble a rep (0xF3 byte) prefix as repe not rep. - * \336 - force a REP(E) prefix (0xF3) even if not specified. - * \337 - force a REPNE prefix (0xF2) even if not specified. - * \336-\337 are still listed as prefixes in the disassembler. - * \340 - reserve <operand 0> bytes of uninitialized storage. - * Operand 0 had better be a segmentless constant. - * \341 - this instruction needs a WAIT "prefix" - * \360 - no SSE prefix (== \364\331) - * \361 - 66 SSE prefix (== \366\331) - * \364 - operand-size prefix (0x66) not permitted - * \365 - address-size prefix (0x67) not permitted - * \366 - operand-size prefix (0x66) used as opcode extension - * \367 - address-size prefix (0x67) used as opcode extension - * \370,\371 - match only if operand 0 meets byte jump criteria. - * 370 is used for Jcc, 371 is used for JMP. - * \373 - assemble 0x03 if bits==16, 0x05 if bits==32; - * used for conditional jump over longer jump - * \374 - this instruction takes an XMM VSIB memory EA - * \375 - this instruction takes an YMM VSIB memory EA - * \376 - this instruction takes an ZMM VSIB memory EA + * \271 hlexr instruction takes XRELEASE (F3) with or without lock + * \272 hlenl instruction takes XACQUIRE/XRELEASE with or without lock + * \273 hle instruction takes XACQUIRE/XRELEASE with lock only + * \274..\277 ib,s a byte immediate operand, from operand 0..3, sign-extended + * to the operand size (if o16/o32/o64 present) or the bit size + * \310 a16 indicates fixed 16-bit address size, i.e. optional 0x67. + * \311 a32 indicates fixed 32-bit address size, i.e. optional 0x67. + * \312 adf (disassembler only) invalid with non-default address size. + * \313 a64 indicates fixed 64-bit address size, 0x67 invalid. + * \314 norexb (disassembler only) invalid with REX.B + * \315 norexx (disassembler only) invalid with REX.X + * \316 norexr (disassembler only) invalid with REX.R + * \317 norexw (disassembler only) invalid with REX.W + * \320 o16 indicates fixed 16-bit operand size, i.e. optional 0x66. + * \321 o32 indicates fixed 32-bit operand size, i.e. optional 0x66. + * \322 odf indicates that this instruction is only valid when the + * operand size is the default (instruction to disassembler, + * generates no code in the assembler) + * \323 o64nw indicates fixed 64-bit operand size, REX on extensions only. + * \324 o64 indicates 64-bit operand size requiring REX prefix. + * \325 nohi instruction which always uses spl/bpl/sil/dil + * \326 nof3 instruction not valid with 0xF3 REP prefix. Hint for + disassembler only; for SSE instructions. + * \330 a literal byte follows in the code stream, to be added + * to the condition code value of the instruction. + * \331 norep instruction not valid with REP prefix. Hint for + * disassembler only; for SSE instructions. + * \332 f2i REP prefix (0xF2 byte) used as opcode extension. + * \333 f3i REP prefix (0xF3 byte) used as opcode extension. + * \334 rex.l LOCK prefix used as REX.R (used in non-64-bit mode) + * \335 repe disassemble a rep (0xF3 byte) prefix as repe not rep. + * \336 mustrep force a REP(E) prefix (0xF3) even if not specified. + * \337 mustrepne force a REPNE prefix (0xF2) even if not specified. + * \336-\337 are still listed as prefixes in the disassembler. + * \340 resb reserve <operand 0> bytes of uninitialized storage. + * Operand 0 had better be a segmentless constant. + * \341 wait this instruction needs a WAIT "prefix" + * \360 no SSE prefix (== \364\331) + * \361 66 SSE prefix (== \366\331) + * \364 !osp operand-size prefix (0x66) not permitted + * \365 !asp address-size prefix (0x67) not permitted + * \366 operand-size prefix (0x66) used as opcode extension + * \367 address-size prefix (0x67) used as opcode extension + * \370,\371 jcc8 match only if operand 0 meets byte jump criteria. + * jmp8 370 is used for Jcc, 371 is used for JMP. + * \373 jlen assemble 0x03 if bits==16, 0x05 if bits==32; + * used for conditional jump over longer jump + * \374 vsibx|vm32x|vm64x this instruction takes an XMM VSIB memory EA + * \375 vsiby|vm32y|vm64y this instruction takes an YMM VSIB memory EA + * \376 vsibz|vm32z|vm64z this instruction takes an ZMM VSIB memory EA */ #include "compiler.h" |
From: nasm-bot f. J. K. <jam...@li...> - 2014-08-07 18:45:29
|
Commit-ID: 2bedd2411387bb6933825954bb8a1cb38c59b3bd Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=2bedd2411387bb6933825954bb8a1cb38c59b3bd Author: Jim Kukunas <jam...@li...> AuthorDate: Thu, 7 Aug 2014 09:06:51 -0700 Committer: Jim Kukunas <jam...@li...> CommitDate: Thu, 7 Aug 2014 11:42:05 -0700 msvc.mak: Update insns.pl arguments 45a22d9a6147c320b6754679de54a8290de3c5e3 changes the arguments of insns.pl and adds a new autogenerated header iflaggen.h. Update the nmake Makefile accordingly. Signed-off-by: Jim Kukunas <jam...@li...> --- Mkfiles/msvc.mak | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak index 8154818..f1839a2 100644 --- a/Mkfiles/msvc.mak +++ b/Mkfiles/msvc.mak @@ -76,17 +76,21 @@ ndisasm$(X): $(NDISASM) insns.pl: insns-iflags.pl -iflag.c iflag.h: insns.dat insns.pl - $(PERL) $(srcdir)/insns.pl -t $(srcdir)/insns.dat -insnsb.c: insns.dat insns.pl +INSDEP = insns.dat insns.pl insns-iflags.pl + +iflag.c: $(INSDEP) + $(PERL) $(srcdir)/insns.pl -fc $(srcdir)/insns.dat +iflaggen.h: $(INSDEP) + $(PERL) $(srcdir)/insns.pl -fh $(srcdir)/insns.dat +insnsb.c: $(INSDEP) $(PERL) $(srcdir)/insns.pl -b $(srcdir)/insns.dat -insnsa.c: insns.dat insns.pl +insnsa.c: $(INSDEP) $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat -insnsd.c: insns.dat insns.pl +insnsd.c: $(INSDEP) $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat -insnsi.h: insns.dat insns.pl +insnsi.h: $(INSDEP) $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat -insnsn.c: insns.dat insns.pl +insnsn.c: $(INSDEP) $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat # These files contains all the standard macros that are derived from |
From: nasm-bot f. C. G. <gor...@gm...> - 2014-06-28 20:57:23
|
Commit-ID: 599a98272edbf7df3e919a8b22a3b9ee1d437c15 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=599a98272edbf7df3e919a8b22a3b9ee1d437c15 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Tue, 24 Jun 2014 00:55:17 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Sun, 29 Jun 2014 00:52:54 +0400 nasm: Handle -MF and -MD options It's been long time since -MF and -MD options were described in docs but actually -MF was not implemented completely and -MD didn't proceed into normal compilation process. Fix it. Because we use bitmask for operating_mode selection I had to move compilation condition one shift left. http://bugzilla.nasm.us/show_bug.cgi?id=3392280 Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- nasm.c | 85 +++++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 45 insertions(+), 40 deletions(-) diff --git a/nasm.c b/nasm.c index c83f3d0..ac46afd 100644 --- a/nasm.c +++ b/nasm.c @@ -369,7 +369,7 @@ int main(int argc, char **argv) /* define some macros dependent of command-line */ define_macros_late(); - depend_ptr = (depend_file || (operating_mode == OP_DEPEND)) ? &depend_list : NULL; + depend_ptr = (depend_file || (operating_mode & OP_DEPEND)) ? &depend_list : NULL; if (!depend_target) depend_target = quote_for_make(outname); @@ -434,51 +434,51 @@ int main(int argc, char **argv) if (ofile && terminate_after_phase) remove(outname); ofile = NULL; - } else if (operating_mode & OP_NORMAL) { - /* - * We must call ofmt->filename _anyway_, even if the user - * has specified their own output file, because some - * formats (eg OBJ and COFF) use ofmt->filename to find out - * the name of the input file and then put that inside the - * file. - */ - ofmt->filename(inname, outname); + } - ofile = fopen(outname, (ofmt->flags & OFMT_TEXT) ? "w" : "wb"); - if (!ofile) { - nasm_error(ERR_FATAL | ERR_NOFILE, - "unable to open output file `%s'", outname); - } + if (operating_mode & OP_NORMAL) { + /* + * We must call ofmt->filename _anyway_, even if the user + * has specified their own output file, because some + * formats (eg OBJ and COFF) use ofmt->filename to find out + * the name of the input file and then put that inside the + * file. + */ + ofmt->filename(inname, outname); - /* - * We must call init_labels() before ofmt->init() since - * some object formats will want to define labels in their - * init routines. (eg OS/2 defines the FLAT group) - */ - init_labels(); + ofile = fopen(outname, (ofmt->flags & OFMT_TEXT) ? "w" : "wb"); + if (!ofile) + nasm_error(ERR_FATAL | ERR_NOFILE, + "unable to open output file `%s'", outname); - ofmt->init(); - dfmt = ofmt->current_dfmt; - dfmt->init(); + /* + * We must call init_labels() before ofmt->init() since + * some object formats will want to define labels in their + * init routines. (eg OS/2 defines the FLAT group) + */ + init_labels(); - assemble_file(inname, depend_ptr); + ofmt->init(); + dfmt = ofmt->current_dfmt; + dfmt->init(); - if (!terminate_after_phase) { - ofmt->cleanup(using_debug_info); - cleanup_labels(); - fflush(ofile); - if (ferror(ofile)) { - nasm_error(ERR_NONFATAL|ERR_NOFILE, - "write error on output file `%s'", outname); - } - } + assemble_file(inname, depend_ptr); - if (ofile) { - fclose(ofile); - if (terminate_after_phase) - remove(outname); - ofile = NULL; - } + if (!terminate_after_phase) { + ofmt->cleanup(using_debug_info); + cleanup_labels(); + fflush(ofile); + if (ferror(ofile)) + nasm_error(ERR_NONFATAL|ERR_NOFILE, + "write error on output file `%s'", outname); + } + + if (ofile) { + fclose(ofile); + if (terminate_after_phase) + remove(outname); + ofile = NULL; + } } if (depend_list && !terminate_after_phase) @@ -898,6 +898,11 @@ set_warning: depend_emit_phony = true; break; case 'D': + operating_mode = OP_DEPEND | OP_NORMAL; + depend_file = q; + advance = true; + break; + case 'F': depend_file = q; advance = true; break; |
From: nasm-bot f. C. G. <gor...@gm...> - 2014-06-28 20:57:23
|
Commit-ID: e9fc88ca11c271dfef5e46f470969ddb27c857af Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=e9fc88ca11c271dfef5e46f470969ddb27c857af Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Mon, 23 Jun 2014 02:22:02 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Sun, 29 Jun 2014 00:52:54 +0400 nasm: Convert operating_mode to use bitmask We will need it to handle mode continuations. Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- nasm.c | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/nasm.c b/nasm.c index 0ce0ba2..c83f3d0 100644 --- a/nasm.c +++ b/nasm.c @@ -128,12 +128,11 @@ static const struct forwrefinfo *forwref; static struct preproc_ops *preproc; -enum op_type { - OP_NORMAL, /* Preprocess and assemble */ - OP_PREPROCESS, /* Preprocess only */ - OP_DEPEND, /* Generate dependencies */ -}; -static enum op_type operating_mode; +#define OP_NORMAL (1u << 0) +#define OP_PREPROCESS (1u << 1) +#define OP_DEPEND (1u << 2) + +static unsigned int operating_mode; /* Dependency flags */ static bool depend_emit_phony = false; @@ -374,9 +373,7 @@ int main(int argc, char **argv) if (!depend_target) depend_target = quote_for_make(outname); - switch (operating_mode) { - case OP_DEPEND: - { + if (operating_mode & OP_DEPEND) { char *line; if (depend_missing_ok) @@ -389,11 +386,7 @@ int main(int argc, char **argv) while ((line = preproc->getline())) nasm_free(line); preproc->cleanup(0); - } - break; - - case OP_PREPROCESS: - { + } else if (operating_mode & OP_PREPROCESS) { char *line; char *file_name = NULL; int32_t prior_linnum = 0; @@ -441,11 +434,7 @@ int main(int argc, char **argv) if (ofile && terminate_after_phase) remove(outname); ofile = NULL; - } - break; - - case OP_NORMAL: - { + } else if (operating_mode & OP_NORMAL) { /* * We must call ofmt->filename _anyway_, even if the user * has specified their own output file, because some @@ -490,8 +479,6 @@ int main(int argc, char **argv) remove(outname); ofile = NULL; } - } - break; } if (depend_list && !terminate_after_phase) |
From: nasm-bot f. C. G. <gor...@gm...> - 2014-06-28 20:57:22
|
Commit-ID: 3ed32cb288e6a3bd2e3a4cc27152f593f7d3cee5 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=3ed32cb288e6a3bd2e3a4cc27152f593f7d3cee5 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Sun, 22 Jun 2014 20:53:12 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Sun, 29 Jun 2014 00:52:54 +0400 nasm: Make op_type members being capitals Otherwise they look like reguar variables. Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- nasm.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/nasm.c b/nasm.c index 5cf04a9..0ce0ba2 100644 --- a/nasm.c +++ b/nasm.c @@ -129,11 +129,12 @@ static const struct forwrefinfo *forwref; static struct preproc_ops *preproc; enum op_type { - op_normal, /* Preprocess and assemble */ - op_preprocess, /* Preprocess only */ - op_depend, /* Generate dependencies */ + OP_NORMAL, /* Preprocess and assemble */ + OP_PREPROCESS, /* Preprocess only */ + OP_DEPEND, /* Generate dependencies */ }; static enum op_type operating_mode; + /* Dependency flags */ static bool depend_emit_phony = false; static bool depend_missing_ok = false; @@ -341,7 +342,7 @@ int main(int argc, char **argv) forwrefs = saa_init((int32_t)sizeof(struct forwrefinfo)); preproc = &nasmpp; - operating_mode = op_normal; + operating_mode = OP_NORMAL; seg_init(); @@ -369,12 +370,12 @@ int main(int argc, char **argv) /* define some macros dependent of command-line */ define_macros_late(); - depend_ptr = (depend_file || (operating_mode == op_depend)) ? &depend_list : NULL; + depend_ptr = (depend_file || (operating_mode == OP_DEPEND)) ? &depend_list : NULL; if (!depend_target) depend_target = quote_for_make(outname); switch (operating_mode) { - case op_depend: + case OP_DEPEND: { char *line; @@ -391,7 +392,7 @@ int main(int argc, char **argv) } break; - case op_preprocess: + case OP_PREPROCESS: { char *line; char *file_name = NULL; @@ -443,7 +444,7 @@ int main(int argc, char **argv) } break; - case op_normal: + case OP_NORMAL: { /* * We must call ofmt->filename _anyway_, even if the user @@ -853,7 +854,7 @@ static bool process_arg(char *p, char *q) case 'e': /* preprocess only */ case 'E': - operating_mode = op_preprocess; + operating_mode = OP_PREPROCESS; break; case 'a': /* assemble only - don't preprocess */ @@ -900,10 +901,10 @@ set_warning: case 'M': switch (p[2]) { case 0: - operating_mode = op_depend; + operating_mode = OP_DEPEND; break; case 'G': - operating_mode = op_depend; + operating_mode = OP_DEPEND; depend_missing_ok = true; break; case 'P': |
From: nasm-bot f. C. G. <gor...@gm...> - 2014-06-28 20:57:21
|
Commit-ID: c31767c5cbe3bde0648a0aaa9f07cd204cad88d4 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=c31767c5cbe3bde0648a0aaa9f07cd204cad88d4 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Sat, 28 Jun 2014 02:22:17 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Sun, 29 Jun 2014 00:52:54 +0400 preproc: Use nasm_zalloc in new_Block Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- preproc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/preproc.c b/preproc.c index ffba0bc..9b114c2 100644 --- a/preproc.c +++ b/preproc.c @@ -1160,10 +1160,7 @@ static void *new_Block(size_t size) b->chunk = nasm_malloc(size); /* now allocate a new block for the next request */ - b->next = nasm_malloc(sizeof(Blocks)); - /* and initialize the contents of the new block */ - b->next->next = NULL; - b->next->chunk = NULL; + b->next = nasm_zalloc(sizeof(Blocks)); return b->chunk; } |
From: nasm-bot f. C. G. <gor...@gm...> - 2014-06-28 20:57:21
|
Commit-ID: 4d8dbd98b234be8b2c4ada93ad310662eb97d919 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=4d8dbd98b234be8b2c4ada93ad310662eb97d919 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Sat, 28 Jun 2014 10:15:18 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Sun, 29 Jun 2014 00:52:54 +0400 preproc: Convert tabs to spaces No func cnages Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- preproc.c | 128 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/preproc.c b/preproc.c index 6e52d57..ffba0bc 100644 --- a/preproc.c +++ b/preproc.c @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- * * - * Copyright 1996-2012 The NASM Authors - All Rights Reserved + * Copyright 1996-2014 The NASM Authors - All Rights Reserved * See the file AUTHORS included with the NASM distribution for * the specific copyright holders. * @@ -503,10 +503,10 @@ static Token *reverse_tokens(Token *t) Token *next; while (t) { - next = t->next; - t->next = prev; - prev = t; - t = next; + next = t->next; + t->next = prev; + prev = t; + t = next; } return prev; @@ -960,24 +960,24 @@ static Token *tokenize(char *line) type = TOK_PREPROC_QQ; /* %?? */ p++; } - } else if (*p == '!') { - type = TOK_PREPROC_ID; - p++; - if (isidchar(*p)) { - do { - p++; - } - while (isidchar(*p)); - } else if (*p == '\'' || *p == '\"' || *p == '`') { - p = nasm_skip_string(p); - if (*p) - p++; - else - error(ERR_NONFATAL|ERR_PASS1, "unterminated %! string"); - } else { - /* %! without string or identifier */ - type = TOK_OTHER; /* Legacy behavior... */ - } + } else if (*p == '!') { + type = TOK_PREPROC_ID; + p++; + if (isidchar(*p)) { + do { + p++; + } + while (isidchar(*p)); + } else if (*p == '\'' || *p == '\"' || *p == '`') { + p = nasm_skip_string(p); + if (*p) + p++; + else + error(ERR_NONFATAL|ERR_PASS1, "unterminated %! string"); + } else { + /* %! without string or identifier */ + type = TOK_OTHER; /* Legacy behavior... */ + } } else if (isidchar(*p) || ((*p == '!' || *p == '%' || *p == '$') && isidchar(p[1]))) { @@ -1246,31 +1246,31 @@ static char *detoken(Token * tlist, bool expand_locals) list_for_each(t, tlist) { if (t->type == TOK_PREPROC_ID && t->text[1] == '!') { - char *v; - char *q = t->text; - - v = t->text + 2; - if (*v == '\'' || *v == '\"' || *v == '`') { - size_t len = nasm_unquote(v, NULL); - size_t clen = strlen(v); - - if (len != clen) { - error(ERR_NONFATAL | ERR_PASS1, - "NUL character in %! string"); - v = NULL; - } - } - - if (v) { - char *p = getenv(v); - if (!p) { - error(ERR_NONFATAL | ERR_PASS1, - "nonexistent environment variable `%s'", v); - p = ""; - } - t->text = nasm_strdup(p); - } - nasm_free(q); + char *v; + char *q = t->text; + + v = t->text + 2; + if (*v == '\'' || *v == '\"' || *v == '`') { + size_t len = nasm_unquote(v, NULL); + size_t clen = strlen(v); + + if (len != clen) { + error(ERR_NONFATAL | ERR_PASS1, + "NUL character in %! string"); + v = NULL; + } + } + + if (v) { + char *p = getenv(v); + if (!p) { + error(ERR_NONFATAL | ERR_PASS1, + "nonexistent environment variable `%s'", v); + p = ""; + } + t->text = nasm_strdup(p); + } + nasm_free(q); } /* Expand local macros here and not during preprocessing */ @@ -1723,26 +1723,26 @@ static bool if_condition(Token * tline, enum preproc_token ct) break; case PPC_IFENV: - tline = expand_smacro(tline); + tline = expand_smacro(tline); j = false; /* have we matched yet? */ while (tline) { skip_white_(tline); if (!tline || (tline->type != TOK_ID && - tline->type != TOK_STRING && + tline->type != TOK_STRING && (tline->type != TOK_PREPROC_ID || - tline->text[1] != '!'))) { + tline->text[1] != '!'))) { error(ERR_NONFATAL, "`%s' expects environment variable names", - pp_directives[ct]); + pp_directives[ct]); goto fail; } - p = tline->text; - if (tline->type == TOK_PREPROC_ID) - p += 2; /* Skip leading %! */ - if (*p == '\'' || *p == '\"' || *p == '`') - nasm_unquote_cstr(p, ct); - if (getenv(p)) - j = true; + p = tline->text; + if (tline->type == TOK_PREPROC_ID) + p += 2; /* Skip leading %! */ + if (*p == '\'' || *p == '\"' || *p == '`') + nasm_unquote_cstr(p, ct); + if (getenv(p)) + j = true; tline = tline->next; } break; @@ -3177,11 +3177,11 @@ issue_error: return DIRECTIVE_FOUND; } - /* - * Convert the string to a token stream. Note that smacros - * are stored with the token stream reversed, so we have to - * reverse the output of tokenize(). - */ + /* + * Convert the string to a token stream. Note that smacros + * are stored with the token stream reversed, so we have to + * reverse the output of tokenize(). + */ nasm_unquote_cstr(t->text, i); macro_start = reverse_tokens(tokenize(t->text)); |
From: nasm-bot f. C. G. <gor...@gm...> - 2014-06-28 20:57:20
|
Commit-ID: dae24d75047d31e922880d68cac57a61948b010f Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=dae24d75047d31e922880d68cac57a61948b010f Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Sat, 28 Jun 2014 10:17:39 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Sun, 29 Jun 2014 00:52:54 +0400 preproc: pp_cleanup -- Don't forget to zeroify variables Once we free allocated memory don't forget to setup variables to NULL, otherwise they are pointing into nonexisting memory, which might lead into sigsegv in best case. Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- preproc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/preproc.c b/preproc.c index 9b114c2..12b3978 100644 --- a/preproc.c +++ b/preproc.c @@ -1184,6 +1184,7 @@ static void delete_Blocks(void) if (a != &blocks) nasm_free(a); } + memset(&blocks, 0, sizeof(blocks)); } /* @@ -5141,7 +5142,9 @@ static void pp_cleanup(int pass) if (pass == 0) { IncPath *i; free_llist(predef); + predef = NULL; delete_Blocks(); + freeTokens = NULL; while ((i = ipath)) { ipath = i->next; if (i->path) |
From: nasm-bot f. C. G. <gor...@gm...> - 2014-06-28 20:51:32
|
Commit-ID: 6ebe3bcd2ed116ae67b672d8281de093f04b30e0 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=6ebe3bcd2ed116ae67b672d8281de093f04b30e0 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Sat, 28 Jun 2014 22:14:26 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Sat, 28 Jun 2014 22:31:06 +0400 output: outbin -- Fix relocation size In commit fd52c277dd6d768545cee39b154e706904581966 we've started handling negative address relocations but support Elf format only and got a typo in bin format which leaded to endless cycle of applying relocation due to negative argument (make test hangs). Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outbin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output/outbin.c b/output/outbin.c index 6dc4b2a..c600e55 100644 --- a/output/outbin.c +++ b/output/outbin.c @@ -776,7 +776,7 @@ static void bin_out(int32_t segto, const void *data, } if (s->flags & TYPE_PROGBITS) { if (segment != NO_SEG) - add_reloc(s, size, segment, -1L); + add_reloc(s, asize, segment, -1L); p = mydata; WRITEADDR(p, *(int64_t *)data, asize); saa_wbytes(s->contents, mydata, asize); |
From: nasm-bot f. H. P. A. <hp...@zy...> - 2014-05-22 06:03:30
|
Commit-ID: febd5afc6d7391cd2a8274bcfbacfdb0ab7ba21d Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=febd5afc6d7391cd2a8274bcfbacfdb0ab7ba21d Author: H. Peter Anvin <hp...@zy...> AuthorDate: Wed, 21 May 2014 21:35:32 -0700 Committer: H. Peter Anvin <hp...@zy...> CommitDate: Wed, 21 May 2014 23:00:12 -0700 doc: Make it clear that --v is only in 2.11.05 and newer ... otherwise people might think it is preferred and use it unnecessarily. Signed-off-by: H. Peter Anvin <hp...@zy...> --- doc/nasmdoc.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src index 3025091..f1ca114 100644 --- a/doc/nasmdoc.src +++ b/doc/nasmdoc.src @@ -1,6 +1,6 @@ \# -------------------------------------------------------------------------- \# -\# Copyright 1996-2013 The NASM Authors - All Rights Reserved +\# Copyright 1996-2014 The NASM Authors - All Rights Reserved \# See the file AUTHORS included with the NASM distribution for \# the specific copyright holders. \# @@ -985,7 +985,7 @@ and the date on which it was compiled. You will need the version number if you report a bug. For command-line compatibility with Yasm, the form \i\c{--v} is also -accepted for this option. +accepted for this option starting in NASM version 2.11.05. \S{opt-y} The \i\c{-y} Option: Display Available Debug Info Formats |
From: nasm-bot f. H. P. A. <hp...@zy...> - 2014-05-22 04:39:26
|
Commit-ID: a58603e2f7a73a2c147785fcaad80a6b9715583a Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=a58603e2f7a73a2c147785fcaad80a6b9715583a Author: H. Peter Anvin <hp...@zy...> AuthorDate: Wed, 21 May 2014 21:35:32 -0700 Committer: H. Peter Anvin <hp...@zy...> CommitDate: Wed, 21 May 2014 21:35:32 -0700 doc: Make it clear that --v is only in 2.11.05 and newer ... otherwise people might think it is preferred and use it unnecessarily. Signed-off-by: H. Peter Anvin <hp...@zy...> --- doc/nasmdoc.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src index 3025091..f1ca114 100644 --- a/doc/nasmdoc.src +++ b/doc/nasmdoc.src @@ -1,6 +1,6 @@ \# -------------------------------------------------------------------------- \# -\# Copyright 1996-2013 The NASM Authors - All Rights Reserved +\# Copyright 1996-2014 The NASM Authors - All Rights Reserved \# See the file AUTHORS included with the NASM distribution for \# the specific copyright holders. \# @@ -985,7 +985,7 @@ and the date on which it was compiled. You will need the version number if you report a bug. For command-line compatibility with Yasm, the form \i\c{--v} is also -accepted for this option. +accepted for this option starting in NASM version 2.11.05. \S{opt-y} The \i\c{-y} Option: Display Available Debug Info Formats |
From: nasm-bot f. H. P. A. <hp...@zy...> - 2014-05-21 15:30:30
|
Commit-ID: 12f7802d6024973f431fb65e4122af36aa00cd30 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=12f7802d6024973f431fb65e4122af36aa00cd30 Author: H. Peter Anvin <hp...@zy...> AuthorDate: Wed, 21 May 2014 08:29:41 -0700 Committer: H. Peter Anvin <hp...@zy...> CommitDate: Wed, 21 May 2014 08:29:41 -0700 NASM 2.11.05 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 9d80567..a5f3e2d 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.11.04 +2.11.05 |
From: nasm-bot f. H. P. A. <hp...@zy...> - 2014-05-21 15:30:22
|
Commit-ID: 4ac3b025be42b6db09474882c694eb012f423833 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=4ac3b025be42b6db09474882c694eb012f423833 Author: H. Peter Anvin <hp...@zy...> AuthorDate: Wed, 21 May 2014 08:28:21 -0700 Committer: H. Peter Anvin <hp...@zy...> CommitDate: Wed, 21 May 2014 08:28:21 -0700 doc: Document --v and duplicate REX prefix fix Document changes for 2.11.05. Signed-off-by: H. Peter Anvin <hp...@zy...> --- doc/changes.src | 8 ++++++++ doc/nasmdoc.src | 3 +++ 2 files changed, 11 insertions(+) diff --git a/doc/changes.src b/doc/changes.src index 38cc97e..ec4de21 100644 --- a/doc/changes.src +++ b/doc/changes.src @@ -7,6 +7,14 @@ The NASM 2 series supports x86-64, and is the production version of NASM since 2007. +\S{cl-2.11.05} Version 2.11.05 + +\b Add \c{--v} as an alias for \c{-v} (see \k{opt-v}), for +command-line compatibility with Yasm. + +\b Fix a bug introduced in 2.11.03 whereby certain instructions would +contain multiple REX prefixes, and thus be corrupt. + \S{cl-2.11.04} Version 2.11.04 \b Removed an invalid error checking code. Sometimes a memref only with diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src index 55a6313..3025091 100644 --- a/doc/nasmdoc.src +++ b/doc/nasmdoc.src @@ -984,6 +984,9 @@ and the date on which it was compiled. You will need the version number if you report a bug. +For command-line compatibility with Yasm, the form \i\c{--v} is also +accepted for this option. + \S{opt-y} The \i\c{-y} Option: Display Available Debug Info Formats Typing \c{nasm -f <option> -y} will display a list of the available |
From: nasm-bot f. H. P. A. <hp...@zy...> - 2014-05-21 15:27:42
|
Commit-ID: 0a9250c2ab32028dfdca6578655882b4be6a5c04 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=0a9250c2ab32028dfdca6578655882b4be6a5c04 Author: H. Peter Anvin <hp...@zy...> AuthorDate: Wed, 21 May 2014 08:19:16 -0700 Committer: H. Peter Anvin <hp...@zy...> CommitDate: Wed, 21 May 2014 08:24:21 -0700 BR 3392279: Fix duplicated REX prefixes The fix for BR 3392278: aa29b1d93f5a assemble.c: Don't drop rex prefix from instruction itself ... would cause multiple REX prefixes to be emitted for some instructions. Create a new flag to indicate that REX has already been emitted, which can be cleared for each instance of an instruction. Signed-off-by: H. Peter Anvin <hp...@zy...> --- assemble.c | 9 +++++++-- nasm.h | 3 ++- test/times.asm | 8 ++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/assemble.c b/assemble.c index e9cd70f..ff3cea7 100644 --- a/assemble.c +++ b/assemble.c @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- * * - * Copyright 1996-2013 The NASM Authors - All Rights Reserved + * Copyright 1996-2014 The NASM Authors - All Rights Reserved * See the file AUTHORS included with the NASM distribution for * the specific copyright holders. * @@ -1365,9 +1365,12 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits, static inline unsigned int emit_rex(insn *ins, int32_t segment, int64_t offset, int bits) { if (bits == 64) { - if ((ins->rex & REX_REAL) && !(ins->rex & (REX_V | REX_EV))) { + if ((ins->rex & REX_REAL) && + !(ins->rex & (REX_V | REX_EV)) && + !ins->rex_done) { int rex = (ins->rex & REX_REAL) | REX_P; out(offset, segment, &rex, OUT_RAWDATA, 1, NO_SEG, NO_SEG); + ins->rex_done = true; return 1; } } @@ -1389,6 +1392,8 @@ static void gencode(int32_t segment, int64_t offset, int bits, uint8_t opex = 0; enum ea_type eat = EA_SCALAR; + ins->rex_done = false; + while (*codes) { c = *codes++; op1 = (c & 3) + ((opex & 1) << 2); diff --git a/nasm.h b/nasm.h index 18de37c..666d749 100644 --- a/nasm.h +++ b/nasm.h @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- * * - * Copyright 1996-2013 The NASM Authors - All Rights Reserved + * Copyright 1996-2014 The NASM Authors - All Rights Reserved * See the file AUTHORS included with the NASM distribution for * the specific copyright holders. * @@ -702,6 +702,7 @@ typedef struct insn { /* an instruction itself */ int eops_float; /* true if DD and floating */ int32_t times; /* repeat count (TIMES prefix) */ bool forw_ref; /* is there a forward reference? */ + bool rex_done; /* REX prefix emitted? */ int rex; /* Special REX Prefix */ int vexreg; /* Register encoded in VEX prefix */ int vex_cm; /* Class and M field for VEX prefix */ diff --git a/test/times.asm b/test/times.asm new file mode 100644 index 0000000..a8e3d58 --- /dev/null +++ b/test/times.asm @@ -0,0 +1,8 @@ + bits 64 + +; Broken per BR 3392278 + times 4 paddd xmm8, xmm11 + +; Broken per BR 3392279 + bswap r12d + times 4 bswap r12d |
From: nasm-bot f. C. G. <gor...@gm...> - 2014-05-09 22:12:34
|
Commit-ID: 13558c1e7cb2a1a2ea1b1c13ff554063de8afaf0 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=13558c1e7cb2a1a2ea1b1c13ff554063de8afaf0 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Fri, 9 May 2014 22:34:34 +0400 Committer: H. Peter Anvin <hp...@li...> CommitDate: Fri, 9 May 2014 15:08:28 -0700 options: Add --v option It's been requested a long ago to handle '--v' option same was as a regualar '-v'. From initial report | NASM and yasm are in many respects compatible but yasm uses --v | instead of -v for version. As often --v is used for version I | end up using --v initially in NASM. This patch allows me to compile | Mozilla apps which use yasm with NASM by merely renaming NASM to yasm | so that the build environment does not have to be updated (Mozilla | would not accept changes to allow use of NASM). Reported-by: Andy Willis <abw...@gm...> Signed-off-by: Cyrill Gorcunov <gor...@gm...> Signed-off-by: H. Peter Anvin <hp...@li...> --- nasm.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/nasm.c b/nasm.c index 2bb3029..7388331 100644 --- a/nasm.c +++ b/nasm.c @@ -635,6 +635,13 @@ struct textargs textopts[] = { {NULL, 0} }; +static void show_version(void) +{ + printf("NASM version %s compiled on %s%s\n", + nasm_version, nasm_date, nasm_compile_options); + exit(0); +} + static bool stopoptions = false; static bool process_arg(char *p, char *q) { @@ -776,7 +783,7 @@ static bool process_arg(char *p, char *q) ("usage: nasm [-@ response file] [-o outfile] [-f format] " "[-l listfile]\n" " [options...] [--] filename\n" - " or nasm -v for version info\n\n" + " or nasm -v (or --v) for version info\n\n" " -t assemble in SciTech TASM compatible mode\n" " -g generate debug information in selected format\n"); printf @@ -842,9 +849,7 @@ static bool process_arg(char *p, char *q) break; case 'v': - printf("NASM version %s compiled on %s%s\n", - nasm_version, nasm_date, nasm_compile_options); - exit(0); /* never need usage message here */ + show_version(); break; case 'e': /* preprocess only */ @@ -937,6 +942,10 @@ set_warning: stopoptions = 1; break; } + + if (!nasm_stricmp(p, "--v")) + show_version(); + for (s = 0; textopts[s].label; s++) { if (!nasm_stricmp(p + 2, textopts[s].label)) { break; |
From: nasm-bot f. H. P. A. <hp...@li...> - 2014-05-09 22:12:24
|
Commit-ID: 39aa094f388496a0262e02aee46e14a37b7fab25 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=39aa094f388496a0262e02aee46e14a37b7fab25 Author: H. Peter Anvin <hp...@li...> AuthorDate: Fri, 9 May 2014 15:04:42 -0700 Committer: H. Peter Anvin <hp...@li...> CommitDate: Fri, 9 May 2014 15:04:42 -0700 NASM 2.11.04 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index ca6e6b5..9d80567 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.11.03 +2.11.04 |
From: nasm-bot f. C. G. <gor...@gm...> - 2014-05-09 18:39:30
|
Commit-ID: 07f0a8dbc9ff6638344f13875925408dd6e2aa2c Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=07f0a8dbc9ff6638344f13875925408dd6e2aa2c Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Fri, 9 May 2014 15:00:09 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 9 May 2014 22:22:34 +0400 debug: Drop LOGALLOC usage There are special tools (like valgrind and etc) to track memory leaks, no need for own trivial tracker. Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- misc/findleak.pl | 42 ------------------------------ misc/findleak.txt | 59 ------------------------------------------ nasm.c | 1 - nasmlib.c | 76 +------------------------------------------------------ nasmlib.h | 25 ------------------ ndisasm.c | 1 - 6 files changed, 1 insertion(+), 203 deletions(-) diff --git a/misc/findleak.pl b/misc/findleak.pl deleted file mode 100755 index dbb3367..0000000 --- a/misc/findleak.pl +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/perl -# From: Ed Beroset <be...@mi...> - -my %mem = {}; -my %alloc = {}; -while(<>) -{ - if (/realloc\((0x[0-9a-f]+).*\).*returns \((0x[0-9a-f]+)/) - { - $mem{$1}--; - if ($mem{$1} != 0) { - print "free before alloc! $_"; - } - if ($mem{$2} != 0) { - print "memory leak! $_"; - } - $mem{$2}++; - $alloc{$2} = $_; - } - elsif (/free\((0x[0-9a-f]+)/) - { - $mem{$1}--; - if ($mem{$1} != 0) { - print "free before alloc! $_"; - } - } - elsif (m/returns (0x[0-9a-f]+)/) - { - if ($mem{$1} != 0) { - print "memory leak! $_"; - } - $mem{$1}++; - $alloc{$1} = $_; - } -} -foreach $goo (sort keys %mem) -{ - if ($mem{$goo}) - { - print "$mem{$goo} $alloc{$goo}"; - } -} diff --git a/misc/findleak.txt b/misc/findleak.txt deleted file mode 100644 index 8a1cfdc..0000000 --- a/misc/findleak.txt +++ /dev/null @@ -1,59 +0,0 @@ -Subject: [nasm-devel] tool to help find memory leaks -Date: Fri, 02 Nov 2001 22:08:01 -0500 -From: Ed Beroset <be...@mi...> -Reply-To: nas...@ya... -To: nas...@ya... - -Here's a little Perl script I wrote a while ago to help track down memory -leaks in nasm. First, compile nasm with LOGALLOC defined (see -nasmlib.c). That creates a log file of all allocs and frees. This Perl -script reads that file and tells you which source code lines caused a leak -(or a free of unallocated memory). There are many leaks, almost all of -them in the preprocessor. - --+--- findleak.pl begins -#!/usr/bin/perl -my %mem = {}; -my %alloc = {}; -while(<>) -{ - if (/realloc\((0x[0-9a-f]+).*\).*returns \((0x[0-9a-f]+)/) - { - $mem{$1}--; - if ($mem{$1} != 0) { - print "free before alloc! $_"; - } - if ($mem{$2} != 0) { - print "memory leak! $_"; - } - $mem{$2}++; - $alloc{$2} = $_; - } - elsif (/free\((0x[0-9a-f]+)/) - { - $mem{$1}--; - if ($mem{$1} != 0) { - print "free before alloc! $_"; - } - } - elsif (m/returns (0x[0-9a-f]+)/) - { - if ($mem{$1} != 0) { - print "memory leak! $_"; - } - $mem{$1}++; - $alloc{$1} = $_; - } -} -foreach $goo (sort keys %mem) -{ - if ($mem{$goo}) - { - print "$mem{$goo} $alloc{$goo}"; - } -} --+--- findleak.pl ends - - - -Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ diff --git a/nasm.c b/nasm.c index 2bb3029..6060119 100644 --- a/nasm.c +++ b/nasm.c @@ -337,7 +337,6 @@ int main(int argc, char **argv) tolower_init(); - nasm_init_malloc_error(); offsets = raa_init(); forwrefs = saa_init((int32_t)sizeof(struct forwrefinfo)); diff --git a/nasmlib.c b/nasmlib.c index ec1460b..4588ff3 100644 --- a/nasmlib.c +++ b/nasmlib.c @@ -50,10 +50,6 @@ int globalbits = 0; /* defined in nasm.h, works better here for ASM+DISASM */ static vefunc nasm_verror; /* Global error handling function */ -#ifdef LOGALLOC -static FILE *logfp; -#endif - /* Uninitialized -> all zero by C spec */ const uint8_t zero_buffer[ZERO_BUF_SIZE]; @@ -86,93 +82,37 @@ void nasm_error(int severity, const char *fmt, ...) va_end(ap); } -void nasm_init_malloc_error(void) -{ -#ifdef LOGALLOC - logfp = fopen("malloc.log", "w"); - if (logfp) { - setvbuf(logfp, NULL, _IOLBF, BUFSIZ); - } else { - nasm_error(ERR_NONFATAL | ERR_NOFILE, "Unable to open %s", logfp); - logfp = stderr; - } - fprintf(logfp, "null pointer is %p\n", NULL); -#endif -} - -#ifdef LOGALLOC -void *nasm_malloc_log(const char *file, int line, size_t size) -#else void *nasm_malloc(size_t size) -#endif { void *p = malloc(size); if (!p) nasm_error(ERR_FATAL | ERR_NOFILE, "out of memory"); -#ifdef LOGALLOC - else - fprintf(logfp, "%s %d malloc(%ld) returns %p\n", - file, line, (long)size, p); -#endif return p; } -#ifdef LOGALLOC -void *nasm_zalloc_log(const char *file, int line, size_t size) -#else void *nasm_zalloc(size_t size) -#endif { void *p = calloc(size, 1); if (!p) nasm_error(ERR_FATAL | ERR_NOFILE, "out of memory"); -#ifdef LOGALLOC - else - fprintf(logfp, "%s %d calloc(%ld, 1) returns %p\n", - file, line, (long)size, p); -#endif return p; } -#ifdef LOGALLOC -void *nasm_realloc_log(const char *file, int line, void *q, size_t size) -#else void *nasm_realloc(void *q, size_t size) -#endif { void *p = q ? realloc(q, size) : malloc(size); if (!p) nasm_error(ERR_FATAL | ERR_NOFILE, "out of memory"); -#ifdef LOGALLOC - else if (q) - fprintf(logfp, "%s %d realloc(%p,%ld) returns %p\n", - file, line, q, (long)size, p); - else - fprintf(logfp, "%s %d malloc(%ld) returns %p\n", - file, line, (long)size, p); -#endif return p; } -#ifdef LOGALLOC -void nasm_free_log(const char *file, int line, void *q) -#else void nasm_free(void *q) -#endif { - if (q) { -#ifdef LOGALLOC - fprintf(logfp, "%s %d free(%p)\n", file, line, q); -#endif + if (q) free(q); - } } -#ifdef LOGALLOC -char *nasm_strdup_log(const char *file, int line, const char *s) -#else char *nasm_strdup(const char *s) -#endif { char *p; int size = strlen(s) + 1; @@ -180,20 +120,11 @@ char *nasm_strdup(const char *s) p = malloc(size); if (!p) nasm_error(ERR_FATAL | ERR_NOFILE, "out of memory"); -#ifdef LOGALLOC - else - fprintf(logfp, "%s %d strdup(%ld) returns %p\n", - file, line, (long)size, p); -#endif strcpy(p, s); return p; } -#ifdef LOGALLOC -char *nasm_strndup_log(const char *file, int line, const char *s, size_t len) -#else char *nasm_strndup(const char *s, size_t len) -#endif { char *p; int size = len + 1; @@ -201,11 +132,6 @@ char *nasm_strndup(const char *s, size_t len) p = malloc(size); if (!p) nasm_error(ERR_FATAL | ERR_NOFILE, "out of memory"); -#ifdef LOGALLOC - else - fprintf(logfp, "%s %d strndup(%ld) returns %p\n", - file, line, (long)size, p); -#endif strncpy(p, s, len); p[len] = '\0'; return p; diff --git a/nasmlib.h b/nasmlib.h index d11e6e0..8f6c885 100644 --- a/nasmlib.h +++ b/nasmlib.h @@ -65,15 +65,6 @@ extern unsigned char nasm_tolower_tab[256]; #define nasm_isxdigit(x) isxdigit((unsigned char)(x)) /* - * If this is defined, the wrappers around malloc et al will - * transform into logging variants, which will cause NASM to create - * a file called `malloc.log' when run, and spew details of all its - * memory management into that. That can then be analysed to detect - * memory leaks and potentially other problems too. - */ -/* #define LOGALLOC */ - -/* * ------------------------- * Error reporting functions * ------------------------- @@ -144,28 +135,12 @@ void nasm_set_verror(vefunc); * passed a NULL pointer; nasm_free will do nothing if it is passed * a NULL pointer. */ -void nasm_init_malloc_error(void); -#ifndef LOGALLOC void *nasm_malloc(size_t); void *nasm_zalloc(size_t); void *nasm_realloc(void *, size_t); void nasm_free(void *); char *nasm_strdup(const char *); char *nasm_strndup(const char *, size_t); -#else -void *nasm_malloc_log(const char *, int, size_t); -void *nasm_zalloc_log(const char *, int, size_t); -void *nasm_realloc_log(const char *, int, void *, size_t); -void nasm_free_log(const char *, int, void *); -char *nasm_strdup_log(const char *, int, const char *); -char *nasm_strndup_log(const char *, int, const char *, size_t); -#define nasm_malloc(x) nasm_malloc_log(__FILE__,__LINE__,x) -#define nasm_zalloc(x) nasm_zalloc_log(__FILE__,__LINE__,x) -#define nasm_realloc(x,y) nasm_realloc_log(__FILE__,__LINE__,x,y) -#define nasm_free(x) nasm_free_log(__FILE__,__LINE__,x) -#define nasm_strdup(x) nasm_strdup_log(__FILE__,__LINE__,x) -#define nasm_strndup(x,y) nasm_strndup_log(__FILE__,__LINE__,x,y) -#endif /* * NASM assert failure diff --git a/ndisasm.c b/ndisasm.c index 3212629..754033c 100644 --- a/ndisasm.c +++ b/ndisasm.c @@ -95,7 +95,6 @@ int main(int argc, char **argv) tolower_init(); nasm_set_verror(ndisasm_verror); - nasm_init_malloc_error(); iflag_clear_all(&prefer); offset = 0; |
From: nasm-bot f. C. G. <gor...@gm...> - 2014-05-09 18:39:30
|
Commit-ID: 5b144751eeb0fecf29a508278045ff79038dd7c3 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=5b144751eeb0fecf29a508278045ff79038dd7c3 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Tue, 6 May 2014 01:50:22 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 9 May 2014 14:38:58 +0400 Rename REX_REAL to REX_MASK "Real" doesn't reflect the meaning of this macro -- it rather represents a rex prefix mask. Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- assemble.c | 6 +++--- nasm.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assemble.c b/assemble.c index e9cd70f..a07bdde 100644 --- a/assemble.c +++ b/assemble.c @@ -1323,7 +1323,7 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits, length += 3; else length += 2; - } else if (ins->rex & REX_REAL) { + } else if (ins->rex & REX_MASK) { if (ins->rex & REX_H) { errfunc(ERR_NONFATAL, "cannot use high register in rex instruction"); return -1; @@ -1365,8 +1365,8 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits, static inline unsigned int emit_rex(insn *ins, int32_t segment, int64_t offset, int bits) { if (bits == 64) { - if ((ins->rex & REX_REAL) && !(ins->rex & (REX_V | REX_EV))) { - int rex = (ins->rex & REX_REAL) | REX_P; + if ((ins->rex & REX_MASK) && !(ins->rex & (REX_V | REX_EV))) { + int rex = (ins->rex & REX_MASK) | REX_P; out(offset, segment, &rex, OUT_RAWDATA, 1, NO_SEG, NO_SEG); return 1; } diff --git a/nasm.h b/nasm.h index 18de37c..48e4b1f 100644 --- a/nasm.h +++ b/nasm.h @@ -500,7 +500,7 @@ static inline uint8_t get_cond_opcode(enum ccode c) /* * REX flags */ -#define REX_REAL 0x4f /* Actual REX prefix bits */ +#define REX_MASK 0x4f /* Actual REX prefix bits */ #define REX_B 0x01 /* ModRM r/m extension */ #define REX_X 0x02 /* SIB index extension */ #define REX_R 0x04 /* ModRM reg extension */ |
From: nasm-bot f. C. G. <gor...@gm...> - 2014-05-09 18:39:28
|
Commit-ID: e743843d154fb59bb7f6ad369aa12a746a2a2e0e Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=e743843d154fb59bb7f6ad369aa12a746a2a2e0e Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Fri, 9 May 2014 22:34:34 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 9 May 2014 22:34:37 +0400 options: Add --v option It's been requested a long ago to handle '--v' option same was as a regualar '-v'. From initial report | NASM and yasm are in many respects compatible but yasm uses --v | instead of -v for version. As often --v is used for version I | end up using --v initially in NASM. This patch allows me to compile | Mozilla apps which use yasm with NASM by merely renaming NASM to yasm | so that the build environment does not have to be updated (Mozilla | would not accept changes to allow use of NASM). Reported-by: Andy Willis <abw...@gm...> Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- nasm.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/nasm.c b/nasm.c index 6060119..5cf04a9 100644 --- a/nasm.c +++ b/nasm.c @@ -634,6 +634,13 @@ struct textargs textopts[] = { {NULL, 0} }; +static void show_version(void) +{ + printf("NASM version %s compiled on %s%s\n", + nasm_version, nasm_date, nasm_compile_options); + exit(0); +} + static bool stopoptions = false; static bool process_arg(char *p, char *q) { @@ -775,7 +782,7 @@ static bool process_arg(char *p, char *q) ("usage: nasm [-@ response file] [-o outfile] [-f format] " "[-l listfile]\n" " [options...] [--] filename\n" - " or nasm -v for version info\n\n" + " or nasm -v (or --v) for version info\n\n" " -t assemble in SciTech TASM compatible mode\n" " -g generate debug information in selected format\n"); printf @@ -841,9 +848,7 @@ static bool process_arg(char *p, char *q) break; case 'v': - printf("NASM version %s compiled on %s%s\n", - nasm_version, nasm_date, nasm_compile_options); - exit(0); /* never need usage message here */ + show_version(); break; case 'e': /* preprocess only */ @@ -936,6 +941,10 @@ set_warning: stopoptions = 1; break; } + + if (!nasm_stricmp(p, "--v")) + show_version(); + for (s = 0; textopts[s].label; s++) { if (!nasm_stricmp(p + 2, textopts[s].label)) { break; |
From: nasm-bot f. J. K. S. <jin...@in...> - 2014-05-07 21:09:35
|
Commit-ID: 3a105c3c0e66b37c61b33146dd82ce8351939ce6 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=3a105c3c0e66b37c61b33146dd82ce8351939ce6 Author: Jin Kyu Song <jin...@in...> AuthorDate: Wed, 7 May 2014 13:55:58 -0700 Committer: Jin Kyu Song <jin...@in...> CommitDate: Wed, 7 May 2014 13:56:04 -0700 changes: Document bug fixes - Removed an error checking code for setting evex flags - Fixed vector length matching bug Signed-off-by: Jin Kyu Song <jin...@in...> --- doc/changes.src | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/changes.src b/doc/changes.src index 4df068f..38cc97e 100644 --- a/doc/changes.src +++ b/doc/changes.src @@ -7,6 +7,17 @@ The NASM 2 series supports x86-64, and is the production version of NASM since 2007. +\S{cl-2.11.04} Version 2.11.04 + +\b Removed an invalid error checking code. Sometimes a memref only with +a displacement can also set an evex flag. For example: + +\c vmovdqu32 [0xabcd]{k1}, zmm0 + +\b Fixed a bug in disassembler that EVEX.L'L vector length was not matched +when EVEX.b was set because it was simply considered as EVEC.RC. +Separated EVEX.L'L case from EVEX.RC which is ignored in matching. + \S{cl-2.11.03} Version 2.11.03 \b Fix a bug there REX prefixes were missing on instructions inside a |
From: nasm-bot f. J. K. S. <jin...@in...> - 2014-05-07 21:09:34
|
Commit-ID: abdc8bdea2f2834d442e0ecf8dfdd16d7a17a6f2 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=abdc8bdea2f2834d442e0ecf8dfdd16d7a17a6f2 Author: Jin Kyu Song <jin...@in...> AuthorDate: Mon, 5 May 2014 13:58:51 -0700 Committer: Jin Kyu Song <jin...@in...> CommitDate: Mon, 5 May 2014 13:58:51 -0700 ndisasm: Match vector length with EVEX.b set With broadcasting, EVEX.L'L should be matched even when EVEX.b is set. Only in a case of embedded rounding, EVEX.L'L is ignored in matching function since it becomes EVEX.RC. Signed-off-by: Jin Kyu Song <jin...@in...> --- disasm.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/disasm.c b/disasm.c index bb53b4c..2f68b1d 100644 --- a/disasm.c +++ b/disasm.c @@ -726,7 +726,9 @@ static int matches(const struct itemplate *t, uint8_t *data, { uint8_t evexm = *r++; uint8_t evexwlp = *r++; + uint8_t modrm, valid_mask; ins->evex_tuple = *r++ - 0300; + modrm = *(origdata + 1); ins->rex |= REX_EV; if ((prefix->rex & (REX_EV|REX_V|REX_P)) != REX_EV) @@ -752,9 +754,15 @@ static int matches(const struct itemplate *t, uint8_t *data, break; } - /* If EVEX.b is set, EVEX.L'L can be rounding control bits */ - if ((evexwlp ^ prefix->vex_lp) & - ((prefix->evex[2] & EVEX_P2B) ? 0x03 : 0x0f)) + /* If EVEX.b is set with reg-reg op, + * EVEX.L'L contains embedded rounding control info + */ + if ((prefix->evex[2] & EVEX_P2B) && ((modrm >> 6) == 3)) { + valid_mask = 0x3; /* prefix only */ + } else { + valid_mask = 0xf; /* vector length and prefix */ + } + if ((evexwlp ^ prefix->vex_lp) & valid_mask) return false; if (c == 0250) { |
From: nasm-bot f. J. K. S. <jin...@in...> - 2014-05-07 21:09:32
|
Commit-ID: eb29cf7b31e097237bab41759ecdbe1ed4c7e45d Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=eb29cf7b31e097237bab41759ecdbe1ed4c7e45d Author: Jin Kyu Song <jin...@in...> AuthorDate: Mon, 5 May 2014 13:06:03 -0700 Committer: Jin Kyu Song <jin...@in...> CommitDate: Mon, 5 May 2014 13:56:36 -0700 AVX512: Remove invalid error checking An offset-only memref can also have an opmask decorator. e.g.) vmovdqu32 [0xabcd]{k1}, zmm0 Signed-off-by: Jin Kyu Song <jin...@in...> --- assemble.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/assemble.c b/assemble.c index ff92722..e9cd70f 100644 --- a/assemble.c +++ b/assemble.c @@ -1997,9 +1997,6 @@ static int op_evexflags(const operand * o, int mask, uint8_t byte) { int val; - if (!is_register(o->basereg)) - errfunc(ERR_PANIC, "invalid operand passed to op_evexflags()"); - val = nasm_regvals[o->basereg]; return evexflags(val, o->decoflags, mask, byte); |
From: nasm-bot f. C. G. <gor...@gm...> - 2014-05-05 18:24:43
|
Commit-ID: aa29b1d93f5a927c76aeee3d9e0830874015e7df Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=aa29b1d93f5a927c76aeee3d9e0830874015e7df Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Mon, 5 May 2014 00:30:58 +0400 Committer: H. Peter Anvin <hp...@zy...> CommitDate: Mon, 5 May 2014 11:20:17 -0700 assemble.c: Don't drop rex prefix from instruction itself emit_rex is supposed to write REX prefix into output stream if needed, but we happen to drop it off on a first write which breaks REX required instructions if TIMES directive is used. For example the code like | times 4 movq xmm11, xmm11 compiles into | 0000000000000000 <.text>: | 0: f3 45 0f 7e db movq %xmm11,%xmm11 | 5: f3 0f 7e db movq %xmm3,%xmm3 | 9: f3 0f 7e db movq %xmm3,%xmm3 | d: f3 0f 7e db movq %xmm3,%xmm3 instead of proper | 0000000000000000 <.text>: | 0: f3 45 0f 7e db movq %xmm11,%xmm11 | 5: f3 45 0f 7e db movq %xmm11,%xmm11 | a: f3 45 0f 7e db movq %xmm11,%xmm11 | f: f3 45 0f 7e db movq %xmm11,%xmm11 http://bugzilla.nasm.us/show_bug.cgi?id=3392278 Reported-by: Javier <elp...@gm...> Signed-off-by: Cyrill Gorcunov <gor...@gm...> Signed-off-by: H. Peter Anvin <hp...@zy...> --- assemble.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/assemble.c b/assemble.c index eeab9bb..ff92722 100644 --- a/assemble.c +++ b/assemble.c @@ -1366,9 +1366,8 @@ static inline unsigned int emit_rex(insn *ins, int32_t segment, int64_t offset, { if (bits == 64) { if ((ins->rex & REX_REAL) && !(ins->rex & (REX_V | REX_EV))) { - ins->rex = (ins->rex & REX_REAL) | REX_P; - out(offset, segment, &ins->rex, OUT_RAWDATA, 1, NO_SEG, NO_SEG); - ins->rex = 0; + int rex = (ins->rex & REX_REAL) | REX_P; + out(offset, segment, &rex, OUT_RAWDATA, 1, NO_SEG, NO_SEG); return 1; } } |
From: nasm-bot f. H. P. A. <hp...@zy...> - 2014-05-05 18:24:43
|
Commit-ID: 1a03281365f90d6ac8c449f9a080f9aaf4c5585a Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=1a03281365f90d6ac8c449f9a080f9aaf4c5585a Author: H. Peter Anvin <hp...@zy...> AuthorDate: Mon, 5 May 2014 11:21:17 -0700 Committer: H. Peter Anvin <hp...@zy...> CommitDate: Mon, 5 May 2014 11:21:17 -0700 changes: Document TIMES bug Signed-off-by: H. Peter Anvin <hp...@zy...> --- doc/changes.src | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/changes.src b/doc/changes.src index beabdd9..4df068f 100644 --- a/doc/changes.src +++ b/doc/changes.src @@ -7,6 +7,11 @@ The NASM 2 series supports x86-64, and is the production version of NASM since 2007. +\S{cl-2.11.03} Version 2.11.03 + +\b Fix a bug there REX prefixes were missing on instructions inside a +\c{TIMES} statement. + \S{cl-2.11.02} Version 2.11.02 \b Add the \c{XSAVEC}, \c{XSAVES} and \c{XRSTORS} family instructions. |