Skip to content

Commit 17e293d

Browse files
[LLVM][AArch64]CFINV - Add UNPREDICTABLE behaviour if CRm is not zero (llvm#140593)
Now CFINV follows AXFLAGS behaviour for CRm. It looks like (0) in the instruction encoding means that the behaviour is UNPREDICTABLE if that bit is not zero.
1 parent e8dff7b commit 17e293d

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,6 +2096,7 @@ def FJCVTZS : BaseFPToIntegerUnscaled<0b01, 0b11, 0b110, FPR64, GPR32,
20962096
let Predicates = [HasFlagM], Defs = [NZCV], Uses = [NZCV] in {
20972097
def CFINV : SimpleSystemI<0, (ins), "cfinv", "">, Sched<[WriteSys]> {
20982098
let Inst{20-5} = 0b0000001000000000;
2099+
let Unpredictable{11-8} = 0b1111;
20992100
}
21002101
def SETF8 : BaseFlagManipulation<0, 0, (ins GPR32:$Rn), "setf8", "{\t$Rn}">;
21012102
def SETF16 : BaseFlagManipulation<0, 1, (ins GPR32:$Rn), "setf16", "{\t$Rn}">;

llvm/test/MC/Disassembler/AArch64/armv8.4a-flag.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
# RUN: llvm-mc -triple aarch64-none-linux-gnu -mattr=+v8r --disassemble < %s | FileCheck %s
33

44
[0x1f,0x40,0x00,0xd5]
5+
[0x1f,0x4f,0x00,0xd5]
56
[0x2d,0x08,0x00,0x3a]
67
[0x2d,0x48,0x00,0x3a]
78
[0x2f,0x84,0x1f,0xba]
89

10+
#CHECK: cfinv
911
#CHECK: cfinv
1012
#CHECK: setf8 w1
1113
#CHECK: setf16 w1

0 commit comments

Comments
 (0)