-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[PowerPC] Add intrinsic definition for load and store with Right Length Left-justified #148873
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
93bec05
add intrinsic def for ld/st with Right Length Left-justified
lei137 812678c
add ld tests
lei137 ba8bf33
add stxvprl[l]
lei137 5995c17
add stxvprl[l]
lei137 4fd88bb
add support and test for v2i64
lei137 5d1abaf
remove comments
lei137 412e2d5
Update llvm/lib/Target/PowerPC/PPCInstrFuture.td to remove types from…
lei137 d57fc12
update to use anonymous pattern matching
lei137 894b8a0
update test checks with update_llc_test_checks.py
lei137 98bc048
udpate to only add support for v4i32 types
lei137 e6a85dc
address nit on comments
lei137 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -192,3 +192,21 @@ let Predicates = [HasVSX, IsISAFuture] in { | |
| : VXForm_VRTAB5<323, (outs vrrc:$VRT), (ins vrrc:$VRA, vrrc:$VRB), | ||
| "vucmprlh $VRT, $VRA, $VRB", []>; | ||
| } | ||
|
|
||
| //---------------------------- Anonymous Patterns ----------------------------// | ||
|
|
||
| // Load/Store VSX Vector with Right Length (Left-justified). | ||
| def : Pat<(v4i32 (int_ppc_vsx_lxvrl addr:$RA, i64:$RB)), (LXVRL $RA, $RB)>; | ||
|
||
| def : Pat<(v4i32 (int_ppc_vsx_lxvrll addr:$RA, i64:$RB)), (LXVRLL $RA, $RB)>; | ||
| def : Pat<(int_ppc_vsx_stxvrl v4i32:$XT, addr:$RA, i64:$RB), (STXVRL $XT, $RA, | ||
| $RB)>; | ||
| def : Pat<(int_ppc_vsx_stxvrll v4i32:$XT, addr:$RA, i64:$RB), (STXVRLL $XT, $RA, | ||
| $RB)>; | ||
|
|
||
| // Load/Store VSX Vector pair with Right Length (Left-justified). | ||
| def : Pat<(v256i1 (int_ppc_vsx_lxvprl addr:$RA, i64:$RB)), (LXVPRL $RA, $RB)>; | ||
| def : Pat<(v256i1 (int_ppc_vsx_lxvprll addr:$RA, i64:$RB)), (LXVPRLL $RA, $RB)>; | ||
| def : Pat<(int_ppc_vsx_stxvprl v256i1:$XTp, addr:$RA, i64:$RB), (STXVPRL $XTp, | ||
| $RA, $RB)>; | ||
| def : Pat<(int_ppc_vsx_stxvprll v256i1:$XTp, addr:$RA, i64:$RB), (STXVPRLL $XTp, | ||
| $RA, $RB)>; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,157 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
| ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \ | ||
lei137 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ; RUN: -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr -mcpu=future < %s | \ | ||
| ; RUN: FileCheck %s | ||
| ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-ibm-aix-xcoff \ | ||
| ; RUN: -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr -mcpu=future < %s | \ | ||
| ; RUN: FileCheck %s --check-prefix=AIX | ||
|
|
||
| ; Test for load/store to/from v4i32. | ||
|
|
||
| define <4 x i32> @testLXVRL(ptr %a, i64 %b) { | ||
| ; CHECK-LABEL: testLXVRL: | ||
| ; CHECK: # %bb.0: # %entry | ||
| ; CHECK-NEXT: lxvrl v2, r3, r4 | ||
| ; CHECK-NEXT: blr | ||
| ; | ||
| ; AIX-LABEL: testLXVRL: | ||
| ; AIX: # %bb.0: # %entry | ||
| ; AIX-NEXT: lxvrl v2, r3, r4 | ||
| ; AIX-NEXT: blr | ||
| entry: | ||
| %0 = tail call <4 x i32> @llvm.ppc.vsx.lxvrl(ptr %a, i64 %b) | ||
| ret <4 x i32> %0 | ||
| } | ||
| declare <4 x i32> @llvm.ppc.vsx.lxvrl(ptr, i64) | ||
|
|
||
| define <4 x i32> @testLXVRLL(ptr %a, i64 %b) { | ||
| ; CHECK-LABEL: testLXVRLL: | ||
| ; CHECK: # %bb.0: # %entry | ||
| ; CHECK-NEXT: lxvrll v2, r3, r4 | ||
| ; CHECK-NEXT: blr | ||
| ; | ||
| ; AIX-LABEL: testLXVRLL: | ||
| ; AIX: # %bb.0: # %entry | ||
| ; AIX-NEXT: lxvrll v2, r3, r4 | ||
| ; AIX-NEXT: blr | ||
| entry: | ||
| %0 = tail call <4 x i32> @llvm.ppc.vsx.lxvrll(ptr %a, i64 %b) | ||
| ret <4 x i32> %0 | ||
| } | ||
| declare <4 x i32> @llvm.ppc.vsx.lxvrll(ptr, i64) | ||
|
|
||
| define void @testSTXVRL(<4 x i32> %a, ptr %b, i64 %c) { | ||
| ; CHECK-LABEL: testSTXVRL: | ||
| ; CHECK: # %bb.0: # %entry | ||
| ; CHECK-NEXT: stxvrl v2, r5, r6 | ||
| ; CHECK-NEXT: blr | ||
| ; | ||
| ; AIX-LABEL: testSTXVRL: | ||
| ; AIX: # %bb.0: # %entry | ||
| ; AIX-NEXT: stxvrl v2, r3, r4 | ||
| ; AIX-NEXT: blr | ||
| entry: | ||
| tail call void @llvm.ppc.vsx.stxvrl(<4 x i32> %a, ptr %b, i64 %c) | ||
| ret void | ||
| } | ||
| declare void @llvm.ppc.vsx.stxvrl(<4 x i32>, ptr, i64) | ||
|
|
||
| define void @testSTXVRLL(<4 x i32> %a, ptr %b, i64 %c) { | ||
| ; CHECK-LABEL: testSTXVRLL: | ||
| ; CHECK: # %bb.0: # %entry | ||
| ; CHECK-NEXT: stxvrll v2, r5, r6 | ||
| ; CHECK-NEXT: blr | ||
| ; | ||
| ; AIX-LABEL: testSTXVRLL: | ||
| ; AIX: # %bb.0: # %entry | ||
| ; AIX-NEXT: stxvrll v2, r3, r4 | ||
| ; AIX-NEXT: blr | ||
| entry: | ||
| tail call void @llvm.ppc.vsx.stxvrll(<4 x i32> %a, ptr %b, i64 %c) | ||
| ret void | ||
| } | ||
| declare void @llvm.ppc.vsx.stxvrll(<4 x i32>, ptr, i64) | ||
|
|
||
| ; Test for load/store vectore pair. | ||
|
|
||
| define <256 x i1> @testLXVPRL(ptr %vpp, i64 %b) { | ||
| ; CHECK-LABEL: testLXVPRL: | ||
| ; CHECK: # %bb.0: # %entry | ||
| ; CHECK-NEXT: lxvprl vsp34, r4, r5 | ||
| ; CHECK-NEXT: stxv v2, 16(r3) | ||
| ; CHECK-NEXT: stxv v3, 0(r3) | ||
| ; CHECK-NEXT: blr | ||
| ; | ||
| ; AIX-LABEL: testLXVPRL: | ||
| ; AIX: # %bb.0: # %entry | ||
| ; AIX-NEXT: lxvprl vsp34, r4, r5 | ||
| ; AIX-NEXT: stxv v3, 16(r3) | ||
| ; AIX-NEXT: stxv v2, 0(r3) | ||
| ; AIX-NEXT: blr | ||
| entry: | ||
| %0 = tail call <256 x i1> @llvm.ppc.vsx.lxvprl(ptr %vpp, i64 %b) | ||
| ret <256 x i1> %0 | ||
| } | ||
| declare <256 x i1> @llvm.ppc.vsx.lxvprl(ptr, i64) | ||
|
|
||
| define <256 x i1> @testLXVPRLL(ptr %vpp, i64 %b) { | ||
| ; CHECK-LABEL: testLXVPRLL: | ||
| ; CHECK: # %bb.0: # %entry | ||
| ; CHECK-NEXT: lxvprll vsp34, r4, r5 | ||
| ; CHECK-NEXT: stxv v2, 16(r3) | ||
| ; CHECK-NEXT: stxv v3, 0(r3) | ||
| ; CHECK-NEXT: blr | ||
| ; | ||
| ; AIX-LABEL: testLXVPRLL: | ||
| ; AIX: # %bb.0: # %entry | ||
| ; AIX-NEXT: lxvprll vsp34, r4, r5 | ||
| ; AIX-NEXT: stxv v3, 16(r3) | ||
| ; AIX-NEXT: stxv v2, 0(r3) | ||
| ; AIX-NEXT: blr | ||
| entry: | ||
| %0 = tail call <256 x i1> @llvm.ppc.vsx.lxvprll(ptr %vpp, i64 %b) | ||
| ret <256 x i1> %0 | ||
| } | ||
| declare <256 x i1> @llvm.ppc.vsx.lxvprll(ptr, i64) | ||
|
|
||
| define void @testSTXVPRL(ptr %v, ptr %vp, i64 %len) { | ||
| ; CHECK-LABEL: testSTXVPRL: | ||
| ; CHECK: # %bb.0: # %entry | ||
| ; CHECK-NEXT: lxv v2, 16(r3) | ||
| ; CHECK-NEXT: lxv v3, 0(r3) | ||
| ; CHECK-NEXT: stxvprl vsp34, r4, r5 | ||
| ; CHECK-NEXT: blr | ||
| ; | ||
| ; AIX-LABEL: testSTXVPRL: | ||
| ; AIX: # %bb.0: # %entry | ||
| ; AIX-NEXT: lxv v2, 0(r3) | ||
| ; AIX-NEXT: lxv v3, 16(r3) | ||
| ; AIX-NEXT: stxvprl vsp34, r4, r5 | ||
| ; AIX-NEXT: blr | ||
| entry: | ||
| %0 = load <256 x i1>, ptr %v, align 32 | ||
| tail call void @llvm.ppc.vsx.stxvprl(<256 x i1> %0, ptr %vp, i64 %len) | ||
| ret void | ||
| } | ||
| declare void @llvm.ppc.vsx.stxvprl(<256 x i1>, ptr, i64) | ||
|
|
||
| define void @testSTXVPRLL(ptr %v, ptr %vp, i64 %len) { | ||
| ; CHECK-LABEL: testSTXVPRLL: | ||
| ; CHECK: # %bb.0: # %entry | ||
| ; CHECK-NEXT: lxv v2, 16(r3) | ||
| ; CHECK-NEXT: lxv v3, 0(r3) | ||
| ; CHECK-NEXT: stxvprll vsp34, r4, r5 | ||
| ; CHECK-NEXT: blr | ||
| ; | ||
| ; AIX-LABEL: testSTXVPRLL: | ||
| ; AIX: # %bb.0: # %entry | ||
| ; AIX-NEXT: lxv v2, 0(r3) | ||
| ; AIX-NEXT: lxv v3, 16(r3) | ||
| ; AIX-NEXT: stxvprll vsp34, r4, r5 | ||
| ; AIX-NEXT: blr | ||
| entry: | ||
| %0 = load <256 x i1>, ptr %v, align 32 | ||
| tail call void @llvm.ppc.vsx.stxvprll(<256 x i1> %0, ptr %vp, i64 %len) | ||
| ret void | ||
| } | ||
| declare void @llvm.ppc.vsx.stxvprll(<256 x i1>, ptr, i64) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.