-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[AArch64] Add ISel for postindex ld1/st1 in big-endian #144387
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 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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 |
|---|---|---|
| @@ -0,0 +1,170 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
| ; RUN: llc -mtriple=aarch64 < %s -o - | FileCheck %s --check-prefixes=CHECK-LE | ||
| ; RUN: llc -mtriple=aarch64_be < %s -o - | FileCheck %s --check-prefixes=CHECK-BE | ||
|
|
||
| ; Check that we use the correct offset mode for vector loads and stores, and in | ||
| ; particular for big-endian we use ld1/st1 which only allows postindex immediate | ||
| ; offset of the same size as the memory access size. | ||
| ; FIXME: Currently we fail to make use of postindex register offset ld1/st1. | ||
|
|
||
| define [2 x ptr] @postidx_same_size([2 x ptr] %x) { | ||
| ; CHECK-LE-LABEL: postidx_same_size: | ||
| ; CHECK-LE: // %bb.0: // %entry | ||
| ; CHECK-LE-NEXT: ldr d0, [x0], #8 | ||
| ; CHECK-LE-NEXT: str d0, [x1], #8 | ||
| ; CHECK-LE-NEXT: ret | ||
| ; | ||
| ; CHECK-BE-LABEL: postidx_same_size: | ||
| ; CHECK-BE: // %bb.0: // %entry | ||
| ; CHECK-BE-NEXT: ld1 { v0.4h }, [x0], #8 | ||
| ; CHECK-BE-NEXT: st1 { v0.4h }, [x1], #8 | ||
| ; CHECK-BE-NEXT: ret | ||
| entry: | ||
| %ldptr = extractvalue [2 x ptr] %x, 0 | ||
| %stptr = extractvalue [2 x ptr] %x, 1 | ||
| %val = load <4 x i16>, ptr %ldptr, align 2 | ||
| store <4 x i16> %val, ptr %stptr, align 2 | ||
john-brawn-arm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| %add.ldptr = getelementptr inbounds nuw i8, ptr %ldptr, i64 8 | ||
| %add.stptr = getelementptr inbounds nuw i8, ptr %stptr, i64 8 | ||
| %ret1 = insertvalue [2 x ptr] poison, ptr %add.ldptr, 0 | ||
| %ret2 = insertvalue [2 x ptr] %ret1, ptr %add.stptr, 1 | ||
| ret [2 x ptr] %ret2 | ||
| } | ||
|
|
||
| define [2 x ptr] @preidx_same_size([2 x ptr] %x) { | ||
| ; CHECK-LE-LABEL: preidx_same_size: | ||
| ; CHECK-LE: // %bb.0: // %entry | ||
| ; CHECK-LE-NEXT: ldr d0, [x0, #8]! | ||
| ; CHECK-LE-NEXT: str d0, [x1, #8]! | ||
| ; CHECK-LE-NEXT: ret | ||
| ; | ||
| ; CHECK-BE-LABEL: preidx_same_size: | ||
| ; CHECK-BE: // %bb.0: // %entry | ||
| ; CHECK-BE-NEXT: add x0, x0, #8 | ||
| ; CHECK-BE-NEXT: add x1, x1, #8 | ||
| ; CHECK-BE-NEXT: ld1 { v0.4h }, [x0] | ||
| ; CHECK-BE-NEXT: st1 { v0.4h }, [x1] | ||
| ; CHECK-BE-NEXT: ret | ||
| entry: | ||
| %ldptr = extractvalue [2 x ptr] %x, 0 | ||
| %stptr = extractvalue [2 x ptr] %x, 1 | ||
| %add.ldptr = getelementptr inbounds nuw i8, ptr %ldptr, i64 8 | ||
| %add.stptr = getelementptr inbounds nuw i8, ptr %stptr, i64 8 | ||
| %val = load <4 x i16>, ptr %add.ldptr, align 2 | ||
| store <4 x i16> %val, ptr %add.stptr, align 2 | ||
| %ret1 = insertvalue [2 x ptr] poison, ptr %add.ldptr, 0 | ||
| %ret2 = insertvalue [2 x ptr] %ret1, ptr %add.stptr, 1 | ||
| ret [2 x ptr] %ret2 | ||
| } | ||
|
|
||
| define [2 x ptr] @postidx_different_size([2 x ptr] %x) { | ||
| ; CHECK-LE-LABEL: postidx_different_size: | ||
| ; CHECK-LE: // %bb.0: // %entry | ||
| ; CHECK-LE-NEXT: ldr d0, [x0], #16 | ||
| ; CHECK-LE-NEXT: str d0, [x1], #16 | ||
| ; CHECK-LE-NEXT: ret | ||
| ; | ||
| ; CHECK-BE-LABEL: postidx_different_size: | ||
| ; CHECK-BE: // %bb.0: // %entry | ||
| ; CHECK-BE-NEXT: ld1 { v0.4h }, [x0] | ||
| ; CHECK-BE-NEXT: mov x8, x1 | ||
| ; CHECK-BE-NEXT: add x0, x0, #16 | ||
| ; CHECK-BE-NEXT: add x1, x1, #16 | ||
| ; CHECK-BE-NEXT: st1 { v0.4h }, [x8] | ||
| ; CHECK-BE-NEXT: ret | ||
| entry: | ||
| %ldptr = extractvalue [2 x ptr] %x, 0 | ||
| %stptr = extractvalue [2 x ptr] %x, 1 | ||
| %val = load <4 x i16>, ptr %ldptr, align 2 | ||
| store <4 x i16> %val, ptr %stptr, align 2 | ||
| %add.ldptr = getelementptr inbounds nuw i8, ptr %ldptr, i64 16 | ||
| %add.stptr = getelementptr inbounds nuw i8, ptr %stptr, i64 16 | ||
| %ret1 = insertvalue [2 x ptr] poison, ptr %add.ldptr, 0 | ||
| %ret2 = insertvalue [2 x ptr] %ret1, ptr %add.stptr, 1 | ||
| ret [2 x ptr] %ret2 | ||
| } | ||
|
|
||
| define [2 x ptr] @preidx_different_size([2 x ptr] %x) { | ||
| ; CHECK-LE-LABEL: preidx_different_size: | ||
| ; CHECK-LE: // %bb.0: // %entry | ||
| ; CHECK-LE-NEXT: ldr d0, [x0, #16]! | ||
| ; CHECK-LE-NEXT: str d0, [x1, #16]! | ||
| ; CHECK-LE-NEXT: ret | ||
| ; | ||
| ; CHECK-BE-LABEL: preidx_different_size: | ||
| ; CHECK-BE: // %bb.0: // %entry | ||
| ; CHECK-BE-NEXT: add x0, x0, #16 | ||
| ; CHECK-BE-NEXT: add x1, x1, #16 | ||
| ; CHECK-BE-NEXT: ld1 { v0.4h }, [x0] | ||
| ; CHECK-BE-NEXT: st1 { v0.4h }, [x1] | ||
| ; CHECK-BE-NEXT: ret | ||
| entry: | ||
| %ldptr = extractvalue [2 x ptr] %x, 0 | ||
| %stptr = extractvalue [2 x ptr] %x, 1 | ||
| %add.ldptr = getelementptr inbounds nuw i8, ptr %ldptr, i64 16 | ||
| %add.stptr = getelementptr inbounds nuw i8, ptr %stptr, i64 16 | ||
| %val = load <4 x i16>, ptr %add.ldptr, align 2 | ||
| store <4 x i16> %val, ptr %add.stptr, align 2 | ||
| %ret1 = insertvalue [2 x ptr] poison, ptr %add.ldptr, 0 | ||
| %ret2 = insertvalue [2 x ptr] %ret1, ptr %add.stptr, 1 | ||
| ret [2 x ptr] %ret2 | ||
| } | ||
|
|
||
| define [2 x ptr] @postidx_reg([2 x ptr] %x, i64 %off) { | ||
| ; CHECK-LE-LABEL: postidx_reg: | ||
| ; CHECK-LE: // %bb.0: // %entry | ||
| ; CHECK-LE-NEXT: ldr d0, [x0] | ||
| ; CHECK-LE-NEXT: mov x8, x1 | ||
| ; CHECK-LE-NEXT: add x0, x0, x2 | ||
| ; CHECK-LE-NEXT: add x1, x1, x2 | ||
| ; CHECK-LE-NEXT: str d0, [x8] | ||
| ; CHECK-LE-NEXT: ret | ||
| ; | ||
| ; CHECK-BE-LABEL: postidx_reg: | ||
| ; CHECK-BE: // %bb.0: // %entry | ||
| ; CHECK-BE-NEXT: ld1 { v0.4h }, [x0] | ||
| ; CHECK-BE-NEXT: mov x8, x1 | ||
| ; CHECK-BE-NEXT: add x0, x0, x2 | ||
| ; CHECK-BE-NEXT: add x1, x1, x2 | ||
| ; CHECK-BE-NEXT: st1 { v0.4h }, [x8] | ||
| ; CHECK-BE-NEXT: ret | ||
| entry: | ||
| %ldptr = extractvalue [2 x ptr] %x, 0 | ||
| %stptr = extractvalue [2 x ptr] %x, 1 | ||
| %val = load <4 x i16>, ptr %ldptr, align 2 | ||
| store <4 x i16> %val, ptr %stptr, align 2 | ||
| %add.ldptr = getelementptr inbounds nuw i8, ptr %ldptr, i64 %off | ||
| %add.stptr = getelementptr inbounds nuw i8, ptr %stptr, i64 %off | ||
| %ret1 = insertvalue [2 x ptr] poison, ptr %add.ldptr, 0 | ||
| %ret2 = insertvalue [2 x ptr] %ret1, ptr %add.stptr, 1 | ||
| ret [2 x ptr] %ret2 | ||
| } | ||
|
|
||
| define [2 x ptr] @preidx_reg([2 x ptr] %x, i64 %off) { | ||
| ; CHECK-LE-LABEL: preidx_reg: | ||
| ; CHECK-LE: // %bb.0: // %entry | ||
| ; CHECK-LE-NEXT: mov x8, x1 | ||
| ; CHECK-LE-NEXT: ldr d0, [x0, x2] | ||
| ; CHECK-LE-NEXT: add x0, x0, x2 | ||
| ; CHECK-LE-NEXT: add x1, x1, x2 | ||
| ; CHECK-LE-NEXT: str d0, [x8, x2] | ||
| ; CHECK-LE-NEXT: ret | ||
| ; | ||
| ; CHECK-BE-LABEL: preidx_reg: | ||
| ; CHECK-BE: // %bb.0: // %entry | ||
| ; CHECK-BE-NEXT: add x0, x0, x2 | ||
| ; CHECK-BE-NEXT: add x1, x1, x2 | ||
| ; CHECK-BE-NEXT: ld1 { v0.4h }, [x0] | ||
| ; CHECK-BE-NEXT: st1 { v0.4h }, [x1] | ||
| ; CHECK-BE-NEXT: ret | ||
| entry: | ||
| %ldptr = extractvalue [2 x ptr] %x, 0 | ||
| %stptr = extractvalue [2 x ptr] %x, 1 | ||
| %add.ldptr = getelementptr inbounds nuw i8, ptr %ldptr, i64 %off | ||
| %add.stptr = getelementptr inbounds nuw i8, ptr %stptr, i64 %off | ||
| %val = load <4 x i16>, ptr %add.ldptr, align 2 | ||
| store <4 x i16> %val, ptr %add.stptr, align 2 | ||
| %ret1 = insertvalue [2 x ptr] poison, ptr %add.ldptr, 0 | ||
| %ret2 = insertvalue [2 x ptr] %ret1, ptr %add.stptr, 1 | ||
| ret [2 x ptr] %ret2 | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.