Commit Graph

2167 Commits

Author SHA1 Message Date
H. Peter Anvin
29c96651de Revert "BR3005117: Expland local single macro before pasting tokens"
This reverts commit ec88c1beac.

Revert due to BR 3026808.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-08 08:35:32 -07:00
H. Peter Anvin
13dbfad76b Revert "expand_mmac_params: Don't forget to handle TOK_OTHER"
This reverts commit 51fd86e0fe.

Revert due to BR 3026808.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-08 08:34:41 -07:00
H. Peter Anvin
6f5f7ef417 Revert "expand_mmac_params: Expand local single macros unconditionally"
This reverts commit 1f6741fc78.

Revert due to BR 3026808.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-08 08:33:47 -07:00
H. Peter Anvin
ddd08c3ccc Revert "expand_mmac_params: Expand local single macros unconditionally"
This reverts commit 985d880c15.

Revert due to BR 3026808.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-08 08:33:14 -07:00
H. Peter Anvin
f86b8b22e1 Check in test case from bug report br3005117
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-08 08:30:23 -07:00
H. Peter Anvin
4106753f6c br3026808: add test case
Add test case for BR 3026808 (%assign %$local).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-08 07:31:45 -07:00
H. Peter Anvin
3a014348ca insns: add FXSAVE64/FXRSTOR64, drop np prefix
Add FXSAVE64 and FXRSTOR64; drop the np prefix on 0F AE instructions:
none of the rest of the 0F AE instructions have them, and there are no
conflicts.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-07 17:20:19 -07:00
H. Peter Anvin
9eb663c087 Merge branch 'master' of ssh://repo.or.cz/srv/git/nasm 2010-07-07 17:17:30 -07:00
H. Peter Anvin
a7407bb5c9 insns.dat: add XSAVE/XRSTOR64, XSAVEOPT, VCVTPH2PS/VCVTPS2PH
Add XSAVE64/XRSTOR64 (previously missing), XSAVEOPT/XSAVEOPT64 (per
AVX 007 spec), and VCVTPH2PS/VCVTPS2PH (per AVX 007) spec.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-07-07 13:48:14 -07:00
H. Peter Anvin
1b8423e1b8 insns.dat: remove VCVTPH2PS/VCVTPS2PH as AMD instructions
Remove VCVTPH2PS/VCVTPS2PH as AMD instructions based on version 3.04
of the AMD spec.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-06 19:38:35 -07:00
H. Peter Anvin
c66ec090a0 NASM 2.09rc2 2010-07-06 15:06:51 -07:00
Cyrill Gorcunov
f2c1cb06e0 doc: Update changes.src
Before soon-coming 2.09rc2.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-07 01:48:33 +04:00
H. Peter Anvin
1e3805f975 insns.dat: fix CPU flags for new instructions
FUTURE is a CPU level flag, and cannot be combined with X64 (which is
shorthand for X86_64,LONG).  Also, make sure we add LONG annotations
to everything that is 64-bit mode only.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-06 09:23:24 -07:00
H. Peter Anvin
0416b232ce Add RD*SBASE, WR*SBASE, RDRAND from AVX v7
Add the RD*SBASE, WR*SBASE and RDRAND instructions from version 7 of
the AVX specification, Intel document 319433-007.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-06 09:17:18 -07:00
Cyrill Gorcunov
4cc1064328 outbin: Cleanup bin_cleanup
No need for 'q' variable.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-06 19:40:02 +04:00
Cyrill Gorcunov
faf23d1302 outbin: Simplify reverse address computing
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-06 19:08:28 +04:00
Cyrill Gorcunov
2b416c9def BR3025702: outbin -- Fix byte ordering
In commit 55ae12052c we occasionally broke byte ordering. Fix it.
Note that current stable version 2.08.01 is not affected by this bug.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-06 18:33:29 +04:00
H. Peter Anvin
0d55110313 doc: inslist.src is an intermediate file, move to "make clean"
inslist.src is an intermediate file, it should be in "make clean"
rather than "make spotless"; otherwise it ends up in the xdoc tarball.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-06-25 13:40:10 -07:00
Cyrill Gorcunov
f85cd55731 BR 3020760: insns.dat -- confirm push imm32 on x86-64 explicitly
PUSH imm64 confuses ones who is trying to find this instruction in
processor programming manuals.

Actually it was introduced in a sake of "push `size' imm" consistency.
In other words -- to allow users to state "PUSH qword imm32" in 64bit code,
though on byte level (ie generated) code it still has a correct and valid
sign-extended "PUSH imm32" instruction.

To get rid of this ambiguie bite we make explicit "PUSH imm32"
being valid in 64bit code. This also makes "PUSH dword imm32"
valid in 64bit code as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-06-25 18:28:15 +04:00
Cyrill Gorcunov
efb358339d preproc.c: Get rid of signed/unsigned comparison warning
We need mac->nparam being explicictly int'fied otherwise
compiler issue a warning. Note that we might have been
using unsigned int but it would break an ability to pass
negative indices.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-06-20 01:52:19 +04:00
H. Peter Anvin
2df23513b3 BR 3018233: handle LFS, LGS and LSS with a 64-bit register
LFS, LGS and LSS are valid in 64-bit mode and have 64-bit (REX.W)
forms.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-06-18 16:24:46 -07:00
H. Peter Anvin
d68d9181df openwcom.mak: drop /f from delete commands
Classic DOS doesn't have del /f, and we don't really need it.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-06-15 10:49:09 -07:00
H. Peter Anvin
5e2e8b9105 Rename filenames to 8.3 format
Apparently some people still care about compiling native on MS-DOS,
and we don't have a significant number of files which need adjustment.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-06-15 10:47:16 -07:00
Cyrill Gorcunov
985d880c15 expand_mmac_params: Expand local single macros unconditionally
Peter proposed to expand local single macros unconditionally.
This should not hurt but give us more cleaner code in result.

Reported-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-06-08 18:45:06 +04:00
Cyrill Gorcunov
1f6741fc78 expand_mmac_params: Expand local single macros unconditionally
Peter proposed to expand local single macros unconditionally.
This should not hurt but give us more cleaner code in result.

Reported-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-06-08 18:39:56 +04:00
H. Peter Anvin
b714cb27cb outobj: handle compilers without 64-bit switch() support
OpenWatcom, in particular, doesn't handle switch() statements with
64-bit expressions, sigh.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-06-07 11:34:28 -07:00
H. Peter Anvin
4dff757ba5 outelf32: handle compilers without 64-bit switch() support
OpenWatcom, in particular, doesn't handle switch() statements with
64-bit expressions, sigh.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-06-07 11:26:11 -07:00
Cyrill Gorcunov
b1a1e69a8f NASM 2.09rc1 2010-06-06 00:13:43 +04:00
Cyrill Gorcunov
640edfd784 nasmdoc: Document macro parameters range
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-06-05 11:24:59 +04:00
Cyrill Gorcunov
2f40375077 expand_mmac_params_range: Simplify condition
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-06-05 10:47:10 +04:00
Cyrill Gorcunov
c57eb51527 preproc.c: Fix argument indices checking in parameters range
Otherwise %{-1:-1} fails.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-06-05 01:58:10 +04:00
Cyrill Gorcunov
c29404d7ba preproc.c: Introduce macros parameters range expansion
Introduce an ability to expand multi-line macros parameters in
a range/sequence manner.

For this purpose a special form is introduced %{x:y} which means to
expand %{x:y} to %{x},%{x+1},%{x+2},...,%{y}.

Both arguments could be negative or positive but MUST NOT be zero.

The arguments take into account possible %rotate as well.

Note that unlike the approach implemented in yasm we refer :-1 as
_last_ argument passed to a macro call, this makes possible to refer
the last element from macro via record as %{-1:-1} which could be
a convenient trick.

Also you can refer the argument in reverse order, ie it's legitime
to write %{5:4}, or even to reverse the all arguments %{-1:1}.

An example

 |
 | %macro mpar 1-*
 |     db %{1:-2}
 | %endmacro
 |
 | mpar 1,2,3,4,5,6

in result we'll get the sequence of 1,2,3,4,5

Reported-by: nasm64developer <nasm64developer@users.sf.net>
Inspired-by: Mathieu Monnier <mathieu.monnier@polytechnique.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-06-05 01:50:59 +04:00
Cyrill Gorcunov
ca61119a01 expand_mmac_params: Format condition
It's much easier to read aligned

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-06-04 22:16:54 +04:00
Cyrill Gorcunov
a731924978 nasmlib: Rename elements() macro to ARRAY_SIZE
ARRAY_SIZE is a well known name pointing out that
we're dealing with array in macro argument.

Also to be on a safe side prefix_name helper should
check the index been in bounds more precisely.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-06-03 23:17:21 +04:00
Cyrill Gorcunov
3b4e86b1dd preproc.c: Use list_ helpers
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-06-02 20:31:53 +04:00
Cyrill Gorcunov
51fd86e0fe expand_mmac_params: Don't forget to handle TOK_OTHER
TOK_OTHER is legitime to follow TOK_PREPROC_ID so don't forget to handle it as well.

[ An addition to commit ec88c1beac ]

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-06-02 20:31:46 +04:00
Cyrill Gorcunov
ec88c1beac BR3005117: Expland local single macro before pasting tokens
When we have switched to unified token pasting code we loose
backward compatibility. Restore it.

Note that new code MUST not expluatate this facility but rather
use paste macro %+ explicitly.

N.B. this patch is probably the candidate for revert, though
to give it a chance I commit it.

Reported-by: Alexey Dokuchaev
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-06-02 01:05:37 +04:00
H. Peter Anvin
f237c71c0d New %use package "fp"
New standard macro package with utility macros for floating-point
constants.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-05-07 13:42:09 -07:00
H. Peter Anvin
19cbe0c1c4 nasmdoc: document octal/binary floating-point
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-05-07 13:21:20 -07:00
H. Peter Anvin
c8d8a13cde nasmdoc: add missing comma
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-05-07 13:14:45 -07:00
H. Peter Anvin
26bb8890ef nasmdoc: update the full set of numeric prefix/suffix characters.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-05-07 13:12:12 -07:00
H. Peter Anvin
62de275527 outobj: update error message
The possible sizes we can encounter are 1, 2, 4, 8... make sure we get
a proper error message.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-05-06 17:58:46 -07:00
H. Peter Anvin
931ce775cf outobj: properly error on unsupported relocations
Error out on any relocations not supported by the backend.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-05-06 17:52:57 -07:00
H. Peter Anvin
bce369022a outelf64: update copyright date
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-05-06 17:45:39 -07:00
H. Peter Anvin
32575e46ac ELF support for 8-bit relocations
Support 8-bit relocations (OUT_ADDRESS and OUT_REL1ADR) in ELF.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-05-06 16:14:00 -07:00
H. Peter Anvin
fea84d7fec Permit short intersegment jumps
Allow an intersegment jump to be short (OUT_REL1ADR) if explicitly
specified so by the user.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-05-06 15:33:24 -07:00
H. Peter Anvin
55ae12052c Add support for one-byte relocations
Add OUT_REL1ADR (one-byte relative address) and support for
OUT_ADDRESs with size == 1.  Add support for it in
outbin and outdbg.  *It still needs to be added to other backends*,
both the OUT_REL*ADR and OUT_ADDRESS codepaths need to be handled.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-05-06 15:33:24 -07:00
Cyrill Gorcunov
97ec06a16a MachO: Fix misprinted macho_sectalign
macho_sectalign was occasionally misprinted
with macho_setcalign, fix it. No change on functionality.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-04-28 23:17:13 +04:00
Cyrill Gorcunov
a20b668add obj: Implement sectalign helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-04-25 22:00:15 +04:00
Cyrill Gorcunov
573d25fe92 macho: Implement sectalign handler
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-04-25 21:35:09 +04:00