Commit Graph

665 Commits

Author SHA1 Message Date
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)
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)
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
H. Peter Anvin
92d40ad8e4 nasmdoc.src: document when $*? and $*?? were introduced
It is important for programmers to be able to know when new constructs
were introduced, as they may have backwards compatibility needs and
thus need to know to avoid a construct that is too new.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-18 13:49:58 -07:00
H. Peter Anvin
6263a2a4c2 preproc: add %*? and %*??
The %? and %?? tokens are ambiguous when used inside a multi-line
macro. Add tokens %*? and %*?? that only expand during single-macro
expansion.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-18 13:47:59 -07:00
H. Peter Anvin
d76663a637 doc: one more copyright year issue. Add metadata macros to fix.
Yet another place in the documentation where the copyright year comes
in. Instead of having to deal with it manually over and over, add
support for inserting the metadata strings as macros in the output.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-17 19:48:36 -07:00
H. Peter Anvin
2d53846aab doc/nasmdoc.src: update copyright year
Updating the copyright year in the header isn't sufficient. To make it
harder to mess up, move the year metadata tag to the header just below
the copyright statement itself.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2020-07-17 19:33:52 -07:00
H. Peter Anvin
8ce4a58b1a rdsrc.pl: allow code paragraphs up to 80 characters long
All the backends support code paragraphs 80+ characters wide (85 for
HTML, 90 for PDF) without overrunning the margins. Avoid the noise.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2020-07-17 18:12:34 -07:00
H. Peter Anvin
20be7aaa28 doc/pspdf.pl: remove .setpdfwrite from gs command line
Ghostscript no longer recommends adding the .setpdfwrite operator when
producing PDF; in fact:

.setpdfwrite
    This operator is now deprecated, and its use is discouraged

Presumably it was never actually necessary, so just drop it.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-17 18:02:49 -07:00
H. Peter Anvin
ec20417002 changes.src: slighly better description of new instructions
Describe what the new instructions actually are.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-17 17:46:45 -07:00
H. Peter Anvin
d081f0db5d fp: support bfloat16 constants
Support generating bfloat16 constants. This is a bit awkward, as "DW"
already generates IEEE half precision constants; therefore there is no
longer a single floating-point format for each size. This requires
some replumbing.

Fortunately bfloat16 fits in 64 bits, so support generating them with
a macro that uses __?bfloat16?__() to convert to integers first before
passing them to DW.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2020-07-16 23:11:03 -07:00
H. Peter Anvin
b31a4c9906 Add support for new instructions from ISE June 2020
Add support for new instructions as defined in the Instruction Set
Extensions manual as of June 2020.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2020-07-16 21:52:15 -07:00
H. Peter Anvin (Intel)
d9ea17fb47 preproc: saner handling of cpp-style line directives
NASM now supports a proper superset of cpp line number markers, so
there is no need to hack around them using the
"prepreprocessor". Instead, just put a quick test in do_directive()
treating it just like %line, except convert a "-quoted string into a
`-quoted string.

(This can break if there is a ` or \" sequence in the string... fix
that at some point. This is still much better than what there is now.)

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-10 18:44:15 -07:00
H. Peter Anvin (Intel)
861f2cf269 changes.src: document LEA fix
Document fix of LEA without square brackets.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-10 02:49:14 -07:00
H. Peter Anvin (Intel)
be1be3f627 %use masm: much better documentation
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-10 02:46:23 -07:00
H. Peter Anvin (Intel)
22a3f567c0 changes.src: document %00 fix
Add %00 fix to release note.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-10 01:59:53 -07:00
H. Peter Anvin (Intel)
771e714c71 changes.src: update 2.15.03 release notes
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-09 19:41:12 -07:00
H. Peter Anvin (Intel)
6f52ecfa49 changes.src: update with current state of 2.15.03
Add release notes for 2.15.03 as it currently exists.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-07 09:33:42 -07:00
H. Peter Anvin (Intel)
cd87431424 BR 3392692: outcoff: allow user to reduce the default alignment
NASM would incorrectly only allow for the alignment to be increased,
even when overridden by the user. Allow the user to specify any
alignment value and have it override the partition type default.

The user can increade their own alignment value specification later,
of course, and the sectalign directive will present a floor for either
kind of specification.

Reported-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-06 21:46:43 -07:00
H. Peter Anvin (Intel)
61be48a383 doc: swap 'hyphen' and 'minus' in PostScript definition
It appears that at least with the Adobe Source fonts:

'hyphen' -> U+002D (ASCII)
'minus'  -> U+2212

This is ugly for cut & paste purposes.

Reported-by: C. Masloch <pushbx@ulukai.org>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-02 21:06:29 -07:00
H. Peter Anvin (Intel)
fee0db94a3 changes.src: fixed Mkfiles/msvc.mak
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-07-01 21:31:32 -07:00
H. Peter Anvin (Intel)
b68a375afc doc: index cleanups
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 15:05:20 -07:00
H. Peter Anvin (Intel)
39714f7de7 doc: document(!) documentation build requirements
The tools we need to build the documentation.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 13:47:17 -07:00
H. Peter Anvin (Intel)
4ddeb70428 doc: slight cleanup of MASM compatibility package information
Note that the extended DB syntax is also available, regardless of if
%use masm is used or not.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 13:37:29 -07:00
H. Peter Anvin (Intel)
a08c0f9adf changes.src: document %{:} macro parameter range fix
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 12:50:49 -07:00
H. Peter Anvin (Intel)
5c85b7f87b changes.src: update changes for 2.15.02 (so far)
Begin the release note list for 2.15.02.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 10:47:34 -07:00
H. Peter Anvin (Intel)
f6a5c1ce20 doc: incbin: no need to mention an ancient Amiga assembler
There is no reason to mention an ancient Amiga assembler as the source
for INCBIN, especially since it is supported by quite a few other
assemblers.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-30 10:46:43 -07:00
H. Peter Anvin (Intel)
296685b5e3 nasmdoc.css: use a relative size for code/pre
Use a percentage size modifier for code/pre, which hopefully should
allow it to respect enclosing size modifications (for headings.)

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 23:18:28 -07:00
H. Peter Anvin (Intel)
a4c0d009a0 nasmdoc.css: use a smaller font size for code text
Use a smaller font size for code text, just as for ps/pdf.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 23:16:13 -07:00
H. Peter Anvin (Intel)
d1a9f8a2f7 doc: actually *use* the smaller code font size...
Helps to actually use what is intended.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 23:10:50 -07:00
H. Peter Anvin (Intel)
18c0112c5b doc: for ps/pdf, use a smaller font for code
The text looks better using a smaller font for both inline code and
code paragraphs.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 23:03:09 -07:00
H. Peter Anvin (Intel)
444905e48b doc: some more cleanups and detailed specifications
Some more mostly editorial changes.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 16:50:56 -07:00
H. Peter Anvin (Intel)
fa7732e092 doc: editorial cleanups
Clean up the language of a few sections, add a few examples, and
better document %pragma limit.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 16:40:52 -07:00
H. Peter Anvin (Intel)
aa542870ae changes.src: update for 2.15.01
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-27 16:14:50 -07:00
H. Peter Anvin (Intel)
82fc1bea76 doc: document operator and Dx changes
Document new operators, removal of special casing for %if, and the
MASM-like enhancements to the Dx directives.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-06-25 15:46:09 -07:00
H. Peter Anvin (Intel)
d499755f54 doc: various documentation updates 2020-06-14 22:43:47 -07:00
H. Peter Anvin (Intel)
941c75a2b2 Makefile portability improvement, build nasmdoc.pdf.xz
Significantly improve the portability/reliability of a general
make command. Build a .pdf.xz version of the documentation,
using an uncompressed pdf as basis.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-05-26 14:13:31 -07:00
Andrey Matyukov
4df1386eb0 doc: Update for upcoming 2.15 release
Update release notes and documentation for 2.15

Signed-off-by: Andrey Matyukov <andrey.matyukov@intel.com>
Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
2020-05-06 20:37:09 +00:00
H. Peter Anvin
18e87ce7bd doc: we really need a Fontmap file
It turns out that we need a Fontmap file after all, *and* -I. to make
gs find it. Inconsistent results came from stray Fontmap files from
previous debug attempts.

Now generate both fontpath and Fontmap, and hopefully at least one of
them should work. We might, in fact, need both, one for gs to know
where the files are and one for gs to know it is allowed to read them.

The core problem seems to be that gs will find OTF fonts by its normal
discovery mechanisms, but for some reason don't seem to use them
unless it can find them in a Fontmap, Font directory, of CIDFont
directory.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2019-10-04 13:09:30 -07:00
H. Peter Anvin
f8a15a8ea3 Correct __ALIGN_ -> __?ALIGN_
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2019-08-27 17:21:28 -07:00
H. Peter Anvin
d235408c65 preproc: standard macros now C-safe, %aliases off, fix %? recursion
Enough users expect the namespace starting with underscore to be safe
for symbols. Change our private namespace from __foo__ to
__?foo?__. Use %defalias to provide backwards compatiblity (by using
%defalias instead of %define, we handle the case properly where the
user changes the value.)

Add a preprocessor directive:

%aliases off

... to disable all smacro aliases and thereby making the namespace
clean.

Finally, fix infinite recursion when seeing %? or %?? due to
paste_tokens(). If we don't paste anything, the expansion is done.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2019-08-27 16:42:41 -07:00
H. Peter Anvin (Intel)
3d10569bbe doc: actually build and propagate fontpath file
The machinery was built in, but the option wasn't invoked from the
Makefile.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2019-08-06 23:07:44 -07:00
H. Peter Anvin
186f9a0514 doc: fix yet another set of Ghostscript font problems
Seems like Ghostscript has managed to break fontconfig support again,
at least in Fedora 30. Help Ghostscript along by giving it an explicit
font path.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2019-06-06 20:51:10 -07:00
H. Peter Anvin
e678020878 outelf: get rid of long-since-obsolete gnu extensions warning
R_386_[PC]{8,16} have been part of the official ELF32 spec for a very
long time now.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2019-06-06 18:33:42 -07:00
H. Peter Anvin (Intel)
9bb55bd127 Merge branch 'evalmacro'
Resolved Conflicts:
	asm/preproc.c
	output/elf.h
	output/outelf.c
	output/outelf.h
	version

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2019-04-24 11:14:43 -07:00
H. Peter Anvin
a8604c83fa ELF: the .note section should be 4-byte aligned
The ELF .note section contains of 4-byte words and should be aligned
accordingly.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2019-02-26 02:36:15 -08:00
H. Peter Anvin
dc5939b496 Handle more ELF section types
note, preinit_array, init_array, and fini_array are ELF section types
that can matter to the assembly programmer.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2019-02-26 01:44:55 -08:00
H. Peter Anvin
b2004511dd ELF: handle more than 32,633 sections
Dead code elimination in ELF uses separate ELF sections for every
functions or data items that may be garbage collected. This can end up
being more than 32,633 sections which, when the ELF internal and
relocation sections are added in, can exceed the legacy ELF maximum of
65,279 sections.

Newer versions of the ELF specification has added support for much
larger number of sections by putting a place holder value (usually
SHN_XINDEX == 0xffff, but 0 in some cases) into fields where the
section index is a 16-bit value, and storing the full value in a
diffent place: the program header uses entries in section header 0,
the symbol table uses an auxiliary segment with the additional
indicies; the section header did not need it as the sh_link field is
already 32 (or 64) bits long.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2019-02-26 00:02:35 -08:00
H. Peter Anvin (Intel)
1df7263ae9 warnings: add [warning push] and [warning pop]
Add [warning push] and [warning pop] directives.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2019-01-11 13:13:03 -08:00