The o64, a64 and a16 prefixes are only possible in specific
modes. It is a lot easier to debug with a more sensible error message.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
The prefix/suffix directive documentation were missing some brackets,
lost in the course of editing.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
`a || b` only evaluates b if a is false. `a | b` always evaluates
both a and b. If a and b are of type bool, || is usually what you
want, so clang now warns on `|` where both arguments are of type bool.
This warning fires once in nasm. It looks like `|` is an (inconsequential)
typo of `||`, so use that instead.
No intended behavior change.
Not all registers are valid as memory references, and thus
using RM_ZERO is incorrect. Use RN_ZERO instead, which is simply the
zero-register bit.
Fixes: https://github.com/netwide-assembler/nasm/issues/140
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
[ hpa: added comment that "rm" really is a WMAKE internal command. ]
Signed-off-by: KO Myung-Hun <komh78@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Open Watcom does not support 64-bit constants at 'case'.
[ hpa: I'm pulling this, but I'm really, *really* questioning its
supportability long term. The OpenWatcom people need to fix this, or
we are just going to have to say "OW is not supported."
At some point we *are* going to move to a "C99 is baseline" policy for
code; there are simply too many features in C99 that are actively
painful to be without.
That is, unless we decide to go to C++, which is under consideration
but is a much bigger job. In that case, the target will probably be
either C++11 or C++14 as those C++ versions contain some pretty
essential features. ]
Signed-off-by: KO Myung-Hun <komh78@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
For the benefit of those platforms which have to rely on VPATH, avoid
having the same filename in multiple subdirectories.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
All the 16 AMX-TRANSPOSE instructions were removed from the 59th
edition of "Intel Architecture Instruction Set Extensions and Future
Features Programming Reference" September 2025, 319433-059.
Similar to PCOMMIT, they are tagged as 'NEVER'
[ hpa: don't remove from tests, but suppress the warnings. Don't
remove the CPUID tag; a future version of NASM will actually implement
CPU filtering based on the various CPUID tags; that development is
genuinely in progress. ]
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Use autoconf to find either python3 or python.
Add option to travis to filter the contents of stdout or stderr.
Generate the _version.stdout travis matching file from the version
file.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
-- AMX instruction fixes
-- AMX test file extension with new levels
according to Intel ISA Extension Guide 58th edition
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Make the spellings for the label-mangling options and pragmas
consistent, and implement the directive forms which were documented
but never implemented.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
The shift and rotate patterns are "interesting" in the following way:
1. Even though only 4/5/6 bits of the input are ever used, for the
regular instructions the input is specified as the CL register, but
for the -X instructions as a size-matching register. This makes the
optimization patterns "interesting."
2. The sequencing of legacy, VEX -X versions, APX EVEX, and APX -X
For #1, allow any size register to contain the shift count.
For #2, split up the macro generation of the patterns, and add a new
"$xmacro" macro to deal with the combinatorics of generating all the
-X patterns. Written directly in Perl since it seemed easier than
trying to make anything more general for what is very much a special
case...
Reported-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Most instructions support contracted forms, but those had been overlooked.
Signed-off-by: Henrik Gramner <henrik@gramner.com>
[ hpa: manual merge ]
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
The rounding specifier should be applied to src2, not src1.
Furthermore, VCVTSI2SD with a 32-bit source operand does not
support specifying a rounding mode (as no rounding can occur).
Signed-off-by: Henrik Gramner <henrik@gramner.com>
[ hpa: manual merge ]
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
"suffix" is the more common English term, but NASM used "postfix" for
a long time. Allow them as aliases, and tidy up the documentation
accordingly. While making these changes, tidy up the handling of
options in the index.
Fixes: https://github.com/netwide-assembler/nasm/pull/61
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
According to the June edition of SDM evex-form of the VCVTPS2PH command only exists with mmmmm equal to 0f38, and map5 only exists for the VCVTPS2PHX command
It is somewhat counterintuitive, but the correct flag for the memory
operand is "OSIZE". The "nw" flag takes care of promoting the default
operand size on 64 bits to 64.
Fixes: https://github.com/netwide-assembler/nasm/issues/130
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Quick and easy way to run the same test for 16-, 32- and 64-bit output
without mixing them together in one binary output file.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This is really just a shorthand for the --before option, but it is
really convenient for quickly writing multimode tests.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Generalize pp_pre_command() so that the first argument doesn't have to
be a preprocessor token. Instead, the two arguments are now both
turned into token streams, separated by a whitespace token.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Although one can implement this "manually" in terms of %sel(), this
function is *really* useful for making multi-mode tests and allows for
better error checking.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
If an instruction triggers an error (nasm_nonfatal) it is legitimate
for calcsize() to return 0; in that case no further processing is
needed.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
The label-orphan warning is *way* more useful if it includes the
actual label name; this way the programmer can usually spot
immediately if it is a label or misspelled instruction.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>