-
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] Add back SiFive's cdiscard.d.l1, cflush.d.l1, and cease instr…
…uctions. (#83896) These were in LLVM 17 but removed from LLVM 18 due to an incorrect extension name being used. This restores them with new extension names that match SiFive's downstream compiler. The extension name has been used internally for some time. It uses XSiFive instead of XSf like the newer extensions. `cease` did not have an internal extension name so its using the `XSf` convention. The spec for the instructions is here https://sifive.cdn.prismic.io/sifive/767804da-53b2-4893-97d5-b7c030ae0a94_s76mc_core_complex_manual_21G3.pdf though the extension name is not listed. Column width in the extension printing had to be changed to accommodate a longer extension name.
- Loading branch information
Showing
9 changed files
with
325 additions
and
163 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# RUN: not llvm-mc -triple riscv32 < %s 2>&1 | FileCheck %s | ||
# RUN: not llvm-mc -triple riscv64 < %s 2>&1 | FileCheck %s | ||
|
||
sf.cflush.d.l1 0x10 # CHECK: :[[@LINE]]:16: error: invalid operand for instruction | ||
|
||
sf.cdiscard.d.l1 0x10 # CHECK: :[[@LINE]]:18: error: invalid operand for instruction | ||
|
||
sf.cflush.d.l1 x0 # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'XSiFivecflushdlone' (SiFive sf.cflush.d.l1 Instruction){{$}} | ||
|
||
sf.cflush.d.l1 x7 # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'XSiFivecflushdlone' (SiFive sf.cflush.d.l1 Instruction){{$}} | ||
|
||
sf.cdiscard.d.l1 x0 # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'XSiFivecdiscarddlone' (SiFive sf.cdiscard.d.l1 Instruction){{$}} | ||
|
||
sf.cdiscard.d.l1 x7 # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'XSiFivecdiscarddlone' (SiFive sf.cdiscard.d.l1 Instruction){{$}} | ||
|
||
sf.cease x1 # CHECK: :[[@LINE]]:10: error: invalid operand for instruction | ||
|
||
sf.cease 0x10 # CHECK: :[[@LINE]]:10: error: invalid operand for instruction | ||
|
||
sf.cease # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'XSfcease' (SiFive sf.cease Instruction){{$}} |
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,36 @@ | ||
# RUN: llvm-mc %s -triple=riscv32 -mattr=+xsifivecdiscarddlone,+xsifivecflushdlone,+xsfcease -riscv-no-aliases -show-encoding \ | ||
# RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s | ||
# RUN: llvm-mc %s -triple=riscv64 -mattr=+xsifivecdiscarddlone,+xsifivecflushdlone,+xsfcease -riscv-no-aliases -show-encoding \ | ||
# RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s | ||
# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+xsifivecdiscarddlone,+xsifivecflushdlone,+xsfcease < %s \ | ||
# RUN: | llvm-objdump --mattr=+xsifivecdiscarddlone,+xsifivecflushdlone,+xsfcease -M no-aliases -d - \ | ||
# RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
# RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+xsifivecdiscarddlone,+xsifivecflushdlone,+xsfcease < %s \ | ||
# RUN: | llvm-objdump --mattr=+xsifivecdiscarddlone,+xsifivecflushdlone,+xsfcease -M no-aliases -d - \ | ||
# RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
|
||
# CHECK-INST: sf.cflush.d.l1 zero | ||
# CHECK-ENC: encoding: [0x73,0x00,0x00,0xfc] | ||
sf.cflush.d.l1 x0 | ||
# CHECK-INST: sf.cflush.d.l1 zero | ||
# CHECK-ENC: encoding: [0x73,0x00,0x00,0xfc] | ||
sf.cflush.d.l1 | ||
|
||
# CHECK-INST: sf.cflush.d.l1 t2 | ||
# CHECK-ENC: encoding: [0x73,0x80,0x03,0xfc] | ||
sf.cflush.d.l1 x7 | ||
|
||
# CHECK-INST: sf.cdiscard.d.l1 zero | ||
# CHECK-ENC: encoding: [0x73,0x00,0x20,0xfc] | ||
sf.cdiscard.d.l1 x0 | ||
# CHECK-INST: sf.cdiscard.d.l1 zero | ||
# CHECK-ENC: encoding: [0x73,0x00,0x20,0xfc] | ||
sf.cdiscard.d.l1 | ||
|
||
# CHECK-INST: sf.cdiscard.d.l1 t2 | ||
# CHECK-ENC: encoding: [0x73,0x80,0x23,0xfc] | ||
sf.cdiscard.d.l1 x7 | ||
|
||
# CHECK-INST: sf.cease | ||
# CHECK-ENC: encoding: [0x73,0x00,0x50,0x30] | ||
sf.cease |
Oops, something went wrong.