summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-03-03insns: Remove pushseg/popseg internal bytecodesBen Rudiak-Gould6-119/+58
This patch is getting rid of the following bytecodes 'pushseg','popseg','pushseg2','popseg2' and simplifies overall code. [gorcunov@: a few style fixes] Signed-off-by: Ben Rudiak-Gould <benrudiak@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-03-03Move conditional opcodes close to enum ccode definitionCyrill Gorcunov2-6/+12
Thus if someone need to rework this code he won't need to jump between files trying to figure out where enum and opcodes lay. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-03-02insns.pl: Various style polyshingCyrill Gorcunov1-75/+77
- convert tabs to spaces - align octal opcodes No func changes. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-03-02assemble: Make emit_rex being a functionCyrill Gorcunov1-8/+14
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-03-02assemble: Use case3/4 where appropriateCyrill Gorcunov1-16/+5
This allows to shrink code a bit. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-03-02assemble: Add case3 helperCyrill Gorcunov1-1/+2
Signed-off-by: cyrill <cyrill@cyrills-MacBook-Pro.local>
2013-03-02process_ea: Drop redundant variableCyrill Gorcunov1-5/+1
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-03-01Remove +sBen Rudiak-Gould6-410/+229
It doesn't seem worth >200 lines of C and Perl to save ~50 lines in insns.dat. In order to make this work I had to rename sbyte16/sbyte32 so that they can take an ordinary size suffix (their size suffix was formerly treated specially). This fixes one disassembly bug: 48C7C000000080 disassembles to mov rax,0x80000000, which reassembles to B800000080, which loads a different value. Signed-off-by: Ben Rudiak-Gould <benrudiak@gmail.com> Acked-by: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-25Fix warnings generated by clang 3.0Andrew Nayenko3-3/+3
Fix warnings like this: output/outelf32.c:2120:33: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((match->section == index)) { ~~~~~~~~~~~~~~~^~~~~~~~ output/outelf32.c:2120:33: note: remove extraneous parentheses around the comparison to silence this warning if ((match->section == index)) { ~ ^ ~ output/outelf32.c:2120:33: note: use '=' to turn this equality comparison into an assignment if ((match->section == index)) { ^~ = 1 warning generated. Signed-off-by: Andrew Nayenko <resver@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-21BR3392242: insns.dat -- Support AMD SVM instructions in 32bit modeAndrew Nayenko1-7/+7
AMD CPUs do support SVM instructions in 32-bit mode thus drop X64 restriction from instructions template where appropriate. Signed-off-by: Andrew Nayenko <resver@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-20Fix jmp/call near offsets in long modeBen Rudiak-Gould2-51/+51
In long mode relative offsets are always 32 bits sign-extended to 64 bits and absolute near addresses are always 64 bits, regardless of the operand size. Signed-off-by: Ben Rudiak-Gould <benrudiak@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-20Add np and similar prefixes to instructions that should have themBen Rudiak-Gould4-56/+71
This adds "np" to a bunch of SSE-style instructions that should have it, "norep" (which was implemented but unused) on quasi-SSE instructions that use F2 and F3 as instruction extensions but 66 for operand size, "nof3" (newly implemented) on a few instructions, "norexw" on some instructions that have only 32-bit and 64-bit versions, and one NOLONG. It also removes some incorrect "np"s, changes some "f3"s to "f3i"s, and fixes the decoding of the XCHG/NOP/PAUSE mess: F390 is always PAUSE even when rex.b=1 (at least according to XED). Signed-off-by: Ben Rudiak-Gould <benrudiak@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-18eval: Use is_power2 helper instead of open codeCyrill Gorcunov1-2/+2
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-18make: Don't forget to generate manpage for all targetCyrill Gorcunov1-2/+2
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-17man: Generate manpages from asciidoc formatCyrill Gorcunov6-667/+395
The asciidoc format is a way more easier to read by a human. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-17Update .gitignoreCyrill Gorcunov1-0/+6
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Convert GET_CURR_OFFS/SET_CURR_OFFS to functionsCyrill Gorcunov1-12/+17
In future better to not work with global variables but rather pass arguments. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Update year in headerCyrill Gorcunov1-1/+1
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in emit_dependenciesCyrill Gorcunov1-18/+18
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in mainCyrill Gorcunov1-21/+20
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in copy_filenameCyrill Gorcunov1-2/+2
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in copy_filenameCyrill Gorcunov1-52/+52
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in process_argCyrill Gorcunov1-154/+154
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in process_response_fileCyrill Gorcunov1-3/+3
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in assemble_fileCyrill Gorcunov1-187/+183
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in nasm_verror_gnuCyrill Gorcunov1-3/+3
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in nasm_verror_commonCyrill Gorcunov1-9/+9
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in define_macros_earlyCyrill Gorcunov1-25/+25
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15Drop trailing space from directive.plCyrill Gorcunov1-1/+1
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15Align enum prefixes membersCyrill Gorcunov1-4/+18
It's a way easier to read. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-04BR3392240: preproc: Don't fail on pasting of space expanded rvalue tokensCyrill Gorcunov1-4/+25
Reported-by: KO Myung-Hun <komh@chollian.net> Tested-by: KO Myung-Hun <komh@chollian.net> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-01-02NASM 2.10.07Cyrill Gorcunov1-1/+1
2012-12-27docs: Update changesCyrill Gorcunov1-0/+5
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-12-27br3392236: Don't treat \Space after \BackSlash as a sign for line continuationCyrill Gorcunov1-1/+1
In commit f1fe4fdeabeaf2e5e4d02ef43beeb09a6fbfed1b I occasionally made a \Space after \BackSlash being a sign of line continuation. Fix it. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-12-04NASM 2.10.06H. Peter Anvin1-1/+1
2012-12-04changes: document fix of macho64H. Peter Anvin1-0/+2
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2012-11-28BR3392232: Fix relocations in MachO64Keith Kanios1-1/+1
Signed-off-by: Keith Kanios <keith@kanios.net> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-11-16output: Add more Elf unificationCyrill Gorcunov2-26/+24
One day the elf output routines would be abstracted enough to be merged in one file. This patch simply removes some differences from elf32/64 code. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-11-06BR3392231: Fix get_closest_section_symbol_by_offsetCyrill Gorcunov1-23/+6
This patch changes get_closest_section_symbol_by_offset logic to lookup only the closest symbols which are at or before the supplied offset. Signed-off-by: Keith Kanios <keith@kanios.net> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-10-27BR3392226 preproc: Rework line readin procedureCyrill Gorcunov1-57/+56
It's been reported that we handle MacOS eol wrong. This patch fixes the problem. http://bugzilla.nasm.us/show_bug.cgi?id=3392226 Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-10-08doc/changes.src: Update to include recent changes.H. Peter Anvin1-0/+7
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2012-10-08BR 3327107: fix assembly of VPCMPGTQMarat Dukhan1-1/+1
Fix incorrect instruction encoding for VPCMPGTQ. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2012-09-25insns.dat: Mark the immediate for shift instructions as imm8H. Peter Anvin1-32/+32
Allow the form: mov <rm>,byte 1 ... to generate the explicit byte form. An unfortunate side effect is that disassembly is ugly; this could be fixed by making a special byte code that acts the same for the assembler but disassembles specially. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-09-25BR 3392227: Remove SB flag from SHIFT rm,immH. Peter Anvin1-32/+32
Remove the SB flag from the rm,imm forms of the shift/rotate instructions; presumably the intent was to mark the immediate as a byte immediate, but it instead caused the memory operand to be accepted without a size, but generate the incorrect code as a result. Note: it would be good to modify the UNITY filter so that the explicit form: shl eax,byte 1 ... forces the imm form rather than the ,1 form. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-09-16opflags: Rework opflags bits with OP_ macrosCyrill Gorcunov1-163/+163
In this path the opflags bits are completely reworked in a sake of simplier extension. Inparticular for Knights Corener instructions we will need new registers and new sizes. What's done - all bits are grouped in sequences, and start using OP_ macros, thus if one need to extend some field -- just tune up @shift and @bits where needed - the #define we use in code are OR'ed in symbols, this should be a way more convenient to deal with instead of pure hex numbers. The tests are passed but more eyes needed to review this rather big and intrusive patch. The reason why it's done in one single path -- for revertability in one command. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-09-16opflags: Introduce opflags generating macrosCyrill Gorcunov1-0/+4
This patch introduces two macros - OP_GENMASK, to generate masks in opflags - OP_GENBIT, to generate bit at specified position we will use them with extended 64 bits opflags. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-09-16opflags: Drop never used REG_RIP/REG_EIPCyrill Gorcunov1-3/+0
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-09-09When generate dependency names internally, quote filenamesH. Peter Anvin3-5/+18
Quote filenames for Make when generated for filenames internally. Only skip quoting when using the -MT option (rather than -MQ). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-09-09changes.src: fix grammar error (support -> supports)H. Peter Anvin1-1/+1
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-09-10opflags: Extend opflags_t to 64 bitsCyrill Gorcunov3-88/+89
Soon we will need to encode 512 bits values thus there is no space left in our opflags_t which is 32 bitfield. Extend it to 64 bits width. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>