mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
stage2: sparc64: Use official encoding for not rs2, rs1
This commit is contained in:
parent
e7fde5f64e
commit
5c8612642b
@ -203,7 +203,7 @@ fn mirArithmetic2Op(emit: *Emit, inst: Mir.Inst.Index) !void {
|
||||
.@"return" => try emit.writeInstruction(Instruction.@"return"(Register, rs1, rs2)),
|
||||
.cmp => try emit.writeInstruction(Instruction.subcc(Register, rs1, rs2, .g0)),
|
||||
.mov => try emit.writeInstruction(Instruction.@"or"(Register, .g0, rs2, rs1)),
|
||||
.not => try emit.writeInstruction(Instruction.xnor(Register, .g0, rs2, rs1)),
|
||||
.not => try emit.writeInstruction(Instruction.xnor(Register, rs2, .g0, rs1)),
|
||||
else => unreachable,
|
||||
}
|
||||
}
|
||||
|
||||
@ -158,8 +158,9 @@ pub const Inst = struct {
|
||||
/// This uses the arithmetic_2op field, with rs1
|
||||
/// being the *destination* register.
|
||||
// TODO is it okay to abuse rs1 in this way?
|
||||
// TODO this differs from official encoding for convenience, fix it later
|
||||
not, // not rs2/imm, rs1 -> xnor %g0, rs2/imm, rs1
|
||||
// not rs2, rs1 -> xnor rs2, %g0, rs1
|
||||
// not imm, rs1 -> xnor %g0, imm, rs1
|
||||
not,
|
||||
};
|
||||
|
||||
/// The position of an MIR instruction within the `Mir` instructions array.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user