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

Changing the way to treat vector masks #214

Open
kaz7 opened this issue Sep 17, 2022 · 0 comments
Open

Changing the way to treat vector masks #214

kaz7 opened this issue Sep 17, 2022 · 0 comments

Comments

@kaz7
Copy link
Collaborator

kaz7 commented Sep 17, 2022

The current implementation ignores vector masks in VP intrinsics if they won't cause exceptions.

For example, VP_MUL intrinsic instruction with vector mask is converted to VMULSWSX without mask like below. Current implementation uses vector masks for only VP_SDIV/UDIV/FDIV instructions.

define fastcc <256 x i32> @test_vp_int(<256 x i32> %i0, <256 x i32> %i1, <256 x i1> %m, i32 %n) {
; CHECK-LABEL: test_vp_int:
; CHECK:       # %bb.0:
; CHECK-NEXT:    and %s0, %s0, (32)0
; CHECK-NEXT:    lvl %s0
; CHECK-NEXT:    vmuls.w.sx %v0, %v0, %v1
; CHECK-NEXT:    b.l.t (, %s10)
  %r0 = call <256 x i32> @llvm.vp.mul.v256i32(<256 x i32> %i0, <256 x i32> %i1, <256 x i1> %m, i32 %n)
  ret <256 x i32> %r0
}

I'm going to change this to not ignore vector masks even if the instruction won't cause errors. @simoll , please let me know if you have any reason to ignore these vector masks. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant