-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV] Change the immediate argument to Zk* intrinsics/builtins from…
… i8 to i32. This matches gcc. It also lets us fix a bug that the byteselect predicate was not being evaluated in tablegen. We can't have i8 TImmLeaf in tablegen because i8 isn't a type for any register class. I've added AutoUpgrade support for the IR intrinsics. Reviewed By: asb Differential Revision: https://reviews.llvm.org/D152627
- Loading branch information
Showing
16 changed files
with
195 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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,25 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
; RUN: llc -mtriple=riscv32 -mattr=+zknd -verify-machineinstrs < %s \ | ||
; RUN: | FileCheck %s -check-prefix=RV32ZKND | ||
|
||
declare i32 @llvm.riscv.aes32dsi(i32, i32, i8); | ||
|
||
define i32 @aes32dsi(i32 %a, i32 %b) nounwind { | ||
; RV32ZKND-LABEL: aes32dsi: | ||
; RV32ZKND: # %bb.0: | ||
; RV32ZKND-NEXT: aes32dsi a0, a0, a1, 0 | ||
; RV32ZKND-NEXT: ret | ||
%val = call i32 @llvm.riscv.aes32dsi(i32 %a, i32 %b, i8 0) | ||
ret i32 %val | ||
} | ||
|
||
declare i32 @llvm.riscv.aes32dsmi(i32, i32, i8); | ||
|
||
define i32 @aes32dsmi(i32 %a, i32 %b) nounwind { | ||
; RV32ZKND-LABEL: aes32dsmi: | ||
; RV32ZKND: # %bb.0: | ||
; RV32ZKND-NEXT: aes32dsmi a0, a0, a1, 1 | ||
; RV32ZKND-NEXT: ret | ||
%val = call i32 @llvm.riscv.aes32dsmi(i32 %a, i32 %b, i8 1) | ||
ret i32 %val | ||
} |
This file contains 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 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,25 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
; RUN: llc -mtriple=riscv32 -mattr=+zkne -verify-machineinstrs < %s \ | ||
; RUN: | FileCheck %s -check-prefix=RV32ZKNE | ||
|
||
declare i32 @llvm.riscv.aes32esi(i32, i32, i8); | ||
|
||
define i32 @aes32esi(i32 %a, i32 %b) nounwind { | ||
; RV32ZKNE-LABEL: aes32esi: | ||
; RV32ZKNE: # %bb.0: | ||
; RV32ZKNE-NEXT: aes32esi a0, a0, a1, 2 | ||
; RV32ZKNE-NEXT: ret | ||
%val = call i32 @llvm.riscv.aes32esi(i32 %a, i32 %b, i8 2) | ||
ret i32 %val | ||
} | ||
|
||
declare i32 @llvm.riscv.aes32esmi(i32, i32, i8); | ||
|
||
define i32 @aes32esmi(i32 %a, i32 %b) nounwind { | ||
; RV32ZKNE-LABEL: aes32esmi: | ||
; RV32ZKNE: # %bb.0: | ||
; RV32ZKNE-NEXT: aes32esmi a0, a0, a1, 3 | ||
; RV32ZKNE-NEXT: ret | ||
%val = call i32 @llvm.riscv.aes32esmi(i32 %a, i32 %b, i8 3) | ||
ret i32 %val | ||
} |
This file contains 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
25 changes: 25 additions & 0 deletions
25
llvm/test/CodeGen/RISCV/rv32zksed-intrinsic-autoupgrade.ll
This file contains 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,25 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
; RUN: llc -mtriple=riscv32 -mattr=+zksed -verify-machineinstrs < %s \ | ||
; RUN: | FileCheck %s -check-prefix=RV32ZKSED | ||
|
||
declare i32 @llvm.riscv.sm4ks.i32(i32, i32, i8); | ||
|
||
define i32 @sm4ks_i32(i32 %a, i32 %b) nounwind { | ||
; RV32ZKSED-LABEL: sm4ks_i32: | ||
; RV32ZKSED: # %bb.0: | ||
; RV32ZKSED-NEXT: sm4ks a0, a0, a1, 2 | ||
; RV32ZKSED-NEXT: ret | ||
%val = call i32 @llvm.riscv.sm4ks.i32(i32 %a, i32 %b, i8 2) | ||
ret i32 %val | ||
} | ||
|
||
declare i32 @llvm.riscv.sm4ed.i32(i32, i32, i8); | ||
|
||
define i32 @sm4ed_i32(i32 %a, i32 %b) nounwind { | ||
; RV32ZKSED-LABEL: sm4ed_i32: | ||
; RV32ZKSED: # %bb.0: | ||
; RV32ZKSED-NEXT: sm4ed a0, a0, a1, 3 | ||
; RV32ZKSED-NEXT: ret | ||
%val = call i32 @llvm.riscv.sm4ed.i32(i32 %a, i32 %b, i8 3) | ||
ret i32 %val | ||
} |
This file contains 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
Oops, something went wrong.