summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-05-05assemble.c: Don't drop rex prefix from instruction itselfCyrill Gorcunov1-3/+2
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 <elpochodelagente@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-02-19NASM 2.11.02H. Peter Anvin1-1/+1
2014-02-19Add CLFLUSHOPT instructionH. Peter Anvin2-0/+5
Add the CLFLUSHOPT instruction from the Intel Instruction Set Architecture Extensions document version 319433-018 (Feb 2014). Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-02-19insns: add XSAVEC, XSAVES and XRSTORS instructionsH. Peter Anvin2-0/+10
Add the XSAVEC, XSAVES, and XRSTORS instructions from the Intel SDM release 253665-050US (Feb 2014). Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-02-18NASM 2.11.01H. Peter Anvin1-1/+1
2014-02-18changes.src: changelog for 2.11.01H. Peter Anvin1-0/+13
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-02-18outelf: Error out on "section align" without valueH. Peter Anvin1-9/+14
If someone specifies "section align" without =value, error out. Reported-by: Ilya Albrekht <ilya.albrekht@gmail.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-02-16BR 3392275: Don't require xmm0 to be specified when implicitH. Peter Anvin2-1/+17
BR 3392275 complains about xmm0 having to be explicitly included in the assembly syntax when it is implicit in the encoding. In the interest of "be liberal in what you accept", accept either form in the input. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-02-15BR3392274: output: Elf -- Don't crash on erronious syntaxCyrill Gorcunov1-1/+1
Elf align section attribute requires syntax "align=value", but in case if '=' is missed we pass nil pointer into atoi function which cause libc to crash. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-12-31NASM 2.11H. Peter Anvin1-1/+1
2013-12-31doc: Document DEFAULT BND/NOBND in changes, add use caseH. Peter Anvin2-0/+8
Add DEFAULT BND/NOBND to the change history, and explain the use case. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-12-31changes: Document change in [nosplit reg]H. Peter Anvin1-1/+7
Document that [nosplit reg] as opposed to [nosplit reg*1] will no longer force an index register. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-12-18nosplit: Generate index-only EA only when a multiplier is used.Jin Kyu Song2-3/+5
[nosplit eax] has been encoded as [eax*1+0] since 0.98.34. But this seems like unexpected behavior. So only when a register is multiplied, that will be treated as an index. ([nosplit eax*1] -> [eax*1+0]) Document is updated accordingly. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-12-18mpx: Clean up instruction dataJin Kyu Song2-20/+23
Cleaned up unneccessary size specifiers in the instruction data. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-12-18nosplit: Limit the effect of NOSPLITJin Kyu Song2-3/+5
[nosplit eax+eax] was encoded [eax*2] previously but this seems against the user's intention. So in this case, nosplit is ignored now and [eax+eax] will be generated. Document is also updated accordingly. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-12-18mib: Avoid RIP-relative addressing in mibJin Kyu Song1-0/+6
Using RIP relative for mib operands causes #UD exception. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-12-13insns: Mark LOADALL, LOADALL286 with ND flagCyrill Gorcunov1-2/+2
Otherwise disassembler treat syscall, sysret incorrectly. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-12-11mib: Handle MIB EA in a different way from regular EA'sJin Kyu Song3-39/+57
In mib operands, users' intention should be preserved. e.g.) [eax + eax*1] and [eax*2] must be distinguished and encoded differently. So a new EA flag EAF_MIB for mib operands is added. And a new EA hint EAH_SUMMED for the case of [eax+eax*4] being parsed as [eax*5] is also added. NOSPLIT specifier does not have an effect in mib, so [nosplit eax + eax*1] will be encoded as [eax, eax] rather than [eax*2] as in a regular EA. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-12-11misc/release: Generate manpagesH. Peter Anvin1-1/+1
asciidoc/xmlto are not tools we require every users to have, so each tarball should contain them. That means the release script needs to know about them. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-12-10iflag: Don't use c99 array initializationCyrill Gorcunov1-3/+3
It's sad but not all compilers support c99 features, so drop off IFLAG_INIT helper. Reported-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-12-07insns-iflags: Drop occasionally introduced \Tab'sCyrill Gorcunov1-2/+2
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-12-07iflag: \Tabs -> \SpaceCyrill Gorcunov1-7/+7
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-12-07iflag: Introduce IFLAG_INIT helperCyrill Gorcunov1-3/+3
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-12-05NASM 2.11rc4H. Peter Anvin1-1/+1
2013-12-04doc: Update nasmdocJin Kyu Song1-4/+24
Added bnd warning and nobnd prefix. DEFAULT directive section has got more description about BND-related settings. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-12-04bnd: Add a new nobnd prefixJin Kyu Song6-3/+50
bnd and nobnd prifixes can be used for each instruction line to direct whether bnd registers should be preserved or not. And those are also added as options for DEFAULT directive. Once bnd is set with default, DEFAULT BND, all bnd-prefix available instructions are prefixed with bnd. To override it, nobnd prefix can be used. In the other way, DEFAULT NOBND can disable DEFAULT BND and have nasm encode in the normal way. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-12-04bnd: Show warning when bnd prefix is droppedJin Kyu Song3-1/+5
When bnd prefix is dropped as jmp is encoded as jmp short, nasm shows a warning message, which can be suppressed with a new command line option, -w-bnd. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-12-02pfmask: Limit the preferred mask to the vendor specific flagsJin Kyu Song1-4/+3
In ndisasm, the priority follows the order of instructions in insns.dat. Other iflags could affect this mechanism when a proper instruction form had a higher iflag bit set. The preferred mask bits are now limited to vendor flags (Cyrix and AMD) and other flags do not affect disassembler any more. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-11-28doc: Make the bit about mib operands a bit clearerH. Peter Anvin1-3/+4
Clean up the text about what a mib is. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-28doc: Clean up changelog for 2.11H. Peter Anvin1-33/+25
- We don't need to list internal infrastructure improvements. - We don't list rc releases separately. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-28NASM 2.11rc3H. Peter Anvin1-1/+1
2013-11-28Add {vex3} and {vex2} prefixes by analogy with {evex}H. Peter Anvin8-13/+62
Allow specifying {vex3} or {vex2} (the latter is currently always redundant, unless we end up with instructions at some point can be specified with legacy prefixes or VEX) to select a specific encoding of VEX-encoded instructions. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-11-28NASM 2.11rc2H. Peter Anvin1-1/+1
2013-11-28Remove "high 16" register class macros for xmm/ymm/zmmH. Peter Anvin2-12/+6
The "high 16" register class macros were actually incorrect, as they simply aliased the corresponding whole set class. In oder to keep someone from getting confused and making mistakes, remove them. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-27testcase: Remove escape characters - '\'Jin Kyu Song5-4401/+4401
Since the multi-line macro preprocessor is modified to expand grouped parameter with braces. The escape character is not needed any more. The testcase converter script is also modified not to generate '\'. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-11-27preproc: Handle curly braces in multi-line macro parametersJin Kyu Song1-13/+29
Multi-line macro uses curly braces for enclosing a parameter containing comma(s). Passing curly braces as a part of a parameter which is already enclosed with braces confuses the macro expander. The number of braces in a group parameter is counted and any brace in the outmost enclosing braces is treated as a part of parameter. e.g.) mmacro {1,2,3}, {4,{5,6}} mmacro gets 2 parameters of '1,2,3' and '4,{5,6}' Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-11-27Revert "AVX-512: Handle curly braces in multi-line macro parameters"Jin Kyu Song1-5/+0
This reverts commit a800aed7b75d56114f2e1e4928cbc48ecf96a4a0. As recommended by the community, braces inside a group parameter of multi-line macro should be parsed without a need of a leading escape character such as "\{ab,c\}". Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-11-27stdscan: Rework curly brace parsing routinesJin Kyu Song4-65/+54
As recommended by the community, a comma-separated decorators ({k1,z}) and nested braces ({{k1},{z}}) are dropped out. So only standard syntax is supported from now. This rework made source code neat and easy to maintain. Most of the codes for handling corner cases are removed. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-11-27iflags: Add IF_EVEX for checking {evex} availabilityJin Kyu Song3-6/+12
For checking the availability of {evex} prefix, AVX512 iflag has been used. But this is a flag for an instruction set not for an encoding scheme. And there are some AVX512 instructions encoded with VEX prefix. So a new instruction flag (IF_EVEX) is added for the instructions which are actually encoded with EVEX prefix. This flag is automatically added by insns.pl, so no need to add manually in insns.dat. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-11-27opflags: Separate vector registers into low-16 and high-16Jin Kyu Song4-11/+34
Since only EVEX supports all 32 vector registers encoding for now, VEX/REX encoded instructions should not take high-16 registers as operands. This filtering had been done using instruction flag so far, but using the opflags makes more sense. [XYZ]MMREG operands used for non-EVEX instructions are automatically converted to [XYZ]MM_L16 in insns.pl Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-11-27doc: Update the change history and nasmdocJin Kyu Song2-3/+84
Added the list of features added since 2.10 release. Nasmdoc is also updated with those new features. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-11-27disasm: Don't rely on iflag_cmp() returning +/-1H. Peter Anvin1-1/+2
It is safer to just rely on the sign, for future options. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-11-27iflag: Do the equality test in iflag_cmp() firstH. Peter Anvin1-4/+4
The equality test indicates how long we spin, so do that first. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-11-26iflag: In iflag_cmp() scan from the most significant word downH. Peter Anvin2-4/+7
In order for iflag_cmp() to return an ordering that makes sense, we need to scan from the most significant word downward. That way the bits with the higher index consistently are the more significant. This fixes the disassembler vendor selection algorithm. While we are doing that, make that dependency more explicit in the comments. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-24iflag: Drop the use of double underscoresH. Peter Anvin1-9/+9
Double underscores are reserved for the implementation, i.e. the C compiler and its libraries. NASM is an application and should not use this namespace. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-24iflag: Make the insns_flags array constH. Peter Anvin2-9/+11
Make the insns_flags array const, and change the helper functions to match. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-24insns.dat: Fix a typo in a commentH. Peter Anvin1-1/+1
isnsn-iflags.pl not insns-iflag.pl. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-24iflag: Move instruction flag commentH. Peter Anvin3-35/+29
Move the instruction flag comment to the Perl file where they are defined. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-24iflag: remove C99 constructs, don't hardcode the number of wordsH. Peter Anvin2-30/+27
Avoid using C99 constructs when not necessary. Don't hardcode the number of words when we can autodiscover them. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-24"make alldeps"H. Peter Anvin5-133/+145
Signed-off-by: H. Peter Anvin <hpa@zytor.com>