| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Don't use explicit L's for things which are really size_t; not only is
it unnecessarily ugly, but it's wrong in a lot of ways. Do some other
minor stylistic cleanups.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
| |
We would leave the output symbol type uninitialized. Explicitly
initialize it to zero (T_NULL, meaning no symbol type information),
since that's what was effectively done.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
| |
When allocating the buffer for an mmacro list, we apparently failed to
guarantee space for the terminating NULL. This almost certainly
caused the crash described in BR 2048950, and quite possibly BR
1284169.
|
| |
|
| |
|
| |
|
|
|
|
| |
Fix the operand size for VMREAD/VMWRITE in 64-bit mode
|
|
|
|
| |
Ignore a couple of variants of editor backup files.
|
|
|
|
| |
Fix MOVNTI with a 64-bit argument.
|
| |
|
|
|
|
|
|
|
| |
Accept the VIA XCRYPT instructions either with or without a REP
prefix, as documented.
Add the missing XCRYPTCTR instruction.
|
|
|
|
|
| |
Handle indirect far jumps in 64-bit mode. Default to 64 bit unless
overridden, for consistency with other jumps.
|
|
|
|
|
|
| |
"float.h" references efunc, so it needs "nasm.h".
It also has uint8_t and so need <inttypes.h>, but that's part of
"nasm.h".
|
|
|
|
| |
Add 256-bit forms of VMOVNTPD, VMOVNTPS, and VMOVNT[DQ]Q.
|
|
|
|
| |
The AES instructions, too, have gotten VEX forms.
|
|
|
|
|
|
| |
Fix test/br2030823.asm, which had no final newline.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
| |
The official mnemonic for 32-to-64-bit sign extension is MOVSXD for
some idiotic reason. Add support for it while continue to recognize
MOVSX for this as an alias.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
| |
We added the length of VEX prefixes twice in calcsize(); this resulted
in the wrong symbol addresses when compiling without the optimizer.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
| |
R12 can be used as an index register. Special encodings in the modr/m
byte are done *without* consideration for the REX prefix, but special
encodings in the SIB byte *do* take the REX prefix into consideration,
since it doesn't affect the overall instruction format.
|
|
|
|
| |
Fix the 256-bit FMA instructions per bug report.
|
|
|
|
| |
Fix typo
|
| |
|
| |
|
|
|
|
|
| |
Touching __FILE__ would cause a dereference of an uninitialized
pointer. Fix.
|
|
|
|
|
|
| |
We would incorrectly set a bunch of VEX-related state for C4 and C5
bytes, even though we had already rejected it as not a VEX prefix due
to the top two bits of the following byte not being 11.
|
|
|
|
|
|
| |
Handle SLDT with a 64-bit register operand. Don't generate a REX.W
prefix in the assembler, since zero-extending is just fine, but do
support it in the disassembler.
|
|
|
|
|
|
| |
Checkin a26433db6805cf1f1d711eb820f6a50a98f54f36 incorrectly changed a
few break;s in do_directive() that were *inside loops* to returns.
This broke single-line macros as well as %exitrep; fix.
|
| |
|
| |
|
|
|
|
|
| |
MOV reg32,dreg and MOV dreg,reg32 are NOLONG; in 64-bit mode we always
move to/from reg64.
|
|
|
|
|
| |
Replace "alignb" with the (slightly more optimized) "alignr" macro,
but keep the name "alignb".
|
|
|
|
|
| |
Add an "alignr" standard macro, for use in BSS (nobits) and absolute
segments.
|
|
|
|
|
|
| |
Don't use a redundant "const" for macros_t (which is const unsigned
char), since OpenWatcom doesn't like it, and I believe it is incorrect
per the C standard.
|
|
|
|
| |
Add test case for BR 2003451: forwardness leakage between operands.
|
|
|
|
|
|
|
| |
Any use of ins->forw_ref that isn't related to control of the
optimizer is fundamentally broken. Use
operand->opflags & OPERAND_FORWARD instead. This even has the nice
side benefit of simplifying the code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The testcase illustrates the problem. After "nasm -f obj
alonesym.nasm"
let's look to dump:
======
PUBDEF386(91) recnum:5, offset:0000005bh, len:03f9h, chksum:bbh(bb)
Group: 0, Seg: 1
00020000h - 'sym0000' Type:0
00020004h - 'sym0001' Type:0
....
00020134h - 'sym0077' Type:0
PUBDEF(90) recnum:6, offset:00000457h, len:000ah, chksum:b6h(b6)
Group: 0, Seg: 1
00000138h - 's' Type:2
0000b600h - '' Type:0
======
The problem is while 's' offset is 20138h it is marked as type 90h not
91h. The root cause is located in obj_x():
static ObjRecord *obj_x(ObjRecord * orp, uint32_t val)
{
if (orp->type & 1)
orp->x_size = 32;
if (val > 0xFFFF)
orp = obj_force(orp, 32);
if (orp->x_size == 32)
return (obj_dword(orp, val));
orp->x_size = 16;
return (obj_word(orp, val));
}
It sets up x_size and than writes data. In the testcase data are the
offset and this offset overflows a record. In this case the record is
emitted and its x_size is cleared. Because this is last PUBDEF the new
record with only 's' symbol is emitted also but its x_size is not 32
(it's still zero) so obj_fwrite doesn't switch to 91h type.
The problem seems to be very generic and expected to be occurred on
many other record types as well.
----
And the fix is simple:
if (orp->x_size == 32)
{
ObjRecord * nxt = obj_dword(orp, val);
nxt->x_size = 32; /* x_size is cleared when a record overflows */
return nxt;
}
|
| |
|
|
|
|
| |
Use a context-local label in the smart align macro.
|
|
|
|
|
|
|
|
|
| |
Apparently the current recommendation is for a smaller threshold when
using the "generic"-style alignment macros (short jumps are cheaper on
newer CPUs.)
Also change the alignment threshold definition to reflect the maximum
number of padding instead of when to start using jumps.
|
|
|
|
| |
Smart alignment content for 16-bit "generic" mode
|
|
|
|
| |
Add 16-bit P6 NOPs
|
|
|
|
|
| |
"%use smartalign" followed by an optional "alignmode" can be used to
enable smart macros.
|
|
|
|
|
|
|
|
|
| |
Add %un[i]macro, and a few stylistic cleanups.
Note: unlike %undef, %un[i]macro takes an argument specification,
which must *exactly* match the macro being undefined. Similarly,
%unimacro has to be used to undefine a macro defined with %imacro, and
vice versa.
|
|
|
|
|
| |
Allow aligning to a non-power-of-2 boundary. It's probably useless,
but doesn't really hurt.
|
|
|
|
|
| |
The sense of %ifn and %elifn was reversed due to a bogus nonstandard
return sequence.
|