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