Skip to content
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

Chapter 13, NEON: Invalid operand for instruction MUL #15

Closed
below opened this issue Jul 30, 2020 · 2 comments
Closed

Chapter 13, NEON: Invalid operand for instruction MUL #15

below opened this issue Jul 30, 2020 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@below
Copy link
Owner

below commented Jul 30, 2020

MUL \ccol\().4H, V0.4H, \bcol\().4H[0]

While the distance code works, the matrixmultneon code does not, and building it leads to the following error:

<instantiation>:1:24: error: invalid operand for instruction
MUL V6.4H, V0.4H, V3.4H[0]
                        ^

The book says:

MUL V6.4H, V0.4H, V3.4H[0]
This is multiplying each lane in V0 by the scalar contained in a specific lane of V3. This shows how we typically access a value in a specific lane by appending [lane number] to the end of the register specifier—counting lanes from zero.

Adding -arch arm64e does not change anything.

Maybe @steipete has an idea?

@below below added the help wanted Extra attention is needed label Jul 30, 2020
@below below closed this as completed Aug 2, 2020
@steipete
Copy link

steipete commented Aug 3, 2020

You're digging into this deeper than I did, not sure what's up here. The NEON code we use mostly still is C, just using the low-level intrinsics like vcombine_s64.

@below
Copy link
Owner Author

below commented Aug 3, 2020

not sure what's up here.

Once you find the issue, it looks trivial: The Clang assembler has a slightly different syntax:

MUL.4H	V6, V0, V3[0]

Thanks for having a look!

MUL.4H \ccol\(), V0, \bcol\()[0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants