mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 21:08:36 +00:00
lower: fix logic bug in cmp_gt
This commit is contained in:
parent
c78ebeb44c
commit
d3f75522d7
@ -304,7 +304,6 @@ pub fn lowerMir(lower: *Lower, index: Mir.Inst.Index, options: struct {
|
||||
};
|
||||
|
||||
const is_unsigned = ty.isUnsignedInt(pt.zcu);
|
||||
|
||||
const less_than: Encoding.Mnemonic = if (is_unsigned) .sltu else .slt;
|
||||
|
||||
switch (class) {
|
||||
@ -338,8 +337,8 @@ pub fn lowerMir(lower: *Lower, index: Mir.Inst.Index, options: struct {
|
||||
.gt => {
|
||||
try lower.emit(less_than, &.{
|
||||
.{ .reg = rd },
|
||||
.{ .reg = rs1 },
|
||||
.{ .reg = rs2 },
|
||||
.{ .reg = rs1 },
|
||||
});
|
||||
},
|
||||
.gte => {
|
||||
@ -348,7 +347,6 @@ pub fn lowerMir(lower: *Lower, index: Mir.Inst.Index, options: struct {
|
||||
.{ .reg = rs1 },
|
||||
.{ .reg = rs2 },
|
||||
});
|
||||
|
||||
try lower.emit(.xori, &.{
|
||||
.{ .reg = rd },
|
||||
.{ .reg = rd },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user