Commit Graph

2882 Commits

Author SHA1 Message Date
H. Peter Anvin
8bbf299307 Merge remote-tracking branch 'origin/master' 2013-10-24 14:17:23 +01:00
H. Peter Anvin
33eecb68c2 Makefile.in: always run "make alldeps" when "make dist"
"make dist" (tarball generation) really should include "make alldeps"
so the Makefile dependencies are correct.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-10-24 13:57:57 +01:00
H. Peter Anvin
faf04eec3c Run "make alldeps" to update dependencies 2013-10-24 13:45:06 +01:00
H. Peter Anvin
165eead3b8 Makefile.in: generate manpages for "make dist"
Make sure the "dist" target generates the man pages.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-10-24 13:25:51 +01:00
H. Peter Anvin
d089c2251b Revert "build: Include pregenerated nasm manpages"
This reverts commit 99427bdb6c.

We don't include generated files in the repository, instead we should
pregenerate them for the tarball generation, just as we do for the
Perl-generated files.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-10-24 13:22:19 +01:00
H. Peter Anvin
f9f8017ea1 macros.pl: Remove superfluous whitespace
Squeeze multiple whitespace characters together, since they have no
semantic function.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-10-19 12:20:28 -07:00
Jin Kyu Song
36ccfa5fb4 iflags: Eliminate perl smart match operator
As smart match operator reuiqres perl version 5.10.1 or later,
it is replaced with grep function.
This part of code is going to be completely removed once iflags
renovataion is done. This commit is a quick fix for a build error.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-10-07 14:51:09 -07:00
Cyrill Gorcunov
a1d481041a Merge branch 'nasm-2.10.xx'
* nasm-2.10.xx:
  coff: Better handling of section redefinition
2013-10-03 17:21:39 +04:00
Marat Dukhan
29227125f0 coff: Better handling of section redefinition
Currently, if we try to define an already defined section and specify
section flags, NASM will output "warning: section attributes ignored
on redeclaration of section %SECTIONNAME%".

The patch modifies this behaviour:

1. If the previous section definition differs only in alignment flags,
   no warning is generated

2. If the new definition implies larger alignment, it overrides the
   previous section alignment

3. If the new definition specifies any section alignment, the content of
   the section will be aligned on the new boundary (i.e. the effect is the
   same as if there was ALIGN macro)

Signed-off-by: Marat Dukhan <maratek@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-10-03 16:55:50 +04:00
H. Peter Anvin
9d5461069d Add support for DZ and RESZ, document the ZWORD keyword
Add the DZ and RESZ pseudoinstructions and add ZWORD to the
documentation.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-10-02 18:28:49 -07:00
H. Peter Anvin
a9ecfa5ae8 NASM 2.11rc1 2013-10-02 14:58:19 -07:00
H. Peter Anvin
92a4b71f1b NASM 2.10rc1 2013-10-02 14:58:02 -07:00
H. Peter Anvin
20b262ed45 Merge branch 'avx512'
AVX512 is ready enough that it will realistically be in version 2.11.
Add AVX512 to the master branch; for legacy branch maintenance use the
nasm-2.10.xx branch.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-10-02 14:28:09 -07:00
Cyrill Gorcunov
e81b2ee85c strfunc: Tabs to spaces conversion
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-09-21 13:14:15 +04:00
Marat Dukhan
91c43d789a coff: Support for section names longer than 8 bytes
http://bugzilla.nasm.us/show_bug.cgi?id=3392233

Signed-off-by: Marat Dukhan <maratek@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-09-21 13:09:03 +04:00
Jin Kyu Song
db358a2993 AVX-512: Fix bugs related to uninitialized variables
Initialized disp8 to avoid a case that disp8 encoded
instead of the actual offset value.
Added a checking routine for basereg value before using it
as an index of array.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-09-21 12:26:36 +04:00
Jin Kyu Song
eb595942b2 AVX-512: Added AVX-512PF instructions
Added Prefetch (AVX-512PF) instructions.
These instructions are supported
if CPUID.(EAX=07H, ECX=0):EBX.AVX512PF[bit 26] = 1.
CPUID feature flag for PREFETCHWT1 is TBD
but PREFETCHWT1 is included in this commit.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-09-14 01:27:10 +04:00
Jin Kyu Song
dd1c0c13c8 AVX-512: Add AVX-512ER instructions
Added Exponential and Reciprocal (AVX-512ER) instructions.
These instructions are supported
if CPUID.(EAX=07H, ECX=0):EBX.AVX512ER[bit 27] = 1.
IF_AVX512 is now shared by all AVX-512* instructions as a bit mask.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-09-14 01:27:06 +04:00
Jin Kyu Song
d4b2b5f17c AVX-512: Add AVX-512CD instructions
Added Conflict Detection (AVX-512CD) instructions.
These instructions are supported
if CPUID.(EAX=07H, ECX=0):EBX.AVX512CD[bit 28] = 1.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-09-14 01:27:02 +04:00
Jin Kyu Song
c257bb6ae0 AVX-512: Add Pseudo-ops for CMP instructions
Added three-operand pseudo-ops for VCMPPD, VPCMPD and so on.
Test case is also updated to validate them.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-09-07 11:50:39 +04:00
Jin Kyu Song
4f14a4b9ed AVX-512: Reorder instructions in insns.dat
Within a same instruction mnemonic, instructions are reordered
in order of opcode byte value.
Therefore when there are two possible opcode candidates, smaller
opcode is picked now.
e.g.) vmovapd zmm30, zmm29 -> now 28h is used. 29h previously

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-09-07 11:50:18 +04:00
Jin Kyu Song
c47ef9490b AVX-512: Fix rounding mode value in EVEX prefix with SAE
If SAE is set, VL(vector length) is implied to be 512.
EVEX.L'L (=EVEX.RC) is set to 00b by default.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-09-07 11:50:11 +04:00
Jin Kyu Song
088827bc6c AVX-512: Add test case for opmask instructions
Added K* instructions test cases in test/avx512f.asm.
The previous test case from GNU AS were repeating the same instruction twice,
so the repeated half part is removed.
Changed the python script (gas2nasm.py) to include opmask instructions.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-29 10:03:36 +04:00
Jin Kyu Song
daafcbae77 AVX-512: Remove trailing space and align columns
Cosmetic change

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-29 10:03:28 +04:00
Jin Kyu Song
79d39748b0 AVX-512: Add OPMASK instructions
Added opmask instructions (kandw and etc). Defined KREG and RM_K
aliasing RM_OPMASK and OPMASKREG respectively to make insns.dat
look neat.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-29 10:03:24 +04:00
Jin Kyu Song
b21f97db0e AVX-512: Add IF_SPMASK and fix IF_PFMASK
Defined IF_SPMASK for specific processor types and
fixed IF_PFMASK to mask the exact preferred bits only.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-29 10:03:19 +04:00
Jin Kyu Song
7abc78dee0 AVX-512: Fix bug in checking high-16 registers
Register value needs to be checked. Previous patch compared with reg_enum.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-29 10:03:14 +04:00
Jin Kyu Song
6d16d2836d AVX-512: Fix comments
Fixed or purged some old comments and added a comment for a previous patch.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-29 10:03:09 +04:00
Jin Kyu Song
e3a06b9d0a AVX-512: Remember the position of operand with broadcast or embedded rounding
It was not so straight forward to find the postion of operand that has
a broadcasting, embedded rounding mode or SAE (Suppress All Exceptions)
decorator out from operands types or bytecode.
Remebering the postion of the operand of interest in the parser reduces
the burden that assembler looks through the operands.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-29 10:03:02 +04:00
Jin Kyu Song
fe0ee08586 AVX-512: Add a feature to generate a raw bytecode file
From gas testsuite file, a text file containing raw bytecodes
is useful when verifying the output of NASM.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-28 14:27:25 +04:00
Jin Kyu Song
f9442f67d5 AVX-512: Add a test case for EVEX encoded instructions
This was converted from a gas testsuite.
(gas/testsuite/gas/i386/x86-64-avx512f-intel.d)
A python script that is used for converting is also included.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-28 14:27:17 +04:00
Jin Kyu Song
66c61926b1 AVX-512: Fix match function to check the range of registers
High-16 registers of XMM and YMM need to be encoded with EVEX not VEX.
Even if all the operand types match with VEX instruction format,
it should use EVEX instead.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-28 09:37:31 +04:00
Jin Kyu Song
9bb987d8e0 AVX-512: Change the data type for instruction flags
Increased the size of data type for instruction flags from 32bits to 64bits.
And a new type (iflags_t) is defined for better maintainability.

Bigger data type is needed because more instruction set types are coming
but there were not enough space for them. Since they are not bit masks,
only one instruction set is allowed for each instruction.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-28 09:37:21 +04:00
Jin Kyu Song
d2d9c3ee38 AVX-512: Fix a bug in calculating Disp8*N value
Fixed a bug that derived an incorrect N value for tuple types of
T2, T4, T8.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-28 09:37:14 +04:00
Jin Kyu Song
4a6570616a AVX-512: Find the correct position of the last SIMD op
Since embedded rounding mode is following the last SIMD op,
GPR op should be skipped when finding the last SIMD op.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-28 09:35:54 +04:00
Jin Kyu Song
c62bc20a0b AVX-512: Moved {er} decorator position next to the last SIMD op
This is for following the current syntax used in gas even though
this is not SDM conforming.
According to SDM, {er} should follow the last GPR op not SIMD op.
e.g. SDM : VCVTSI2SD xmm1, xmm2, r/m64{er}
    NASM : VCVTSI2SD xmm1, xmm2{er}, r/m64

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-28 09:35:47 +04:00
Jin Kyu Song
50ab1522e9 AVX-512: Fix parser to handle opmask decorator correctly
When a memory reference operand is a destination, this could have
an opmask decorator as well.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-22 19:37:49 +04:00
Jin Kyu Song
d4760c19b5 AVX-512: Add ZWORD keyword
ZWORD (512 bits) keyword is added

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-22 19:37:44 +04:00
Jin Kyu Song
4d1fc3f1a0 AVX-512: Fix instruction match function
When an instruction allows broadcasting, the memory element size is
different from the size of normal memory operation.
This information is provided in a decoflags field, so it should try to
match those properties before it fails.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-22 19:37:37 +04:00
Jin Kyu Song
f9a71e0c38 AVX-512: Reword comment about opmask decorators
Previous comment was not so clear.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-22 19:37:32 +04:00
Jin Kyu Song
a800aed7b7 AVX-512: Handle curly braces in multi-line macro parameters
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.

Escape character '\' is prefixed in this case.
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>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-22 19:37:25 +04:00
Jin Kyu Song
cc1dc9de53 AVX-512: Add EVEX encoding and new instructions
EVEX encoding support includes 32 vector regs (XMM/YMM/ZMM),
opmask, broadcasting, embedded rounding mode,
suppress all exceptions, compressed displacement.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-16 09:06:15 +04:00
Jin Kyu Song
72018a2b43 AVX-512: Add support for parsing braces
AVX-512 introduced new syntax using braces for decorators.
Opmask, broadcat, rounding control use this new syntax.

http://software.intel.com/sites/default/files/319433-015.pdf

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-06 09:37:52 +04:00
Cyrill Gorcunov
b775985bee NASM 2.10.09 2013-07-23 09:36:13 +04:00
Cyrill Gorcunov
e74e494805 doc: changes -- Prepare for 2.10.09
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-07-23 09:36:00 +04:00
Cyrill Gorcunov
99427bdb6c build: Include pregenerated nasm manpages
It's been reported that force people to install
asciidoc for man pages generation is not acceptible.
Just ship them pregenerated.

http://bugzilla.nasm.us/show_bug.cgi?id=3392262

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-07-22 10:09:35 +04:00
Cyrill Gorcunov
57a576ce1e NASM 2.10.08
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-07-21 20:58:43 +04:00
Cyrill Gorcunov
85f734b6ab doc: changes -- Add fixes for VMOVNTDQA, MOVNTDQA, MOVLPD
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-07-21 14:47:51 +04:00
Cyrill Gorcunov
340ac1a915 test: Add br978756
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-07-21 14:45:48 +04:00
Cyrill Gorcunov
31d73aefb3 test: Add br3392259
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-07-21 14:45:48 +04:00