| ... | @@ -94,8 +94,8 @@ pub fn emitMir( | ... | @@ -94,8 +94,8 @@ pub fn emitMir( |
| 94 | .ldx => try emit.mirArithmetic3Op(inst), | 94 | .ldx => try emit.mirArithmetic3Op(inst), |
| 95 | | 95 | |
| 96 | .@"or" => try emit.mirArithmetic3Op(inst), | 96 | .@"or" => try emit.mirArithmetic3Op(inst), |
| 97 | .xor => @panic("TODO implement sparc64 xor"), | 97 | .xor => try emit.mirArithmetic3Op(inst), |
| 98 | .xnor => @panic("TODO implement sparc64 xnor"), | 98 | .xnor => try emit.mirArithmetic3Op(inst), |
| 99 | | 99 | |
| 100 | .movcc => try emit.mirConditionalMove(inst), | 100 | .movcc => try emit.mirConditionalMove(inst), |
| 101 | | 101 | |
| ... | @@ -131,7 +131,7 @@ pub fn emitMir( | ... | @@ -131,7 +131,7 @@ pub fn emitMir( |
| 131 | | 131 | |
| 132 | .mov => try emit.mirArithmetic2Op(inst), | 132 | .mov => try emit.mirArithmetic2Op(inst), |
| 133 | | 133 | |
| 134 | .not => @panic("TODO implement sparc64 not"), | 134 | .not => try emit.mirArithmetic2Op(inst), |
| 135 | } | 135 | } |
| 136 | } | 136 | } |
| 137 | } | 137 | } |
| ... | @@ -192,6 +192,7 @@ fn mirArithmetic2Op(emit: *Emit, inst: Mir.Inst.Index) !void { | ... | @@ -192,6 +192,7 @@ fn mirArithmetic2Op(emit: *Emit, inst: Mir.Inst.Index) !void { |
| 192 | .@"return" => try emit.writeInstruction(Instruction.@"return"(i13, rs1, imm)), | 192 | .@"return" => try emit.writeInstruction(Instruction.@"return"(i13, rs1, imm)), |
| 193 | .cmp => try emit.writeInstruction(Instruction.subcc(i13, rs1, imm, .g0)), | 193 | .cmp => try emit.writeInstruction(Instruction.subcc(i13, rs1, imm, .g0)), |
| 194 | .mov => try emit.writeInstruction(Instruction.@"or"(i13, .g0, imm, rs1)), | 194 | .mov => try emit.writeInstruction(Instruction.@"or"(i13, .g0, imm, rs1)), |
| | 195 | .not => try emit.writeInstruction(Instruction.xnor(i13, .g0, imm, rs1)), |
| 195 | else => unreachable, | 196 | else => unreachable, |
| 196 | } | 197 | } |
| 197 | } else { | 198 | } else { |
| ... | @@ -200,6 +201,7 @@ fn mirArithmetic2Op(emit: *Emit, inst: Mir.Inst.Index) !void { | ... | @@ -200,6 +201,7 @@ fn mirArithmetic2Op(emit: *Emit, inst: Mir.Inst.Index) !void { |
| 200 | .@"return" => try emit.writeInstruction(Instruction.@"return"(Register, rs1, rs2)), | 201 | .@"return" => try emit.writeInstruction(Instruction.@"return"(Register, rs1, rs2)), |
| 201 | .cmp => try emit.writeInstruction(Instruction.subcc(Register, rs1, rs2, .g0)), | 202 | .cmp => try emit.writeInstruction(Instruction.subcc(Register, rs1, rs2, .g0)), |
| 202 | .mov => try emit.writeInstruction(Instruction.@"or"(Register, .g0, rs2, rs1)), | 203 | .mov => try emit.writeInstruction(Instruction.@"or"(Register, .g0, rs2, rs1)), |
| | 204 | .not => try emit.writeInstruction(Instruction.xnor(Register, .g0, rs2, rs1)), |
| 203 | else => unreachable, | 205 | else => unreachable, |
| 204 | } | 206 | } |
| 205 | } | 207 | } |
| ... | @@ -223,6 +225,8 @@ fn mirArithmetic3Op(emit: *Emit, inst: Mir.Inst.Index) !void { | ... | @@ -223,6 +225,8 @@ fn mirArithmetic3Op(emit: *Emit, inst: Mir.Inst.Index) !void { |
| 223 | .lduw => try emit.writeInstruction(Instruction.lduw(i13, rs1, imm, rd)), | 225 | .lduw => try emit.writeInstruction(Instruction.lduw(i13, rs1, imm, rd)), |
| 224 | .ldx => try emit.writeInstruction(Instruction.ldx(i13, rs1, imm, rd)), | 226 | .ldx => try emit.writeInstruction(Instruction.ldx(i13, rs1, imm, rd)), |
| 225 | .@"or" => try emit.writeInstruction(Instruction.@"or"(i13, rs1, imm, rd)), | 227 | .@"or" => try emit.writeInstruction(Instruction.@"or"(i13, rs1, imm, rd)), |
| | 228 | .xor => try emit.writeInstruction(Instruction.xor(i13, rs1, imm, rd)), |
| | 229 | .xnor => try emit.writeInstruction(Instruction.xnor(i13, rs1, imm, rd)), |
| 226 | .mulx => try emit.writeInstruction(Instruction.mulx(i13, rs1, imm, rd)), | 230 | .mulx => try emit.writeInstruction(Instruction.mulx(i13, rs1, imm, rd)), |
| 227 | .save => try emit.writeInstruction(Instruction.save(i13, rs1, imm, rd)), | 231 | .save => try emit.writeInstruction(Instruction.save(i13, rs1, imm, rd)), |
| 228 | .restore => try emit.writeInstruction(Instruction.restore(i13, rs1, imm, rd)), | 232 | .restore => try emit.writeInstruction(Instruction.restore(i13, rs1, imm, rd)), |
| ... | @@ -245,6 +249,8 @@ fn mirArithmetic3Op(emit: *Emit, inst: Mir.Inst.Index) !void { | ... | @@ -245,6 +249,8 @@ fn mirArithmetic3Op(emit: *Emit, inst: Mir.Inst.Index) !void { |
| 245 | .lduw => try emit.writeInstruction(Instruction.lduw(Register, rs1, rs2, rd)), | 249 | .lduw => try emit.writeInstruction(Instruction.lduw(Register, rs1, rs2, rd)), |
| 246 | .ldx => try emit.writeInstruction(Instruction.ldx(Register, rs1, rs2, rd)), | 250 | .ldx => try emit.writeInstruction(Instruction.ldx(Register, rs1, rs2, rd)), |
| 247 | .@"or" => try emit.writeInstruction(Instruction.@"or"(Register, rs1, rs2, rd)), | 251 | .@"or" => try emit.writeInstruction(Instruction.@"or"(Register, rs1, rs2, rd)), |
| | 252 | .xor => try emit.writeInstruction(Instruction.xor(Register, rs1, rs2, rd)), |
| | 253 | .xnor => try emit.writeInstruction(Instruction.xnor(Register, rs1, rs2, rd)), |
| 248 | .mulx => try emit.writeInstruction(Instruction.mulx(Register, rs1, rs2, rd)), | 254 | .mulx => try emit.writeInstruction(Instruction.mulx(Register, rs1, rs2, rd)), |
| 249 | .save => try emit.writeInstruction(Instruction.save(Register, rs1, rs2, rd)), | 255 | .save => try emit.writeInstruction(Instruction.save(Register, rs1, rs2, rd)), |
| 250 | .restore => try emit.writeInstruction(Instruction.restore(Register, rs1, rs2, rd)), | 256 | .restore => try emit.writeInstruction(Instruction.restore(Register, rs1, rs2, rd)), |