Commit Graph

2474 Commits

Author SHA1 Message Date
Cyrill Gorcunov
0aa9bdf7b2 Fix saa_writeaddr for big-endian case
saa_writeaddr on big-endian archs didn't write converted
argument, fix it.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-17 13:59:13 +04:00
Cyrill Gorcunov
f4941892b3 Drop unused 'arg' variable
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-17 13:55:25 +04:00
Cyrill Gorcunov
5b49af4ff2 Merge branch 'nasm-2.09.xx'
Conflicts:
	version

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-16 01:44:57 +04:00
Cyrill Gorcunov
fbde522e05 NASM-2.09.10
- Fix nasty problem with uninstaller in case of registry
  keys corruption, which might lead to arbitrary files
  removal.

  Just to be sure the proper files and directories are to
  be removed a few additional questions are brought into
  deinstallation procedure.

  The former issue reported here

	http://forum.nasm.us/index.php?topic=1013.0

  Note: no functional changes are done inside nasm code,
  critical fixes will be ported to 2.09.xx branch, but
  mostly the (more or less) active development and various
  bug fixes are concentrated around 2.10 series.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-16 01:41:28 +04:00
Cyrill Gorcunov
ed48ab815e doc: Describe changes for nasm-2.09.10
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-16 01:33:00 +04:00
Cyrill Gorcunov
25c53e4eb1 nsis: Remove desktop bat link as well
In case of installation procedure being used in
a per-user fasion the display link to a bat file
remain untouched at uninstallation time. Fix it.

I hope this time all things go smooth.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-15 23:14:53 +04:00
Cyrill Gorcunov
3704d2d994 nsis: Inform a user about files being deleted
Since a user might have some weird access rules on NTFS
such as allow to write files but not to delete them it
might happen that uninstallation procedure fails at
deleting files but deleting registry keys still success,
and in result a user might try to uninstall nasm for second
time with registry keys corrupted.

So prompt a user with files being deleted so he can double
check what is going on.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-15 23:14:43 +04:00
Cyrill Gorcunov
2f39e1a066 nsis: Make sure the registry keys exist
It was reported on nasm forum (http://forum.nasm.us/index.php?topic=1013.0)
that if uninstallation procedure get stopped (for any reason) in a middle
leading to read empty registry values an attempt to remove arbitrary
files might happen. So make sure there are some sane values in registry.

N.B: People, if you find some bug in nasm, don't write to forum, file
bug directly in bugzilla, if it's not a bug we simply close it, otherwise
we might miss serious problems like this one!

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-15 23:14:32 +04:00
Cyrill Gorcunov
98de334949 nsis: Remove desktop bat link as well
In case of installation procedure being used in
a per-user fasion the display link to a bat file
remain untouched at uninstallation time. Fix it.

I hope this time all things go smooth.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-15 23:13:26 +04:00
Cyrill Gorcunov
ee42e62c7c nsis: Inform a user about files being deleted
Since a user might have some weird access rules on NTFS
such as allow to write files but not to delete them it
might happen that uninstallation procedure fails at
deleting files but deleting registry keys still success,
and in result a user might try to uninstall nasm for second
time with registry keys corrupted.

So prompt a user with files being deleted so he can double
check what is going on.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-15 22:38:47 +04:00
H. Peter Anvin
9f0dcfc724 A few more AVX2 spec instructions
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2011-07-08 16:08:34 -07:00
H. Peter Anvin
cffe61e776 Use a normal quad-case for valueless /is4
When we don't have an immediate for the i-field in /is4, then use a
normal quad-bytecode encoding for it to save some small amount of
space and re-use existing machinery.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2011-07-07 17:21:24 -07:00
H. Peter Anvin
fc561203fd Remove support for DREX encoding
The DREX encoding never hit production silicon, and has been replaced
by VEX/XOP encoding, so remove support for it.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2011-07-07 16:58:22 -07:00
H. Peter Anvin
573aea590e insns.dat: Clean up and fix the BMI instruction patterns
Clean up the formatting of the BMI instruction patterns, and fix:

a) X64,FUTURE is wrong - it needs to be LONG,FUTURE
b) Fix the BLSI, BLSMSK, BLSR instruction patterns
c) Use a bracket pattern for TZCNT

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2011-07-07 15:29:14 -07:00
Jasper Neuman
5cc798c612 insns: Fix up RORX template
Missed 64 bit case.

Signed-off-by: Jasper Neuman <jasper.neumann@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-07 11:02:11 +04:00
Jasper Neuman
c1610e6abe insns.dat: Add some BMI1 and BMI2 instructions
Signed-off-by: Jasper Neuman <jasper.neumann@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-07 01:08:51 +04:00
Cyrill Gorcunov
117eaa35ef nsis: Make sure the registry keys exist
It was reported on nasm forum (http://forum.nasm.us/index.php?topic=1013.0)
that if uninstallation procedure get stopped (for any reason) in a middle
leading to read empty registry values an attempt to remove arbitrary
files might happen. So make sure there are some sane values in registry.

N.B: People, if you find some bug in nasm, don't write to forum, file
bug directly in bugzilla, if it's not a bug we simply close it, otherwise
we might miss serious problems like this one!

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-07 00:56:35 +04:00
Jasper Neuman
619bfc87d1 insns.h: Add BMI1 and BMI2 flags for further usage
Signed-off-by: Jasper Neuman <jasper.neumann@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-07 00:03:49 +04:00
Cyrill Gorcunov
4e40962918 preproc: Drop useless assignments
new_ExpDef does zalloc'ate memory so no need
to assign zeros again.

Same time it should fix MSC complains on NULL assignment
on boolean variable.

Reported-by: Jasper Neuman <jasper.neumann@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-06 23:12:55 +04:00
Cyrill Gorcunov
454b0f23b8 Merge branch 'nasm-2.09.xx'
Conflicts:
	version

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-04 00:51:53 +04:00
Cyrill Gorcunov
ffee19a3b2 NASM 2.09.09
Just a few fixes only but serious enough to yield
new stable series

 - Unitialized memory parsing in bin format section attibutes.
 - MachO NULL dereference

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-04 00:49:12 +04:00
Cyrill Gorcunov
68868b09e3 doc: Describe changes for stable version
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-04 00:47:08 +04:00
Keith Kanios
52afa0c5d4 BR3282788: Fix 64-bit Mach-O bug that crashes NASM due to NULL symbols 2011-07-04 00:38:33 +04:00
Cyrill Gorcunov
56dd9fd83d output/outbin.c: initialize section attribs upon creation
Basically it's backport of commits

11db774a15
3bc3ff2fb6
c13deef255
e3f4780665

They were missed to back-merge in a first place.

Reported-by: Keith Kanios <keith@kanios.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-04 00:33:24 +04:00
Cyrill Gorcunov
86b2ad05f8 preproc: Move Preproc type to preproc_ops structure
There is no need to hide this structure into a type.
The former preproc_ops is a way more descriptive.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-02 00:15:24 +04:00
Cyrill Gorcunov
0ad6a7b293 preproc: Refactor smacro paramters expansion
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-30 01:36:45 +04:00
Cyrill Gorcunov
194ba892ca preproc: Add smacro paramter helpers
I belive this should simply code a bit.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-30 01:16:35 +04:00
Cyrill Gorcunov
5b6c96b9fd preproc: Alignment in loop
Just for easier reading

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-30 00:22:53 +04:00
Cyrill Gorcunov
8a61142504 insns: Mark AVX2 instructions as FUTURE
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-29 23:35:53 +04:00
Cyrill Gorcunov
290eac7569 preproc: Finally drop context-through search
2.09 series was the last one we support context-thru search
(and we were issuing a warning about that) so drop all-context
from get_ctx() routine.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-28 02:01:47 +04:00
Cyrill Gorcunov
b6c6ca96e7 preproc: nasm_free is safe against NULL argument
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-28 01:33:02 +04:00
Cyrill Gorcunov
c6a742cb6b Revert "BR3288901: Relax concat rules in preprocessor code"
This reverts commit cb00cd1ba7.

As Victor pointed out some tests do not pass with this commit
so revert it until things get fixed.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-27 01:23:09 +04:00
Cyrill Gorcunov
fdd0ac5f43 preproc: Add trace point into paste_tokens
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-27 01:22:27 +04:00
Cyrill Gorcunov
2e04600e3d preproc: Some more tracing calls
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-26 23:33:56 +04:00
Cyrill Gorcunov
9d1141aea9 preproc: Missed double charp in nasm_trace
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-26 23:07:35 +04:00
Cyrill Gorcunov
9880ea4572 insns: A few more AVX2 instructions
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-26 10:45:10 +04:00
Cyrill Gorcunov
92569ece7b insns: Add VPERMD instruction
We somehow missed it.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-26 02:07:22 +04:00
Cyrill Gorcunov
767a4e8313 test: Add movd.asm
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-26 01:53:38 +04:00
Cyrill Gorcunov
ed33be2519 insns: Allow MOVD xmmreg,rm32 to be used in 32bit mode
Reported-by: Keith Kanios <keith@kanios.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-26 01:49:29 +04:00
Cyrill Gorcunov
fc0c1281db preproc: Add tokenization tracing
It's a bit more than that, also TRACE=1 make
flag added to run this facility on and off
at compiling time.

Debug feature only, doesn't affect regular users.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-25 19:51:44 +04:00
Cyrill Gorcunov
82667ff5d3 preproc.c: Get rid of a few tabs and update year
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-25 19:34:19 +04:00
Cyrill Gorcunov
3eba69a63a preproc.c: Use list_reverse helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-25 18:16:54 +04:00
Cyrill Gorcunov
396b5dfe95 nasmlib: Add list_reverse helper
There is no way to make it as a helper function
for a while, we need to unify list processing
in general (ie to use abstract list type).

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-25 18:15:41 +04:00
Cyrill Gorcunov
87225da76d nasmlib: Add list_last helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-25 18:15:21 +04:00
Cyrill Gorcunov
a39912dcd9 Move numvalue herleper into nasmlib.h
No need to duplicate implementation.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-25 12:10:40 +04:00
Cyrill Gorcunov
fb27fc21e7 preproc: Drop unused 'mtok' variable
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-25 12:08:30 +04:00
Cyrill Gorcunov
9fde335005 nassm.c: Use evaluate for section alignment
This allow us to write the whole expressions
on section alignments, such as

	align 0xa+6

or whatever math. Should be a way more convenient
than hardnumbers scheme we had.

Reported-by: Frank Kotler <fbkotler@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-25 12:05:51 +04:00
Cyrill Gorcunov
cb00cd1ba7 BR3288901: Relax concat rules in preprocessor code
We simply allow the following terminals to be concat'ed
if they are written without space or any other separator
inbetween.

        a := id | preproc-id | number | float | other
        b := id | preproc-id | number | float | other

        if match(a,b):
                s := concat(a,b)
                re-tokenize(s)

Basically it means it's up to code author to write
preproc code a way the sane production appears.

Some notes.

1) We don't concat strings.

2) The 'weirdpaste' test fails now because with relaxed
   rules it works as needed and was borken before.

   The lacmus snippet is

        %define N 1e%++%+ 5
        dd N, 1e+5

Previously the output was

        dd 1e+%+ 5, 1e+5

which is wrong since we have explicit concat here
with %+ operator. The new code production is correct
and looks like

        dd 1e+5, 1e+5

as expected.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-25 12:03:36 +04:00
Cyrill Gorcunov
80594e79ed insns: Mark VGATHERDPD as AVX2 instructions
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-25 12:01:52 +04:00
Cyrill Gorcunov
f753cd2fd3 Add IF_AVX2 flag
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-25 12:01:30 +04:00