Skip to content

Commit a9148d5

Browse files
committed
[M68k] Fix reverse operands on MxCmp_RR and MxCmp_RM
1 parent 81db017 commit a9148d5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Target/M68k/M68kInstrArithmetic.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,17 +397,17 @@ defm XOR : MxBiArOp_DF_EAd<"eor", MxXor, 0xB, 0xA>;
397397
let isCompare = 1, Defs = [CCR] in {
398398
class MxCmp_RR<MxType LHS_TYPE, MxType RHS_TYPE = LHS_TYPE>
399399
: MxInst<(outs), (ins LHS_TYPE.ROp:$lhs, RHS_TYPE.ROp:$rhs),
400-
"cmp."#RHS_TYPE.Prefix#"\t$lhs, $rhs",
400+
"cmp."#RHS_TYPE.Prefix#"\t$rhs, $lhs",
401401
[(set CCR, (MxCmp LHS_TYPE.VT:$lhs, RHS_TYPE.VT:$rhs))]> {
402402
let Inst = (descend 0b1011,
403403
// REGISTER
404-
(operand "$rhs", 3),
404+
(operand "$lhs", 3),
405405
// OPMODE
406406
!cast<MxOpModeEncoding>("MxOpMode"#RHS_TYPE.Size#"_"#RHS_TYPE.RLet#"_EA").Value,
407407
// MODE without last bit
408408
0b00,
409409
// REGISTER prefixed by D/A bit
410-
(operand "$lhs", 4)
410+
(operand "$rhs", 4)
411411
);
412412
}
413413

@@ -467,7 +467,7 @@ class MxCmp_RM<MxType TYPE, MxOperand MEMOpd, ComplexPattern MEMPat,
467467
MxEncMemOp MEM_ENC>
468468
: MxInst<(outs), (ins TYPE.ROp:$reg, MEMOpd:$mem),
469469
"cmp."#TYPE.Prefix#"\t$mem, $reg",
470-
[(set CCR, (MxCmp (load MEMPat:$mem), TYPE.ROp:$reg))]> {
470+
[(set CCR, (MxCmp TYPE.ROp:$reg, (load MEMPat:$mem)))]> {
471471
let Inst = (ascend
472472
(descend 0b1011,
473473
// REGISTER

0 commit comments

Comments
 (0)