On Tue, 25 Feb 2025 09:36:49 GMT, Andrew Haley <[email protected]> wrote:
>> @ferakocz This also really needs addressing before committing the patch.
>> Perhaps @theRealAph can advise on how to circumvent the problems you found
>> when trying to update the python script?
>
>> You might have to use an assembler from the latest binutils build (if the
>> system default isn't the latest) and add the path to the assembler in the
>> "AS" variable. Also you can run it something like - `python
>> aarch64-asmtest.py | expand > asmtest.out.h`. Please let me know if you
>> still face problems.
>
> People have been running this script for a decade now.
>
> Let's look at just one of these:
>
>
> aarch64ops.s:357:20: error: expected 'sxtx' 'uxtx' or 'lsl' with optional
> integer in range [0, 4]
> sub x1, x10, x23, sxth #2
>
>
> From the AArch64 manual:
>
> SUB (extended register)
> SUB <Xd|SP>, <Xn|SP>, <R><m>{, <extend> {#<amount>}}
>
> It thinks this is a SUB (shifted register), bit it's really a SUB (extended
> register).
>
>
> fedora:aarch64 $ cat t.s
> sub x1, x10, x23, sxth #2
> fedora:aarch64 $ as t.s
> fedora:aarch64 $ objdump -D a.out
> Disassembly of section .text:
>
> 0000000000000000 <.text>:
> 0: cb37a941 sub x1, x10, w23, sxth #2
>
>
> So perhaps binutils expects w23 here, not x23. But the manual (ARM DDI
> 0487K.a) says x23 should be just fine, and, what's more, gives the x form
> preferred status.
@theRealAlph, maybe we are not reading the same manual (ARM DDI 0487K.a). In my
copy:
SUB (extended register) is defined as
SUB <Xd|SP>, <Xn|SP>, <R><m>{, <extend> {#<amount>}}
and <R> should be W when <extend> is SXTH
and the as I have enforces this:
ferakocz@ferakocz-mac aarch64 % cat t.s
sub x1, x10, w23, sxth #2
ferakocz@ferakocz-mac aarch64 % cat > t1.s
sub x1, x10, x23, sxth #2
ferakocz@ferakocz-mac aarch64 % cat t.s
sub x1, x10, w23, sxth #2
ferakocz@ferakocz-mac aarch64 % cat t1.s
sub x1, x10, x23, sxth #2
ferakocz@ferakocz-mac aarch64 % as --version
Apple clang version 16.0.0 (clang-1600.0.26.6)
Target: arm64-apple-darwin24.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
ferakocz@ferakocz-mac aarch64 % as t.s
ferakocz@ferakocz-mac aarch64 % objdump -D t.o
t.o: file format mach-o arm64
Disassembly of section __TEXT,__text:
0000000000000000 <ltmp0>:
0: cb37a941 sub x1, x10, w23, sxth #2
ferakocz@ferakocz-mac aarch64 % as t1.s
t1.s:1:19: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in
range [0, 4]
sub x1, x10, x23, sxth #2
^
I have not found the place in the manual where it allows/encourages the use of
x<n> instead of w<n>, but I admit I haven't read through all of the 14568 pages.
So I'm stuck for now. What 'as' are you using?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23300#discussion_r1969561791