-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/asm: No way to use the dup instruction in ARM64 assembly #65310
Comments
The obj docs for arm64 states:
|
It does support integer registers.
Thanks. |
You are correct, my mistake. However, there are a couple of other useful instructions that are missing:
|
It is true that we don't yet support all vector instructions. You could write |
Yes, I have already implemented it in my code using WORD, I am just |
Go version
go version go1.21.6 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Tried to find a way to use the the dup arm64 assembly instruction via go assembly. It doesnt seem to exist. The closest I can find is VDUP but that seems to take something known a C_ELEM not sure what that is, if its intended to map to dup it should take general purpose registers as operands. Here is a simple function to set all bytes in a register:
Try to build it with go gives the error
asm: illegal combination: 00004 VDUP R0, V0 REG NONE NONE VREG
Grepping for VDUP in the go assembler package gives:
Showing that the assembler thinks it doesnt take regular registers as operands.
ARM64 reference: https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/DUP--general---Duplicate-general-purpose-register-to-vector-?lang=en
What did you see happen?
Got the error:
What did you expect to see?
Expected it to generate instructions similar to
Maybe there is some other way to do this in Go assembly? If so would appreciate being enlightened.
The text was updated successfully, but these errors were encountered: