Make it possible to generate variants of RET(F) with explicit operand
size specified without having to use o16/o32/o64.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
It not only reads static variable but writes it back as well.
https://bugzilla.nasm.us/show_bug.cgi?id=3392461
Reported-by: Michael Šimáček <msimacek@redhat.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
The rarely used 64-bit absolute load instruction (what gas calls
movabsq) needs to be declared ABS if we are in relative mode, which is
normally the case.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
There are some gotchas in how immediates and pointers are loaded in
64-bit mode and how they interact with optimization. Document those
cases.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Bullet points are considered paragraphs, so our documentation compiler
require an empty line between them.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Automatically assign values to the instruction flags; we ended up with
a case where pushing flags into the next dword caused comparison
failures due to other places in the code explicitly comparing
field[3].
This creates necessary defines for this not to happen; it also cleans
up a fair bit of the iflag code.
This resolves BR 3392454.
Reported-by: Thomasz Kantecki <tomasz.kantecki@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
In commit a8f3698cf3
the iflag_cmp_cpu_level escaped updating. Fix it.
Reported-by: Tomasz Kantecki <tomasz.kantecki@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Get rid of remaining dependencies on FILENAME_MAX, which ought to have
been removed a long time ago.
Remove ofmt->filename(); all implementations pretty much do the same
thing and there is absolutely no reason to duplicate that
functionality all over the place.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Add ERR_TOPFILE, for cases where displaying the current file and line
are completely inappropriate. Instead, display the main input file,
or, if not available, the output file.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
We have hardcoded ERR_NOFILE in a number of places which really should
not need them, and it represents loss of information. Instead, be
robust in the handling either of no filename or no line number.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Add more simplifications where it is practical; unify WRITECHAR() as
it has no need for byte swapping in any way.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Make the WRITE*() macros independent of pointer type. As it was, we
would get totally wrong result on X86_MEMORY machines if the pointer
was not uint8_t *.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
We can't really avoid the double expansion of (p), but the WRITE*()
macros all do that. However, there is no reason to double-expand (s).
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>