Skip to content

Commit

Permalink
[PowerPC] ANDI_rec_1_* should define CR0 (#89034)
Browse files Browse the repository at this point in the history
These pseudo instructions finally copy the result to CR0 so they should
define `CR0` in their definitions.
  • Loading branch information
Kai Luo authored Apr 18, 2024
1 parent 525d00e commit 0ee260e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions llvm/lib/Target/PowerPC/PPCInstrInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -4191,6 +4191,7 @@ def : Pat<(v4i32 (selectcc i1:$lhs, i1:$rhs, v4i32:$tval, v4i32:$fval, SETUGT)),
def : Pat<(v4i32 (selectcc i1:$lhs, i1:$rhs, v4i32:$tval, v4i32:$fval, SETNE)),
(SELECT_VRRC (CRXOR $lhs, $rhs), $tval, $fval)>;

let Defs = [CR0] in {
def ANDI_rec_1_EQ_BIT : PPCCustomInserterPseudo<(outs crbitrc:$dst), (ins gprc:$in),
"#ANDI_rec_1_EQ_BIT",
[(set i1:$dst, (trunc (not i32:$in)))]>;
Expand All @@ -4204,6 +4205,7 @@ def ANDI_rec_1_EQ_BIT8 : PPCCustomInserterPseudo<(outs crbitrc:$dst), (ins g8rc:
def ANDI_rec_1_GT_BIT8 : PPCCustomInserterPseudo<(outs crbitrc:$dst), (ins g8rc:$in),
"#ANDI_rec_1_GT_BIT8",
[(set i1:$dst, (trunc i64:$in))]>;
}

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

0 comments on commit 0ee260e

Please sign in to comment.