-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[PowerPC] Add BCDCOPYSIGN and BCDSETSIGN Instruction Support #144874
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 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8e287c1
[PowerPC] Add BCDCOPYSIGN and BCDSETSIGN Instruction Support
33cd604
review comment
8d884fa
Merge remote-tracking branch 'origin' into AditiRM/bcd_builtin
81c40a9
Minor fix
7ae44f6
Review Comments
1b10489
Minor fixes
98e4799
Implement CUSTOM_BUILTIN for setsign
AditiRM 821a032
Rolling back to TARGET_BUILTIN implementation
AditiRM cdfbaf9
Merge remote-tracking branch 'origin' into AditiRM/bcd_builtin
AditiRM f5b6861
minor fix
AditiRM c21517c
minor fix
AditiRM 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,29 @@ | ||
| // NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
| // REQUIRES: powerpc-registered-target | ||
| // RUN: %clang_cc1 -triple powerpc64le-unknown-unknown -O2 -target-cpu pwr9 \ | ||
| // RUN: -emit-llvm %s -o - | FileCheck %s | ||
| // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -O2 -target-cpu pwr9 \ | ||
| // RUN: -emit-llvm %s -o - | FileCheck %s | ||
| // RUN: %clang_cc1 -triple powerpc-unknown-unknown -O2 -target-cpu pwr9 \ | ||
| // RUN: -emit-llvm %s -o - | FileCheck %s | ||
|
|
||
| // CHECK-LABEL: test_bcdcopysign | ||
| // CHECK: [[TMP0:%.*]] = tail call <16 x i8> @llvm.ppc.bcdcopysign(<16 x i8> %a, <16 x i8> %b) | ||
| // CHECK-NEXT: ret <16 x i8> [[TMP0]] | ||
| vector unsigned char test_bcdcopysign(vector unsigned char a, vector unsigned char b) { | ||
| return __builtin_ppc_bcdcopysign(a, b); | ||
| } | ||
|
|
||
| // CHECK-LABEL: test_bcdsetsign_imm0 | ||
| // CHECK: [[TMP0:%.*]] = tail call <16 x i8> @llvm.ppc.bcdsetsign(<16 x i8> %a, i32 0) | ||
| // CHECK-NEXT: ret <16 x i8> [[TMP0]] | ||
| vector unsigned char test_bcdsetsign_imm0(vector unsigned char a) { | ||
| return __builtin_ppc_bcdsetsign(a, '\0'); | ||
| } | ||
|
|
||
| // CHECK-LABEL: test_bcdsetsign_imm1 | ||
| // CHECK: [[TMP0:%.*]] = tail call <16 x i8> @llvm.ppc.bcdsetsign(<16 x i8> %a, i32 1) | ||
| // CHECK-NEXT: ret <16 x i8> [[TMP0]] | ||
| vector unsigned char test_bcdsetsign_imm1(vector unsigned char a) { | ||
| return __builtin_ppc_bcdsetsign(a, '\1'); | ||
| } |
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 |
|---|---|---|
|
|
@@ -1630,9 +1630,11 @@ def BCDCTSQ_rec : VX_VT5_EO5_VB5_XO9_o <0, 385, "bcdctsq.", []>; | |
|
|
||
| // Decimal Copy-Sign/Set-Sign | ||
| let Defs = [CR6] in | ||
| def BCDCPSGN_rec : VX1_VT5_VA5_VB5<833, "bcdcpsgn.", []>; | ||
| def BCDCPSGN_rec : VX1_VT5_VA5_VB5<833, "bcdcpsgn.", | ||
| [(set v16i8:$VD, (int_ppc_bcdcopysign v16i8:$VA, v16i8:$VB))]>; | ||
|
|
||
| def BCDSETSGN_rec : VX_VT5_EO5_VB5_PS1_XO9_o<31, 385, "bcdsetsgn.", []>; | ||
| def BCDSETSGN_rec : VX_VT5_EO5_VB5_PS1_XO9_o<31, 385, "bcdsetsgn.", | ||
| [(set v16i8:$VD, (int_ppc_bcdsetsign v16i8:$VB, i32:$PS))]>; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keeping it as i32 since the backend expects and handles it correctly |
||
|
|
||
| // Decimal Shift/Unsigned-Shift/Shift-and-Round | ||
| def BCDS_rec : VX_VT5_VA5_VB5_PS1_XO9_o<193, "bcds." , []>; | ||
|
|
||
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,40 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
AditiRM marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-unknown -mcpu=pwr9 \ | ||
| ; RUN: --ppc-asm-full-reg-names < %s | FileCheck %s | ||
| ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-unknown -mcpu=pwr9 \ | ||
| ; RUN: --ppc-asm-full-reg-names < %s | FileCheck %s | ||
| ; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mtriple=powerpc64-ibm-aix-xcoff \ | ||
| ; RUN: -ppc-asm-full-reg-names < %s | FileCheck %s | ||
|
|
||
| define dso_local <16 x i8> @test_bcdcopysign(<16 x i8> noundef %a, <16 x i8> noundef %b) { | ||
| ; CHECK-LABEL: test_bcdcopysign: | ||
| ; CHECK: # %bb.0: # %entry | ||
| ; CHECK-NEXT: bcdcpsgn. v2, v2, v3 | ||
| ; CHECK-NEXT: blr | ||
| entry: | ||
| %0 = tail call <16 x i8> @llvm.ppc.bcdcopysign(<16 x i8> %a, <16 x i8> %b) | ||
| ret <16 x i8> %0 | ||
| } | ||
|
|
||
| define dso_local <16 x i8> @test_bcdsetsign_imm0(<16 x i8> noundef %a) { | ||
| ; CHECK-LABEL: test_bcdsetsign_imm0: | ||
| ; CHECK: # %bb.0: # %entry | ||
| ; CHECK-NEXT: bcdsetsgn. v2, v2, 0 | ||
| ; CHECK-NEXT: blr | ||
| entry: | ||
| %0 = tail call <16 x i8> @llvm.ppc.bcdsetsign(<16 x i8> %a, i32 0) | ||
| ret <16 x i8> %0 | ||
| } | ||
|
|
||
| define dso_local <16 x i8> @test_bcdsetsign_imm1(<16 x i8> noundef %a) { | ||
| ; CHECK-LABEL: test_bcdsetsign_imm1: | ||
| ; CHECK: # %bb.0: # %entry | ||
| ; CHECK-NEXT: bcdsetsgn. v2, v2, 1 | ||
| ; CHECK-NEXT: blr | ||
| entry: | ||
| %0 = tail call <16 x i8> @llvm.ppc.bcdsetsign(<16 x i8> %a, i32 1) | ||
| ret <16 x i8> %0 | ||
| } | ||
|
|
||
| declare <16 x i8> @llvm.ppc.bcdcopysign(<16 x i8>, <16 x i8>) | ||
| declare <16 x i8> @llvm.ppc.bcdsetsign(<16 x i8>, i32) | ||
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.