Skip to content

Commit 0ee260e

Browse files
author
Kai Luo
authored
[PowerPC] ANDI_rec_1_* should define CR0 (#89034)
These pseudo instructions finally copy the result to CR0 so they should define `CR0` in their definitions.
1 parent 525d00e commit 0ee260e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Target/PowerPC/PPCInstrInfo.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4191,6 +4191,7 @@ def : Pat<(v4i32 (selectcc i1:$lhs, i1:$rhs, v4i32:$tval, v4i32:$fval, SETUGT)),
41914191
def : Pat<(v4i32 (selectcc i1:$lhs, i1:$rhs, v4i32:$tval, v4i32:$fval, SETNE)),
41924192
(SELECT_VRRC (CRXOR $lhs, $rhs), $tval, $fval)>;
41934193

4194+
let Defs = [CR0] in {
41944195
def ANDI_rec_1_EQ_BIT : PPCCustomInserterPseudo<(outs crbitrc:$dst), (ins gprc:$in),
41954196
"#ANDI_rec_1_EQ_BIT",
41964197
[(set i1:$dst, (trunc (not i32:$in)))]>;
@@ -4204,6 +4205,7 @@ def ANDI_rec_1_EQ_BIT8 : PPCCustomInserterPseudo<(outs crbitrc:$dst), (ins g8rc:
42044205
def ANDI_rec_1_GT_BIT8 : PPCCustomInserterPseudo<(outs crbitrc:$dst), (ins g8rc:$in),
42054206
"#ANDI_rec_1_GT_BIT8",
42064207
[(set i1:$dst, (trunc i64:$in))]>;
4208+
}
42074209

42084210
def : Pat<(i1 (not (trunc i32:$in))),
42094211
(ANDI_rec_1_EQ_BIT $in)>;

0 commit comments

Comments
 (0)