0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-10-10 00:25:06 -04:00
Commit Graph

5520 Commits

Author SHA1 Message Date
Elyes Haouas
fc720e7040 Remove useless parentheses in return statements
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-06 14:28:54 -07:00
H. Peter Anvin
f6a17a29c0 nasmlib.h: protect list_last() macro against misuse
The list_last() macro is a statement macro; wrap it in a
do { ... } while(0) block to prevent accidental misuse.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-06 14:27:30 -07:00
Elyes Haouas
f744ec431f Remove trailing semicolon in macros
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
[ hpa: only one of the defined issues was valid, removed the rest. ]
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2025-10-06 14:26:42 -07:00
Elyes Haouas
d9494d5240 output/outmacho.c: Add missing space at break quoted strings
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2025-10-06 14:22:59 -07:00
Elyes Haouas
346a1b3344 SubmittingPatches: Update git link
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2025-10-06 14:22:50 -07:00
H. Peter Anvin
81dd083291 outelf.c: remove stray semicolon
Harmless, but undesirable.

Fixes: https://github.com/netwide-assembler/nasm/pull/57
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-06 14:19:15 -07:00
H. Peter Anvin
0c3a964caf doc: remove stray "are"
"are generate" -> "generate"

Fixes: https://github.com/netwide-assembler/nasm/pull/87
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-06 14:14:09 -07:00
H. Peter Anvin
5b9099c058 asm/parser: print the actual token in an error, not its value
Printing an internal token value is not very user-friendly :) Print
the contents of the actual token in question.

Fixes: https://github.com/netwide-assembler/nasm/pull/90
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-06 14:07:33 -07:00
Yongjie Sheng
8d4710d014 ffmpegtest: fix variable rev change in a subshell does not impact parent
Error status would get lost.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-06 13:58:27 -07:00
KO Myung-Hun
57bf1b7b06 doc: document that the obj output format GROUP directive is cumulative
The GROUP directive can now be specified more than once for a group,
and the result is cumulative (the union of all specified groups.)

Signed-off-by: KO Myung-Hun <komh78@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-06 13:26:35 -07:00
KO Myung-Hun
c7e17f5dde outobj: make a group cumulative
On any other OMF assemblers such as MASM, TASM and ALP, a group is
cumulative.

Signed-off-by: KO Myung-Hun <komh78@gmail.com>
2025-10-06 13:24:09 -07:00
H. Peter Anvin
755593b128 NASM 3.01rc3 nasm-3.01rc3 2025-10-06 13:11:59 -07:00
H. Peter Anvin
0bc42dd1e0 changes.src: document TEST reg,mem fix
Add TEST reg,mem to release notes.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-06 13:11:09 -07:00
H. Peter Anvin
b3358fe63e insns.dat: reinstate TEST reg,mem alias
Officially the syntax for TEST is "rm,reg"; however TEST is
commutative in every aspect, and as such "reg,mem" is an equivalent
form that NASM has also supported in the past.

Reinstate it properly.

Fixes: https://bugzilla.nasm.us/show_bug.cgi?id=3392962
Reported-by: E. C. Masloch <pushbx@ulukai.org>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-06 13:07:09 -07:00
H. Peter Anvin
2bb275d651 NASM 3.01rc2 nasm-3.01rc2 2025-10-06 12:10:18 -07:00
H. Peter Anvin
11c512850e warnings.pl: tidy up the formatting of the warning output
Clean up the formatting of the generated warning files.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-06 12:07:23 -07:00
H. Peter Anvin
d5705c96bb changes.src: use \c{...} formatting for instructions
Instructions are literals, mark them with \c{...}.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-06 11:57:37 -07:00
Maciej Wieczor-Retman
cb03c02553 doc: Summarize PR changes
Merge PRs 127, 126, 125, 124 and 91. Document some of the most relevant
changes.

Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
2025-10-06 19:29:38 +02:00
InstLatx64
2488b6cfb3 AVX512_FP16 mnemonic fix
-- VGETMAXPH -> VMAXPH
-- VGETMINPH -> VMINPH
-- VFCMULCPCH -> VFCMULCPH
-- VFMULCPCH -> VFMULCPH
-- VPMADD{132,213,231}SH -> VFMADD{132,213,231}SH
-- VPMSUB{132,213,231}SH -> VFMSUB{132,213,231}SH
2025-10-06 19:29:33 +02:00
InstLatx64
70ed10d2e2 AVX512BF16 fix
AVX512BF16 fix:
-- VCVTNEPS2BF16 operand count
-- VDPBF16PS operand size
AVX512BF16 test files
Checked with XED version: [v2025.06.08]
2025-10-06 19:17:51 +02:00
Maciej Wieczor-Retman
0fb33913d6 x86: tools: Remove unused perl code variables
Merged version of a PR by mknos:
https://github.com/netwide-assembler/nasm/pull/91

Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
2025-10-06 19:17:51 +02:00
InstLatx64
62f5f6990f AMX-COMPLEX support
-- TCMMIMFP16PS, TCMMRLFP16PS instructions
-- AMX.asm fix: Similar to GATHER instructions, 3-operand AMX instructions cannot have the same operand more than once
Checked with XED version: [v2025.06.08]
2025-10-06 19:17:43 +02:00
Iouri Kharon
8f47ba7cc7 fix TCVTROWPS2PHL (typo?):
see Intel® Architecture Instruction Set Extensions and Future Features Programming Reference, March 2025 319433-057
else (without this correction) it conflict with VPERMI2PS
2025-10-06 18:56:51 +02:00
H. Peter Anvin
f7702bed4d NASM 3.01rc1 nasm-3.01rc1 2025-10-06 09:47:56 -07:00
H. Peter Anvin
13379eb48a changes.src: document %exitrep/%exitmacro %if fix
Add the fix for %exitrep/%exitmacro to the release notes.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-06 09:43:26 -07:00
H. Peter Anvin
d9958f428a test/exitrep: test for proper %if and %rep evaluation suppression
If a line is suppressed, the %if or %rep condition must never be
evaluated. Test for it, and add the exitrep test to travis.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-06 09:38:55 -07:00
H. Peter Anvin
2255ebb549 preproc: don't evaluate an %if condition if suppressed
When a line is suppressed there is no guarantee that it is
syntactically valid, so treat it exactly like a dead %if branch.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-06 09:20:30 -07:00
H. Peter Anvin
6b1636ab0e changes.src: drop 3.00.01; plan 3.01 as a bug fix release
Looks like there are enough critical changes to justify a release
without a bunch of new development. Let's just call the new
release 3.01 and avoid a bunch of excess dottage.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-06 08:33:16 -07:00
H. Peter Anvin
3bb875f3e5 Merge remote-tracking branch 'origin/nasm-3.00.xx' 2025-10-04 18:31:52 -07:00
H. Peter Anvin
312ea7d2d3 nasmdoc.css: make columns wider, smaller text in Appendix F
The column width really wasn't quite enough.

Make the text size in Appendix F which can be rather wide
smaller. There is also no real reason to put that in a background box.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-04 16:25:21 -07:00
H. Peter Anvin
1ec9d7dc22 changes.src: add obj2 output format to the release notes
Need to be added to the release notes...

Cc: KO Myung-Hun <komh78@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-04 15:59:13 -07:00
KO Myung-Hun
38fd561a0b outfmt.src: Add explanation for obj2 output format
Signed-off-by: KO Myung-Hun <komh78@gmail.com>
2025-10-04 15:57:30 -07:00
KO Myung-Hun
c7f426f5e5 outobj: add obj2 driver
Obj2 is an obj variation for OS/2.

Obj2 has the following differences from obj.

1. Default attributes for a segment are ALIGN=16 and USE32.
2. Add a segment to FLAT group implicitly if 32-bit segment.
3. Recognize Unix sections .text, .rodata, .data and .bss as TEXT32,
   CONST32, DATA32 and BSS32 respectively for compatibility with other
   Unix platforms.
4. Set default classes implicitly for known segments such as TEXT32,
   CONST32, DATA32, BSS32 and so on.

Signed-off-by: KO Myung-Hun <komh78@gmail.com>
2025-10-04 15:57:24 -07:00
Adam Sampson
a65be7d59b bytesex.h: fix typo in le32toh function name
This fixes the build on 32-bit/64-bit ARM.

Signed-off-by: Adam Sampson <ats@offog.org>
2025-10-04 15:54:49 -07:00
H. Peter Anvin
cd5dfb8c5f warnings: always regenerate outputs; tidy up unnecessary rules
With warnings disaggregated, there is no reason to play games with not
updating the output timestamp. Always write the files as usual.

Remove unnecessary Makefile rules.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
1# Please enter the commit message for your changes. Lines starting
2025-10-04 14:04:31 -07:00
H. Peter Anvin
69f1aa6c6a Makefile.in: re-introduce rules that can be made common
Rules that are now simple again can be made common.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-04 13:55:21 -07:00
H. Peter Anvin
a8bcdb641b Warnings: disaggregate from source and tidy up documentation
The idea of putting the warnings in the source code was a nice one,
really, but it ended up being a nightmare from the perspective of
build dependencies. Disaggregate them, and tweak the documentation for
easier reading.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-04 13:46:39 -07:00
H. Peter Anvin
bb3a51e5d6 warnings: remove stray whitespace before warning specification
The actual warning specification should begin immediately after *!.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-04 12:09:05 -07:00
Gabriel Barrantes
19e1f4bf81 Setup CI/CD pipeline
Setup job for travis tests

Signed-off-by: Gabriel Barrantes <gabriel.barrantes.dev@outlook.com>
2025-10-04 10:51:08 -07:00
H. Peter Anvin
3472f368cd This is the development branch intended to become NASM 3.01
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-03 12:59:05 -07:00
H. Peter Anvin
fe7c3c7171 This is the maintenance branch destined to become NASM 3.00.01 2025-10-03 12:58:02 -07:00
H. Peter Anvin
063e6d52e0 NASM 3.00 nasm-3.00 2025-10-03 12:37:44 -07:00
H. Peter Anvin
372e0910ba nasm.spec.in: make -doc package depend on the roboto fonts
It is not *really* required, but it is probably better to have the tag
than not.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-03 12:03:16 -07:00
H. Peter Anvin
568fbff1cd changes.src: add a few more release notes
A few more notes about changes.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-03 12:01:05 -07:00
H. Peter Anvin
e357f9489f NASM 3.00rc20 nasm-3.00rc20 2025-10-03 10:55:23 -07:00
Fabian Giesen
912849c48c Document Mach-O build_version directive
Signed-off-by: Fabian Giesen <fabian.giesen@epicgames.com>

Resolved Conflicts:
	doc/outfmt.src

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-03 10:48:19 -07:00
Fabian Giesen
83655f041e build_version pragma + macro for Mach-O
Matches the llvm-as .build_version syntax. Newer MacOS linker
complains when object files don't contain a LC_BUILD_VERSION.

Signed-off-by: Fabian Giesen <fabian.giesen@epicgames.com>
2025-10-03 10:47:27 -07:00
Fabian Giesen
0ee113ce68 Don't assume pragma directives are a single word
pragma->tail is described as "anything after the operation", but
existing parsing passed just the first whitespace-delimited
word. Change the parsing to just strip leading and trailing
white space off the rest of the line, but keep interior spaces
if there are any.

This is preparation for a build_version pragma for Mach-O matching
the llvm-as .build_version syntax.

Signed-off-by: Fabian Giesen <fabian.giesen@epicgames.com>
2025-10-03 10:47:25 -07:00
H. Peter Anvin
b4697f09e7 Conditionalize __builtin_prefetch() on it existing!!
You have to check that something that isn't standard C actually exists
before trying to use it...

Cc: Colin Ian King <colin.i.king@intel.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-03 10:47:23 -07:00
Colin Ian King
d6dc97dfc0 Add prefetching on strings before hashing
Turns out that the hotspots of nasm are mainly on string hashing
when accessing memory. A simple performance improvement is to
prefetch the first cacheline of a string to be hashed. Ran 50 tests
on an i9-12900 building intel-ipsec-mb that heavily uses nasm and
improved wall clock build times from 56.1 seconds to 53.2 seconds or
around 5% speed improvement.

Signed-off-by: Colin Ian King <colin.i.king@intel.com>
2025-10-03 10:31:27 -07:00