-
Notifications
You must be signed in to change notification settings - Fork 104
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
[CIR][CIRGen][Builtin][Neon] Lower neon_vshl_n_v and neon_vshlq_n_v #965
Conversation
Read for review, but keep it draft as I anticipate manual merging will happen once other pending PR's accepted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Some minor changes needed
It was my mistake that I forgot to implement the shift operators for GNU vector types as part of issue #284. I even have a test program for that in my test area. But I must have assumed that Changing If this change fixes vector shift operations in user code (it looks like it might, but I'm not certain), then please update the PR description to say that, and please add shift operations to If this change doesn't fix vector shift operations, then leave this change alone and open an issue about this. Someone, probably me, will finish fixing that in a later PR. |
The change might support user code, I'll try to find user test code to see if this is the case, if this change alone is enough to support user code, I'll just update |
The test case that I wrote (and then forgot about and didn't use) for vector shift is:
You can start with that for your tests of user code. |
user code support is confirmed. Added user code test cases covering left, right(logic and arith) shifts |
vus2 zamt = { 3, 4 }; | ||
// CHECK: %{{[0-9]+}} = cir.const #cir.const_vector<[#cir.int<3> : !u16i, #cir.int<4> : !u16i]> : !cir.vector<!u16i x 2> | ||
vus2 zzz = z >> zamt; | ||
// CHECK: %{{[0-9]+}} = cir.shift( right, {{%.*}} : !cir.vector<!u16i x 2>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like we have a buggy " right" with an extra space, let me create an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, I noticed that yesterday but not sure that extra space was on purpose as we had existing test case with that
…lvm#965) As title, but important step in this PR is to allow CIR ShiftOp to take vector of int type as input type. As result, I added a verifier to ShiftOp with 2 constraints 1. Input type either all vector or int type. This is consistent with LLVM::ShlOp, vector shift amount is expected. 2. In the spirit of C99 6.5.7.3, shift amount type must be the same as result type, the if vector type is used. (This is enforced in LLVM lowering for scalar int type).
…965) As title, but important step in this PR is to allow CIR ShiftOp to take vector of int type as input type. As result, I added a verifier to ShiftOp with 2 constraints 1. Input type either all vector or int type. This is consistent with LLVM::ShlOp, vector shift amount is expected. 2. In the spirit of C99 6.5.7.3, shift amount type must be the same as result type, the if vector type is used. (This is enforced in LLVM lowering for scalar int type).
As title, but important step in this PR is to allow CIR ShiftOp to take vector of int type as input type. As result, I added a verifier to ShiftOp with 2 constraints