4964 Commits

Author SHA1 Message Date
Cyrill Gorcunov
40650a357a travis: add sreg
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-25 18:08:33 +03:00
Cyrill Gorcunov
91d0980bfa travis: add ret
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-25 18:05:33 +03:00
Cyrill Gorcunov
f2854471ac travis: add vaesenc
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-25 16:36:10 +03:00
Cyrill Gorcunov
852e80b011 travis: add vex
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-25 16:36:10 +03:00
Cyrill Gorcunov
70eb4a0885 travis: add vgather
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-25 16:36:10 +03:00
Cyrill Gorcunov
186c28395f travis: add warnstack
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-25 16:36:10 +03:00
Cyrill Gorcunov
e2917fd775 travis: add vpcmp
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-25 16:36:10 +03:00
Cyrill Gorcunov
8142ab699d travis: add winalign
It is disabled by now -- we need to teach nasm-t to
skip some parts of output (due to format specifics).

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-25 16:36:10 +03:00
Cyrill Gorcunov
4b3ac4eefd travis: nasm-t -- add ability to disable test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-25 16:36:10 +03:00
Cyrill Gorcunov
d9eed2bec7 travis: add xdefine test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-25 16:36:10 +03:00
Cyrill Gorcunov
7f3cfafbd9 travis: add br3392275
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-25 16:36:10 +03:00
Cyrill Gorcunov
63ccbf4f5f travis: nasm-t -- add ability to generate new tests
Just to not fill descriptor by hands every time.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-25 16:36:06 +03:00
Cyrill Gorcunov
d2e3bd850f travis: add xpaste test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-24 18:03:32 +03:00
Cyrill Gorcunov
b2fb88596e travis: add avx2
Initial conversion by nasm64developer.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-24 16:23:53 +03:00
Cyrill Gorcunov
62bae12eed travis: add br3104312
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-24 15:24:32 +03:00
Cyrill Gorcunov
355d8bf40c travis: add amx test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-24 15:24:32 +03:00
Cyrill Gorcunov
3d1f5ce8e7 travis: update absolute
To match test/ instance.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-24 15:24:22 +03:00
Cyrill Gorcunov
f0b0155280 travis: add a64 test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-24 13:48:31 +03:00
H. Peter Anvin (Intel)
7173483043 NASM 2.15.04 nasm-2.15.04 2020-08-20 15:37:42 -07:00
H. Peter Anvin
71087e1496 NASM 2.15.04rc6 nasm-2.15.04rc6 2020-08-20 08:14:29 -07:00
H. Peter Anvin
f3a3f9925c Auto-make the warning files
The warning files are generated by a script, but the scripts is fast
enough run every time a C file is updated. To prevent having to
rebuild every file, however, make the generation script only actually
modify the file if it has changed.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-18 15:07:51 -07:00
H. Peter Anvin
fb95a2ef7a br3392643: update travis test
The warning output by obj symbol truncation has been changed, update
the travis reference accordingly.

Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-18 12:37:35 -07:00
H. Peter Anvin
6236b39e06 outobj: change cutting -> truncating
I believe "truncating" is the more common terminology in this case, so
change to it for aestetic reasons only.

Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-18 12:34:33 -07:00
H. Peter Anvin
4a2c8c52c7 outobj: limit excessive length warning to 64 characters
The case where we warn for excessive length should presumably have
been %.nnns which means limit length to nnn characters, rather than
%nnns which means left-pad with spaces to nnn bytes if possible. Also
change the limit from 128 to 64, to make it more likely to not line
break.

Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-18 12:33:51 -07:00
Cyrill Gorcunov
51e23ac72a travis: add br3392643 test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-18 21:05:56 +03:00
Cyrill Gorcunov
f14552e5fb BR3392646: output/outobj.c: fix memory corruption in long object names
When we encode a name we put its length before it, the
storage is one byte width so the name can't be more
than UINT8_MAX (ie 255) bytes length.

Moreover if one provide a name more than RECORD_MAX then
we simply overwrite random memory.

Thus lets do as in other obj_check calls -- shrink the
size we gonna use. But unlike oter code lets yield a
warning as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-18 20:27:14 +03:00
Cyrill Gorcunov
57e0b3e56a travis: add br3392711 test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-18 13:59:12 +03:00
Cyrill Gorcunov
7c88289e22 BR3392711: preproc: fix memory corruption in expand_one_smacro
The mempcpy helper returns *last* byte pointer thus when
we call set_text_free we have to pass a pointer to the
start of the string.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-18 11:27:03 +03:00
H. Peter Anvin (Intel)
4268400c10 NASM 2.15.04rc5 nasm-2.15.04rc5 2020-08-17 15:28:31 -07:00
H. Peter Anvin (Intel)
6dc8379d6a rdoff: disable broken backend, document deprecation
The RDOFF backend has been broken since at least NASM 2.14, throwing
an immediate assert. Since only one person appears to have even
noticed, and fixing it properly looks like it would take quite a bit
of work, disable this back end and document its deprecation.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-17 15:26:11 -07:00
H. Peter Anvin (Intel)
235a115130 doc: document long-standing restrictions in the use of $ in Dx
$ in data expressions is hazardous. A proper fix for this turns out to
be quite complex, as it requires the expression engine to propagate
additional data. For now, just put it into the documentation.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-17 15:10:26 -07:00
Cyrill Gorcunov
8806c3ca00 BR3392712: pp_tokline: fix double free
Make sure the data being freed get double
freed after -- the pointers must be zapped
(actually nasm_free and free_tlist support
being called with NULL pointer as an argument).

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-08-17 21:30:14 +03:00
H. Peter Anvin
0491fda82f NASM 2.15.04rc4 nasm-2.15.04rc4 2020-08-13 17:21:28 -07:00
H. Peter Anvin
d988ce719c Fix inefficient encoding of MPX instructions
BNDMK, BNDLDX, and BNDSTX are split-SIB (MIB) instructions, but do
*not* require a SIB encoding. However, TILELOAD* and TILESTORE* *do*
require a SIB in all cases. Split the MIB flag into MIB (split
address) and SIB (SIB required) flags.

This fixes travis test mpx.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-13 17:21:00 -07:00
H. Peter Anvin
7839766663 eval, float: fix the __float80e__ and __float128h__ conversions
We need to add the byte offset into the floating-point value to get
the correct result for these floating point to integer conversions.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-13 13:41:46 -07:00
H. Peter Anvin (Intel)
50200cc0d3 configure.ac: add option to compile with suggestion warnings
Add a configure option to enable suggestion warnings, currently a set
of -Wsuggest-attribute=* warnings.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-30 17:37:42 -07:00
H. Peter Anvin (Intel)
c9467688b4 Add [v]printf_func() attributes where appropriate
Add a new macro vprintf_func() for vprintf-style functions, and add
printf_func() and vprintf_func() attribute arguments whereever
meaningful.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-30 17:30:20 -07:00
H. Peter Anvin (Intel)
ed47b8ce3e NASM 2.15.04rc3 nasm-2.15.04rc3 2020-07-30 17:08:59 -07:00
H. Peter Anvin (Intel)
78df8828a0 output/codeview.c: use list_for_each_safe() to free a list
Using list_for_each() is by definition not safe when freeing the
members of the list, use list_for_each_free() instead.

Also, use nasm_new() and nasm_free() where appropriate.

This was discovered as a downstream bug from BR 3392707.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-30 17:06:24 -07:00
H. Peter Anvin (Intel)
bae6b070ff BR 3392705: AVX512: reinstate the SSE-like opcodes for VPCMPEQ/GT
The VPCMP instructions are controlled by an immediate byte, but there
is also a set of SSE-derived legacy opcodes for VPCMPEQ and
VPCMPGT. For the specific cases of VPCMPEQ and VPCMPGT, prefer those
opcodes since they are one byte shorter.

Reported-by: ig <glucksmann@avast.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-30 16:56:52 -07:00
H. Peter Anvin (Intel)
6299a3114c BR 3392708: fix NULL pointer reference for invalid %stacksize
After issuing an error message for a missing %stacksize argument, need
to quit rather than continuing to try to access the pointer.

Fold uses of tok_text() while we are at it.

Reported-by: Suhwan <prada960808@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-30 15:57:57 -07:00
H. Peter Anvin (Intel)
6ac6ac57e3 parser: when flattening an eop, must preserve any data buffer
An eop may have a data buffer associated with it as part of the same
memory allocation. Therefore, we need to move "subexpr" up instead of
merging it into "eop".

This *partially* resolves BR 3392707, but that test case still
triggers a violation when using -gcv8.

Reported-by: Suhwan <prada960808@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-30 15:48:45 -07:00
H. Peter Anvin (Intel)
0e6e013813 nasm: don't make -L+ imply -Lw
-Lw really is only useful to debug NASM crashes, and can hugely slow
down the assembler. Make -L+ simply imply full verbosity; if NASM
crashes use -Lw+ instead.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-30 15:25:00 -07:00
H. Peter Anvin (Intel)
e56c2dc5b7 insns.pl: audit for impossible Sx patterns; fix a few
Break the instruction processing if there are impossible combinations
of Sx flags and operand sizes. If the intent is to always require
explicit sizes, use the SX flag.

The INSERTPS instruction pattern was explicitly wrong, the rest of
these are nuisance fixes.

TODO: fix the disassembler to be able to exclude patterns where these
bits don't matter.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-30 15:16:11 -07:00
H. Peter Anvin (Intel)
5b89628e44 NASM 2.15.04rc2 nasm-2.15.04rc2 2020-07-28 13:50:04 -07:00
H. Peter Anvin (Intel)
9d96e7a6a4 BR 3392704: unbreak MOVHPD instruction
MOVHPD takes a mem64, but was incorrectly tagged SO - an impossible
combination.

The Sx tags really are a problem and should be removed in the future
whereever possible, presumably in the master branch.

Reported-by: Lukas Hönig <lukashoenig@icloud.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-28 13:39:44 -07:00
H. Peter Anvin (Intel)
1803518017 NASM 2.15.04rc1 nasm-2.15.04rc1 2020-07-27 13:28:05 -07:00
H. Peter Anvin (Intel)
671f204ed1 phash: bloat the hashes somewhat, reducing the likelihood of false positives
Set the hash size scaling constant to 1.6, signifying 3.2 times the
hash load. This both reduces the convergence time and makes it less
likely (< 25%) that a non-entry will require a secondary comparison,
and after all, in most of our use cases non-entries are by far the
more common.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-27 13:24:59 -07:00
H. Peter Anvin (Intel)
e743b89f25 BR 2292703: Add memory sizes to SSE and some other instructions
Most SSE instructions were missing memory operand sizes, resulting in
error if a memory operand was specified with explicit size.

Reported-by: <nemeth.marton@hotmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-27 13:20:38 -07:00
H. Peter Anvin (Intel)
421e4d03ea changes.src: document COFF alignment fix
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-27 12:36:36 -07:00