-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[AArch64] Removed redundant FMOV instruction for truncstores of f64/f32 via bitcast to i64/i32/i8. #149997
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
[AArch64] Removed redundant FMOV instruction for truncstores of f64/f32 via bitcast to i64/i32/i8. #149997
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
97f61b4
[AArch64] Add TableGen patterns for truncstore of bitcasted FP values…
Amichaxx 3faa302
Added tests for converting from int to fp, renamed tests
Amichaxx efa6fab
Removed predicates from patterns and feature flags from test
Amichaxx a2169a9
Alignment
Amichaxx 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 |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
| ; RUN: llc -mtriple=aarch64-unknown-linux-gnu -mattr=+fp-armv8,+fullfp16 < %s | FileCheck %s | ||
|
|
||
|
|
||
| define void @_Z10store_f64i32Pjd(ptr %n, double noundef %x){ | ||
Amichaxx marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ; CHECK-LABEL: _Z10store_f64i32Pjd: | ||
| ; CHECK: // %bb.0: // %entry | ||
| ; CHECK-NEXT: str s0, [x0] | ||
| ; CHECK-NEXT: ret | ||
| entry: | ||
Amichaxx marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| %0 = bitcast double %x to i64 | ||
| %conv = trunc i64 %0 to i32 | ||
| store i32 %conv, ptr %n, align 4 | ||
| ret void | ||
| } | ||
|
|
||
| define void @_Z9store_f64i16Ptd(ptr %n, double noundef %x){ | ||
Amichaxx marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ; CHECK-LABEL: _Z9store_f64i16Ptd: | ||
| ; CHECK: // %bb.0: // %entry | ||
| ; CHECK-NEXT: str h0, [x0] | ||
| ; CHECK-NEXT: ret | ||
| entry: | ||
| %0 = bitcast double %x to i64 | ||
| %conv = trunc i64 %0 to i16 | ||
| store i16 %conv, ptr %n, align 2 | ||
| ret void | ||
| } | ||
|
|
||
| define void @_Z13store_f64i8Phd(ptr %0, double noundef %1){ | ||
| ; CHECK-LABEL: _Z13store_f64i8Phd: | ||
| ; CHECK: // %bb.0: | ||
| ; CHECK-NEXT: str b0, [x0] | ||
| ; CHECK-NEXT: ret | ||
| %3 = bitcast double %1 to i64 | ||
| %4 = trunc i64 %3 to i8 | ||
| store i8 %4, ptr %0, align 1 | ||
| ret void | ||
| } | ||
|
|
||
| define void @_Z17store_f32i16Ptf(ptr %0, float noundef %1){ | ||
| ; CHECK-LABEL: _Z17store_f32i16Ptf: | ||
| ; CHECK: // %bb.0: | ||
| ; CHECK-NEXT: str h0, [x0] | ||
| ; CHECK-NEXT: ret | ||
| %3 = bitcast float %1 to i32 | ||
| %4 = trunc i32 %3 to i16 | ||
| store i16 %4, ptr %0, align 2 | ||
| ret void | ||
| } | ||
|
|
||
| define void @_Z16store_f32i8Phf(ptr %0, float noundef %1){ | ||
| ; CHECK-LABEL: _Z16store_f32i8Phf: | ||
| ; CHECK: // %bb.0: | ||
| ; CHECK-NEXT: str b0, [x0] | ||
| ; CHECK-NEXT: ret | ||
| %3 = bitcast float %1 to i32 | ||
| %4 = trunc i32 %3 to i8 | ||
| store i8 %4, ptr %0, align 1 | ||
| ret void | ||
| } | ||
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.