Commit Graph

2304 Commits

Author SHA1 Message Date
Cyrill Gorcunov
b8470a4708 insns.pl: Fix up merge conflict for sure
Now it should be fixed in real (one code snipped
escaped me during merge conflict resolving).

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-23 20:21:45 +03:00
Cyrill Gorcunov
dc75745994 Merge branch 'insns'
Conflicts:
	insns.pl

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-23 19:26:24 +03:00
Cyrill Gorcunov
e29fc5f111 insns: Fixup MOV[APS|UPS] for xmmrm cases
In fact it was written as

	MOVAPS	xmmreg,xmmreg	\360\2\x0F\x28\110	KATMAI,SSE
	MOVAPS	xmmreg,xmmreg	\360\2\x0F\x29\101	KATMAI,SSE

in first place

	MOVUPS	xmmreg,xmmreg	\360\2\x0F\x10\110	KATMAI,SSE
	MOVUPS	xmmreg,xmmreg	\360\2\x0F\x11\101	KATMAI,SSE

and for example x28 stands for xmmrm128,xmmreg and
x1 for xmmrm128,xmmreg.

TODO: Inspect and fix WILLAMETTE instructions.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-23 18:39:07 +03:00
Cyrill Gorcunov
bf305019a8 insns: Implement size bits on KATMAI
Perhaps not all of them are coevered yet, but mostly.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-23 18:39:01 +03:00
Cyrill Gorcunov
a54b5eabd3 insns.pl: Clear tabs/space mess
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-23 18:38:56 +03:00
Anthony Williams
6fc53d3752 make: Lift up openwcom.mak for build on FreeDOS
Signed-off-by: Anthony Williams <rugxulo@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-23 18:37:17 +03:00
Cyrill Gorcunov
fac6eee993 Merge branch 'nasm-2.09.xx'
Conflicts:
	version

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-21 19:56:21 +03:00
Cyrill Gorcunov
84637a6d28 NASM 2.09.04
Some important fixes:

 - Fix incorrect labels offset for VEX intructions
 - Eliminate bogus warning on implicit operand size override.
 - %if term could not handle 64 bit numbers.
 - The COFF backend was limiting relocations number to 16 bits even if
   in real there were a way more relocations.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-21 19:53:07 +03:00
Cyrill Gorcunov
9348b90f15 Changes for 2.09.04
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-21 19:51:49 +03:00
Victor van den Elzen
0d0f8ec418 BR3104852: only warn once for repeated prefixes 2010-11-21 19:41:01 +03:00
Victor van den Elzen
41f1f2badc BR3058845: mostly fix bogus warning with implicit operand size override
The implicit operand size override code didn't set the operand size
prefix, which confused the size calculation code for the range check.

The BITS 64 operand size calculation is still off, but "fixing" it by
making it 32-bit unless REX.W is set breaks PUSH and maybe others.
2010-11-21 19:40:49 +03:00
Cyrill Gorcunov
e635491941 misc: Enhance tag-release
It remains backward compatible

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-21 19:19:29 +03:00
Cyrill Gorcunov
5c89aea3d1 eval: rexp3 should operate with 64bit numbers
reloc_value returns 64bit numbers but we strip it down
to 'int' which causes problems if the former value is
big enough to overflow 'int'. Fix it.

[ BR3104312 ]

Reported-by: Christian Masloch
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-20 14:21:12 +03:00
Victor van den Elzen
0b2c41d0d3 Fix autoconf 2.68 warning.
The first argument of AC_COMPILE_IFELSE needs to be wrapped with
AC_LANG_SOURCE.
2010-11-20 14:20:38 +03:00
Cyrill Gorcunov
cb9a459560 coff: Handle massive relocations
The backport of

4db724fdd7
359b63f897
01102ee8e6
2672af7379

so coff output target to be able to handle
massive relocations.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-20 14:18:23 +03:00
H. Peter Anvin
bcf9f2a08b Merge branch 'nasm-2.09.xx' 2010-11-16 09:40:03 -08:00
H. Peter Anvin
3cb0e8c052 BR 3109604: Fix C4 vs C5 VEX form selection in calcsize()
calcsize() had the wrong criterion for when C5 prefixes are permitted
(REX.R is permitted, REX.X is forbidden.)  assemble() had the right
test already.  This caused symbol value errors.
2010-11-16 09:39:32 -08:00
Keith Kanios
3136d48212 preproc.c: fix handling of %? and %?? 2010-11-13 09:34:34 -06:00
Cyrill Gorcunov
5eaff1d2ca Merge branch 'cleanup' 2010-11-11 23:09:22 +03:00
Cyrill Gorcunov
eb7bf9811f Revert 29cb0bb1b3
Redundant call on nonsmart compilers doesn't
worth it in compare with two assignment operations.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-11 23:08:14 +03:00
Cyrill Gorcunov
49e8f698fc preproc: Add dump_token helper
While being debugging some nifty problem I found
that it might be useful to produce a full dump of
tokens, in particular text of tokens.

For this reason dump_token is here just to not loose
it. It doesn't affect normal build procedure since it
requires a special -DNASM_TRACE to be passed to the
compiler. Which of course we don't in a regular
compilations.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-11 22:44:35 +03:00
Cyrill Gorcunov
574fbf1972 preproc: Use nasm_zalloc more
To eliminate possible access into heap data

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-11 22:44:30 +03:00
Cyrill Gorcunov
a22e7a983c preproc: Use memset for stack allocated structure
To be on safe side

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-11 22:44:24 +03:00
Cyrill Gorcunov
6f38fe6cd5 preproc: inc_fopen -- set sl->next early
It's safer to init it early and be sure we not
miss anything after.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-11 22:44:18 +03:00
Cyrill Gorcunov
c515774a92 preproc: Use nasm_zalloc for new_ExpDef, new_ExpInv
Srink the code and make it a bit faster.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-11 22:44:13 +03:00
Cyrill Gorcunov
29cb0bb1b3 preproc: Use nasm_zalloc in new_Line
It's shorter

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-11 22:44:07 +03:00
Cyrill Gorcunov
325768ed4c autoconf: Add --with-ccache option
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-11 22:44:02 +03:00
Cyrill Gorcunov
a5aea577dd preproc.c: Get rid of tab/space mess
No change on binary level

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-11 22:43:56 +03:00
Cyrill Gorcunov
55cc4d0423 preproc: do_directive: Allocate 'Include' from zeroified-memory
If not all members of structure being allocated from
heap get initialized we better to use nasm_zalloc instead
of nasm_malloc.

For example inc gets allocated in do_directive being parially
initialized and we erroniously get mmac_depth set to some
crappy value leading to SIGSEV in result.

[ http://forum.nasm.us/index.php?topic=921.msg3257#msg3257 ]

nb: I've cleaned verror from tab/space mess while were at it

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-10 23:17:34 +03:00
H. Peter Anvin
5fa1b1f47a preproc.c: use nasm_strdup() rather than naked strdup() 2010-11-08 08:37:14 -08:00
Keith Kanios
9858cecf02 preproc.c: placate errors in OpenWatcom Compiler 2010-11-08 00:58:02 -06:00
Victor van den Elzen
d55a158cec BR3104852: only warn once for repeated prefixes 2010-11-07 23:47:13 +01:00
Victor van den Elzen
b3cee5a57a BR3058845: mostly fix bogus warning with implicit operand size override
The implicit operand size override code didn't set the operand size
prefix, which confused the size calculation code for the range check.

The BITS 64 operand size calculation is still off, but "fixing" it by
making it 32-bit unless REX.W is set breaks PUSH and maybe others.
2010-11-07 23:27:48 +01:00
Keith Kanios
0bae3e5ffa preproc.c: Fix OpenWatcom compiler error 2010-11-07 16:21:00 -06:00
Cyrill Gorcunov
329e9665eb preproc.c: Fix OpenWatcom compiler error
It doesn't like when we mess scope of variables
declaration.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-08 00:47:10 +03:00
Victor van den Elzen
db6b9cfa62 Fix autoconf 2.68 warning.
The first argument of AC_COMPILE_IFELSE needs to be wrapped with
AC_LANG_SOURCE.
2010-11-07 17:31:27 +01:00
Victor van den Elzen
bc8522e3a0 Fix Perl deprecation warnings.
Use of defined on aggregates (hashes and arrays) is deprecated.
You should instead use a simple test for size.
2010-11-07 17:20:23 +01:00
Keith Kanios
af43b97514 NASM 2.10rc2 2010-11-06 18:09:15 -05:00
Keith Kanios
02f3495e86 version: reverting back to 2.10rc1 2010-11-06 18:08:32 -05:00
Keith Kanios
b307a4f1eb preproc.c: merge from preproc-rewrite branch
pptok.dat: merge from preproc-rewrite branch
macros.pl: merge from preproc-rewrite branch
version: changed to 2.10rc2
2010-11-06 17:41:51 -05:00
Cyrill Gorcunov
2672af7379 coff: Cover 'else' with cond compilation
It was a nit in first place.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-07 01:09:36 +03:00
Cyrill Gorcunov
1a824c2182 test: Add br3104312.asm test
Not automated yet

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-06 23:09:47 +03:00
Cyrill Gorcunov
9f135edde9 eval: rexp3 should operate with 64bit numbers
reloc_value returns 64bit numbers but we strip it down
to 'int' which causes problems if the former value is
big enough to overflow 'int'. Fix it.

[ BR3104312 ]

Reported-by: Christian Masloch
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-06 23:08:11 +03:00
Cyrill Gorcunov
f0921a0c9c Merge branch 'owc' 2010-11-06 18:50:10 +03:00
Cyrill Gorcunov
d9fddf047e test: Add br3092924.asm
coff massive relocations test

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-06 18:44:48 +03:00
Cyrill Gorcunov
01102ee8e6 coff: Handle massive relocations
In case if relocations number exceed 16bit values
we have to hande such case by a special way, as described
in COFF specification.

 "IMAGE_SCN_LNK_NRELOC_OVFL indicates that the count of
relocations for the section exceeds the 16 bits that are
reserved for it in the section header. If the bit is set
and the NumberOfRelocations field in the section header
is 0xffff, the actual relocation count is stored in the
32-bit VirtualAddress field of the first relocation. It
is an error if IMAGE_SCN_LNK_NRELOC_OVFL is set and
there are fewer than 0xffff relocations in the section."

[ BR3092924 ]

Reported-by: Robert Yates
Investigated-by: nasm64developer
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-06 18:38:00 +03:00
Cyrill Gorcunov
359b63f897 coff: Issue fatal signal on relocations more then 0xffff
Actually it's temporary action. We have to support more
relocations then that but it requires some more code rework.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-06 02:45:45 +03:00
Cyrill Gorcunov
0d485cbdd6 make: Add tags and TAGS targets
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-05 14:18:51 +03:00
Cyrill Gorcunov
4db724fdd7 coff: Add IMAGE_SCN_MAX_RELOC constant
We will need it to analyze if section relocations
are overflowed.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-05 13:50:04 +03:00
Anthony Williams
a4adc238a4 make: Lift up openwcom.mak for build on FreeDOS
Signed-off-by: Anthony Williams <rugxulo@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-10-30 20:07:50 +04:00