2016-07-01 14:01:06 +01:00
|
|
|
/* This file is part of the dynarmic project.
|
|
|
|
* Copyright (c) 2016 MerryMage
|
|
|
|
* This software may be used and distributed according to the terms of the GNU
|
|
|
|
* General Public License version 2 or any later version.
|
|
|
|
*/
|
|
|
|
|
2016-07-07 10:53:09 +01:00
|
|
|
#include "common/assert.h"
|
2016-09-03 21:48:03 +01:00
|
|
|
#include "frontend/ir/ir_emitter.h"
|
|
|
|
#include "frontend/ir/opcodes.h"
|
2016-07-01 14:01:06 +01:00
|
|
|
|
|
|
|
namespace Dynarmic {
|
2016-08-25 17:36:42 +01:00
|
|
|
namespace IR {
|
2016-07-01 14:01:06 +01:00
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::Unimplemented() {
|
2016-07-01 14:01:06 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
u32 A32IREmitter::PC() {
|
2016-08-01 20:03:13 +01:00
|
|
|
u32 offset = current_location.TFlag() ? 4 : 8;
|
|
|
|
return current_location.PC() + offset;
|
2016-07-11 22:43:53 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
u32 A32IREmitter::AlignPC(size_t alignment) {
|
2016-07-11 22:43:53 +01:00
|
|
|
u32 pc = PC();
|
|
|
|
return static_cast<u32>(pc - pc % alignment);
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::Imm1(bool imm1) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Value(imm1);
|
2016-07-08 10:09:18 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::Imm8(u8 imm8) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Value(imm8);
|
2016-07-01 14:01:06 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::Imm32(u32 imm32) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Value(imm32);
|
2016-07-08 10:09:18 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::Imm64(u64 imm64) {
|
2016-12-03 11:29:50 +00:00
|
|
|
return Value(imm64);
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::GetRegister(A32::Reg reg) {
|
|
|
|
if (reg == A32::Reg::PC) {
|
2016-07-11 22:43:53 +01:00
|
|
|
return Imm32(PC());
|
2016-07-08 10:09:18 +01:00
|
|
|
}
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::GetRegister, { Value(reg) });
|
2016-07-01 14:01:06 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::GetExtendedRegister(A32::ExtReg reg) {
|
|
|
|
if (A32::IsSingleExtReg(reg)) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::GetExtendedRegister32, {Value(reg)});
|
2016-09-07 12:08:35 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
if (A32::IsDoubleExtReg(reg)) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::GetExtendedRegister64, {Value(reg)});
|
2016-08-05 18:54:19 +01:00
|
|
|
}
|
2016-09-07 12:08:35 +01:00
|
|
|
|
|
|
|
ASSERT_MSG(false, "Invalid reg.");
|
2016-08-05 18:54:19 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::SetRegister(const A32::Reg reg, const Value& value) {
|
|
|
|
ASSERT(reg != A32::Reg::PC);
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::SetRegister, { Value(reg), value });
|
2016-07-01 14:01:06 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::SetExtendedRegister(const A32::ExtReg reg, const Value& value) {
|
|
|
|
if (A32::IsSingleExtReg(reg)) {
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::SetExtendedRegister32, {Value(reg), value});
|
2018-01-01 15:23:56 +00:00
|
|
|
} else if (A32::IsDoubleExtReg(reg)) {
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::SetExtendedRegister64, {Value(reg), value});
|
2016-08-05 18:54:19 +01:00
|
|
|
} else {
|
|
|
|
ASSERT_MSG(false, "Invalid reg.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::ALUWritePC(const Value& value) {
|
2016-07-08 10:09:18 +01:00
|
|
|
// This behaviour is ARM version-dependent.
|
2016-07-12 10:58:14 +01:00
|
|
|
// The below implementation is for ARMv6k
|
2016-07-18 21:04:39 +01:00
|
|
|
BranchWritePC(value);
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::BranchWritePC(const Value& value) {
|
2016-08-01 20:03:13 +01:00
|
|
|
if (!current_location.TFlag()) {
|
2016-07-12 10:58:14 +01:00
|
|
|
auto new_pc = And(value, Imm32(0xFFFFFFFC));
|
2018-01-01 15:23:56 +00:00
|
|
|
Inst(Opcode::SetRegister, { Value(A32::Reg::PC), new_pc });
|
2016-07-12 10:58:14 +01:00
|
|
|
} else {
|
|
|
|
auto new_pc = And(value, Imm32(0xFFFFFFFE));
|
2018-01-01 15:23:56 +00:00
|
|
|
Inst(Opcode::SetRegister, { Value(A32::Reg::PC), new_pc });
|
2016-07-12 10:58:14 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::BXWritePC(const Value& value) {
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::BXWritePC, {value});
|
2016-07-18 21:04:39 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::LoadWritePC(const Value& value) {
|
2016-07-12 10:58:14 +01:00
|
|
|
// This behaviour is ARM version-dependent.
|
|
|
|
// The below implementation is for ARMv6k
|
2016-07-18 21:04:39 +01:00
|
|
|
BXWritePC(value);
|
2016-07-08 10:09:18 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::CallSupervisor(const Value& value) {
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::CallSupervisor, {value});
|
2016-07-14 14:04:43 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::PushRSB(const A32::LocationDescriptor& return_location) {
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::PushRSB, {Value(return_location.UniqueHash())});
|
2016-08-13 00:10:23 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::GetCpsr() {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::GetCpsr, {});
|
2016-08-14 19:39:16 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::SetCpsr(const Value& value) {
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::SetCpsr, {value});
|
2016-08-14 19:39:16 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::SetCpsrNZCV(const Value& value) {
|
2017-12-09 15:42:47 +00:00
|
|
|
Inst(Opcode::SetCpsrNZCV, {value});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::SetCpsrNZCVQ(const Value& value) {
|
2017-12-09 15:42:47 +00:00
|
|
|
Inst(Opcode::SetCpsrNZCVQ, {value});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::GetCFlag() {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::GetCFlag, {});
|
2016-07-01 14:01:06 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::SetNFlag(const Value& value) {
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::SetNFlag, {value});
|
2016-07-01 14:01:06 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::SetZFlag(const Value& value) {
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::SetZFlag, {value});
|
2016-07-01 14:01:06 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::SetCFlag(const Value& value) {
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::SetCFlag, {value});
|
2016-07-01 14:01:06 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::SetVFlag(const Value& value) {
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::SetVFlag, {value});
|
2016-07-08 10:09:18 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::OrQFlag(const Value& value) {
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::OrQFlag, {value});
|
2016-11-23 19:44:27 +00:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::GetGEFlags() {
|
2016-11-23 19:44:27 +00:00
|
|
|
return Inst(Opcode::GetGEFlags, {});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::SetGEFlags(const Value& value) {
|
2016-11-23 19:44:27 +00:00
|
|
|
Inst(Opcode::SetGEFlags, {value});
|
2016-08-06 22:04:52 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::SetGEFlagsCompressed(const Value& value) {
|
2017-12-09 15:42:47 +00:00
|
|
|
Inst(Opcode::SetGEFlagsCompressed, {value});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::GetFpscr() {
|
2016-08-26 22:47:54 +01:00
|
|
|
return Inst(Opcode::GetFpscr, {});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::SetFpscr(const Value& new_fpscr) {
|
2016-08-26 22:47:54 +01:00
|
|
|
Inst(Opcode::SetFpscr, {new_fpscr});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::GetFpscrNZCV() {
|
2016-08-26 22:47:54 +01:00
|
|
|
return Inst(Opcode::GetFpscrNZCV, {});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::SetFpscrNZCV(const Value& new_fpscr_nzcv) {
|
2016-08-26 22:47:54 +01:00
|
|
|
Inst(Opcode::SetFpscrNZCV, {new_fpscr_nzcv});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::Pack2x32To1x64(const Value& lo, const Value& hi) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::Pack2x32To1x64, {lo, hi});
|
2016-08-04 22:04:42 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::LeastSignificantWord(const Value& value) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::LeastSignificantWord, {value});
|
2016-08-04 22:04:42 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndCarry A32IREmitter::MostSignificantWord(const Value& value) {
|
2016-08-25 17:36:42 +01:00
|
|
|
auto result = Inst(Opcode::MostSignificantWord, {value});
|
|
|
|
auto carry_out = Inst(Opcode::GetCarryFromOp, {result});
|
2016-08-06 21:03:57 +01:00
|
|
|
return {result, carry_out};
|
2016-08-04 22:04:42 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::LeastSignificantHalf(const Value& value) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::LeastSignificantHalf, {value});
|
2016-07-11 23:06:35 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::LeastSignificantByte(const Value& value) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::LeastSignificantByte, {value});
|
2016-07-01 14:01:06 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::MostSignificantBit(const Value& value) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::MostSignificantBit, {value});
|
2016-07-01 14:01:06 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::IsZero(const Value& value) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::IsZero, {value});
|
2016-07-01 14:01:06 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::IsZero64(const Value& value) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::IsZero64, {value});
|
2016-08-04 22:04:42 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndCarry A32IREmitter::LogicalShiftLeft(const Value& value_in, const Value& shift_amount, const Value& carry_in) {
|
2016-08-25 17:36:42 +01:00
|
|
|
auto result = Inst(Opcode::LogicalShiftLeft, {value_in, shift_amount, carry_in});
|
|
|
|
auto carry_out = Inst(Opcode::GetCarryFromOp, {result});
|
2016-07-01 14:01:06 +01:00
|
|
|
return {result, carry_out};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndCarry A32IREmitter::LogicalShiftRight(const Value& value_in, const Value& shift_amount, const Value& carry_in) {
|
2016-08-25 17:36:42 +01:00
|
|
|
auto result = Inst(Opcode::LogicalShiftRight, {value_in, shift_amount, carry_in});
|
|
|
|
auto carry_out = Inst(Opcode::GetCarryFromOp, {result});
|
2016-07-01 14:01:06 +01:00
|
|
|
return {result, carry_out};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::LogicalShiftRight64(const Value& value_in, const Value& shift_amount) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::LogicalShiftRight64, {value_in, shift_amount});
|
2016-08-07 14:23:33 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndCarry A32IREmitter::ArithmeticShiftRight(const Value& value_in, const Value& shift_amount, const Value& carry_in) {
|
2016-08-25 17:36:42 +01:00
|
|
|
auto result = Inst(Opcode::ArithmeticShiftRight, {value_in, shift_amount, carry_in});
|
|
|
|
auto carry_out = Inst(Opcode::GetCarryFromOp, {result});
|
2016-07-04 10:22:11 +01:00
|
|
|
return {result, carry_out};
|
|
|
|
}
|
2016-07-01 14:01:06 +01:00
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndCarry A32IREmitter::RotateRight(const Value& value_in, const Value& shift_amount, const Value& carry_in) {
|
2016-08-25 17:36:42 +01:00
|
|
|
auto result = Inst(Opcode::RotateRight, {value_in, shift_amount, carry_in});
|
|
|
|
auto carry_out = Inst(Opcode::GetCarryFromOp, {result});
|
2016-07-10 01:18:17 +01:00
|
|
|
return {result, carry_out};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndCarry A32IREmitter::RotateRightExtended(const Value& value_in, const Value& carry_in) {
|
2016-08-25 17:36:42 +01:00
|
|
|
auto result = Inst(Opcode::RotateRightExtended, {value_in, carry_in});
|
|
|
|
auto carry_out = Inst(Opcode::GetCarryFromOp, {result});
|
2016-07-31 19:07:35 +01:00
|
|
|
return {result, carry_out};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndCarryAndOverflow A32IREmitter::AddWithCarry(const Value& a, const Value& b, const Value& carry_in) {
|
2016-08-25 17:36:42 +01:00
|
|
|
auto result = Inst(Opcode::AddWithCarry, {a, b, carry_in});
|
|
|
|
auto carry_out = Inst(Opcode::GetCarryFromOp, {result});
|
|
|
|
auto overflow = Inst(Opcode::GetOverflowFromOp, {result});
|
2016-07-08 10:09:18 +01:00
|
|
|
return {result, carry_out, overflow};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::Add(const Value& a, const Value& b) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::AddWithCarry, {a, b, Imm1(0)});
|
2016-07-11 22:43:53 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::Add64(const Value& a, const Value& b) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::Add64, {a, b});
|
2016-08-04 22:04:42 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndCarryAndOverflow A32IREmitter::SubWithCarry(const Value& a, const Value& b, const Value& carry_in) {
|
2016-07-08 11:49:30 +01:00
|
|
|
// This is equivalent to AddWithCarry(a, Not(b), carry_in).
|
2016-08-25 17:36:42 +01:00
|
|
|
auto result = Inst(Opcode::SubWithCarry, {a, b, carry_in});
|
|
|
|
auto carry_out = Inst(Opcode::GetCarryFromOp, {result});
|
|
|
|
auto overflow = Inst(Opcode::GetOverflowFromOp, {result});
|
2016-07-08 11:49:30 +01:00
|
|
|
return {result, carry_out, overflow};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::Sub(const Value& a, const Value& b) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::SubWithCarry, {a, b, Imm1(1)});
|
2016-07-18 15:11:16 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::Sub64(const Value& a, const Value& b) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::Sub64, {a, b});
|
2016-08-06 06:09:47 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::Mul(const Value& a, const Value& b) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::Mul, {a, b});
|
2016-08-04 22:04:42 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::Mul64(const Value& a, const Value& b) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::Mul64, {a, b});
|
2016-08-04 22:04:42 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::And(const Value& a, const Value& b) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::And, {a, b});
|
2016-07-08 10:43:28 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::Eor(const Value& a, const Value& b) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::Eor, {a, b});
|
2016-07-08 11:14:50 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::Or(const Value& a, const Value& b) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::Or, {a, b});
|
2016-07-10 02:06:38 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::Not(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::Not, {a});
|
2016-07-10 03:44:45 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::SignExtendWordToLong(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::SignExtendWordToLong, {a});
|
2016-08-04 22:04:42 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::SignExtendHalfToWord(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::SignExtendHalfToWord, {a});
|
2016-07-16 19:23:42 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::SignExtendByteToWord(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::SignExtendByteToWord, {a});
|
2016-07-16 19:23:42 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::ZeroExtendWordToLong(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::ZeroExtendWordToLong, {a});
|
2016-07-16 19:23:42 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::ZeroExtendHalfToWord(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::ZeroExtendHalfToWord, {a});
|
2016-07-16 19:23:42 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::ZeroExtendByteToWord(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::ZeroExtendByteToWord, {a});
|
2016-07-16 19:23:42 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::ByteReverseWord(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::ByteReverseWord, {a});
|
2016-07-16 19:23:42 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::ByteReverseHalf(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::ByteReverseHalf, {a});
|
2016-07-16 19:23:42 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::ByteReverseDual(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::ByteReverseDual, {a});
|
2016-07-20 15:34:17 +01:00
|
|
|
}
|
2016-07-16 19:23:42 +01:00
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::CountLeadingZeros(const Value& a) {
|
2016-12-15 22:33:20 +00:00
|
|
|
return Inst(Opcode::CountLeadingZeros, {a});
|
2016-12-18 16:25:41 +00:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndOverflow A32IREmitter::SignedSaturatedAdd(const Value& a, const Value& b) {
|
2016-12-15 22:33:20 +00:00
|
|
|
auto result = Inst(Opcode::SignedSaturatedAdd, {a, b});
|
|
|
|
auto overflow = Inst(Opcode::GetOverflowFromOp, {result});
|
|
|
|
return {result, overflow};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndOverflow A32IREmitter::SignedSaturatedSub(const Value& a, const Value& b) {
|
2016-12-15 22:33:20 +00:00
|
|
|
auto result = Inst(Opcode::SignedSaturatedSub, {a, b});
|
|
|
|
auto overflow = Inst(Opcode::GetOverflowFromOp, {result});
|
|
|
|
return {result, overflow};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndOverflow A32IREmitter::UnsignedSaturation(const Value& a, size_t bit_size_to_saturate_to) {
|
2016-12-21 14:16:48 +00:00
|
|
|
ASSERT(bit_size_to_saturate_to <= 31);
|
|
|
|
auto result = Inst(Opcode::UnsignedSaturation, {a, Imm8(static_cast<u8>(bit_size_to_saturate_to))});
|
|
|
|
auto overflow = Inst(Opcode::GetOverflowFromOp, {result});
|
|
|
|
return {result, overflow};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndOverflow A32IREmitter::SignedSaturation(const Value& a, size_t bit_size_to_saturate_to) {
|
2016-12-21 14:16:48 +00:00
|
|
|
ASSERT(bit_size_to_saturate_to >= 1 && bit_size_to_saturate_to <= 32);
|
|
|
|
auto result = Inst(Opcode::SignedSaturation, {a, Imm8(static_cast<u8>(bit_size_to_saturate_to))});
|
|
|
|
auto overflow = Inst(Opcode::GetOverflowFromOp, {result});
|
|
|
|
return {result, overflow};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndGE A32IREmitter::PackedAddU8(const Value& a, const Value& b) {
|
2016-12-04 20:52:33 +00:00
|
|
|
auto result = Inst(Opcode::PackedAddU8, {a, b});
|
|
|
|
auto ge = Inst(Opcode::GetGEFromOp, {result});
|
|
|
|
return {result, ge};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndGE A32IREmitter::PackedAddS8(const Value& a, const Value& b) {
|
2016-12-18 16:25:41 +00:00
|
|
|
auto result = Inst(Opcode::PackedAddS8, {a, b});
|
|
|
|
auto ge = Inst(Opcode::GetGEFromOp, {result});
|
|
|
|
return {result, ge};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndGE A32IREmitter::PackedAddU16(const Value& a, const Value& b) {
|
2016-12-18 16:25:41 +00:00
|
|
|
auto result = Inst(Opcode::PackedAddU16, {a, b});
|
|
|
|
auto ge = Inst(Opcode::GetGEFromOp, {result});
|
|
|
|
return {result, ge};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndGE A32IREmitter::PackedAddS16(const Value& a, const Value& b) {
|
2016-12-18 16:25:41 +00:00
|
|
|
auto result = Inst(Opcode::PackedAddS16, {a, b});
|
|
|
|
auto ge = Inst(Opcode::GetGEFromOp, {result});
|
|
|
|
return {result, ge};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndGE A32IREmitter::PackedSubU8(const Value& a, const Value& b) {
|
2016-12-05 00:27:59 +00:00
|
|
|
auto result = Inst(Opcode::PackedSubU8, {a, b});
|
|
|
|
auto ge = Inst(Opcode::GetGEFromOp, {result});
|
|
|
|
return {result, ge};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndGE A32IREmitter::PackedSubS8(const Value& a, const Value& b) {
|
2016-12-18 16:25:41 +00:00
|
|
|
auto result = Inst(Opcode::PackedSubS8, {a, b});
|
|
|
|
auto ge = Inst(Opcode::GetGEFromOp, {result});
|
|
|
|
return {result, ge};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndGE A32IREmitter::PackedSubU16(const Value& a, const Value& b) {
|
2016-12-18 16:25:41 +00:00
|
|
|
auto result = Inst(Opcode::PackedSubU16, {a, b});
|
|
|
|
auto ge = Inst(Opcode::GetGEFromOp, {result});
|
|
|
|
return {result, ge};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndGE A32IREmitter::PackedSubS16(const Value& a, const Value& b) {
|
2016-12-18 16:25:41 +00:00
|
|
|
auto result = Inst(Opcode::PackedSubS16, {a, b});
|
|
|
|
auto ge = Inst(Opcode::GetGEFromOp, {result});
|
|
|
|
return {result, ge};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndGE A32IREmitter::PackedAddSubU16(const Value& a, const Value& b) {
|
2017-03-24 15:56:24 +00:00
|
|
|
auto result = Inst(Opcode::PackedAddSubU16, {a, b});
|
|
|
|
auto ge = Inst(Opcode::GetGEFromOp, {result});
|
|
|
|
return {result, ge};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndGE A32IREmitter::PackedAddSubS16(const Value& a, const Value& b) {
|
2017-03-24 15:56:24 +00:00
|
|
|
auto result = Inst(Opcode::PackedAddSubS16, {a, b});
|
|
|
|
auto ge = Inst(Opcode::GetGEFromOp, {result});
|
|
|
|
return {result, ge};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndGE A32IREmitter::PackedSubAddU16(const Value& a, const Value& b) {
|
2017-03-24 15:56:24 +00:00
|
|
|
auto result = Inst(Opcode::PackedSubAddU16, {a, b});
|
|
|
|
auto ge = Inst(Opcode::GetGEFromOp, {result});
|
|
|
|
return {result, ge};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
A32IREmitter::ResultAndGE A32IREmitter::PackedSubAddS16(const Value& a, const Value& b) {
|
2017-03-24 15:56:24 +00:00
|
|
|
auto result = Inst(Opcode::PackedSubAddS16, {a, b});
|
|
|
|
auto ge = Inst(Opcode::GetGEFromOp, {result});
|
|
|
|
return {result, ge};
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedHalvingAddU8(const Value& a, const Value& b) {
|
2016-11-26 18:12:29 +00:00
|
|
|
return Inst(Opcode::PackedHalvingAddU8, {a, b});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedHalvingAddS8(const Value& a, const Value& b) {
|
2016-11-26 18:12:29 +00:00
|
|
|
return Inst(Opcode::PackedHalvingAddS8, {a, b});
|
2016-11-25 20:32:22 +00:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedHalvingSubU8(const Value& a, const Value& b) {
|
2016-11-26 18:27:21 +00:00
|
|
|
return Inst(Opcode::PackedHalvingSubU8, {a, b});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedHalvingSubS8(const Value& a, const Value& b) {
|
2016-12-22 12:02:24 +00:00
|
|
|
return Inst(Opcode::PackedHalvingSubS8, {a, b});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedHalvingAddU16(const Value& a, const Value& b) {
|
2016-11-26 11:28:20 +00:00
|
|
|
return Inst(Opcode::PackedHalvingAddU16, {a, b});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedHalvingAddS16(const Value& a, const Value& b) {
|
2016-11-26 18:12:29 +00:00
|
|
|
return Inst(Opcode::PackedHalvingAddS16, {a, b});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedHalvingSubU16(const Value& a, const Value& b) {
|
2016-11-26 18:27:21 +00:00
|
|
|
return Inst(Opcode::PackedHalvingSubU16, {a, b});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedHalvingSubS16(const Value& a, const Value& b) {
|
2016-12-22 12:02:24 +00:00
|
|
|
return Inst(Opcode::PackedHalvingSubS16, {a, b});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedHalvingAddSubU16(const Value& a, const Value& b) {
|
2017-03-24 15:56:24 +00:00
|
|
|
return Inst(Opcode::PackedHalvingAddSubU16, {a, b});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedHalvingAddSubS16(const Value& a, const Value& b) {
|
2017-03-24 15:56:24 +00:00
|
|
|
return Inst(Opcode::PackedHalvingAddSubS16, {a, b});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedHalvingSubAddU16(const Value& a, const Value& b) {
|
2017-03-24 15:56:24 +00:00
|
|
|
return Inst(Opcode::PackedHalvingSubAddU16, {a, b});
|
2016-12-28 21:28:55 +00:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedHalvingSubAddS16(const Value& a, const Value& b) {
|
2017-03-24 15:56:24 +00:00
|
|
|
return Inst(Opcode::PackedHalvingSubAddS16, {a, b});
|
2016-12-28 21:28:55 +00:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedSaturatedAddU8(const Value& a, const Value& b) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::PackedSaturatedAddU8, {a, b});
|
2016-08-12 18:26:14 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedSaturatedAddS8(const Value& a, const Value& b) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::PackedSaturatedAddS8, {a, b});
|
2016-08-12 18:26:14 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedSaturatedSubU8(const Value& a, const Value& b) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::PackedSaturatedSubU8, {a, b});
|
2016-08-12 16:53:16 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedSaturatedSubS8(const Value& a, const Value& b) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::PackedSaturatedSubS8, {a, b});
|
2016-08-12 18:18:38 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedSaturatedAddU16(const Value& a, const Value& b) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::PackedSaturatedAddU16, {a, b});
|
2016-08-12 18:42:16 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedSaturatedAddS16(const Value& a, const Value& b) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::PackedSaturatedAddS16, {a, b});
|
2016-08-12 18:42:16 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedSaturatedSubU16(const Value& a, const Value& b) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::PackedSaturatedSubU16, {a, b});
|
2016-08-12 18:42:16 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedSaturatedSubS16(const Value& a, const Value& b) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::PackedSaturatedSubS16, {a, b});
|
2016-08-12 18:42:16 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedAbsDiffSumS8(const Value& a, const Value& b) {
|
2016-12-17 19:52:22 +00:00
|
|
|
return Inst(Opcode::PackedAbsDiffSumS8, {a, b});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::PackedSelect(const Value& ge, const Value& a, const Value& b) {
|
2017-11-25 16:33:48 +00:00
|
|
|
return Inst(Opcode::PackedSelect, {ge, a, b});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::TransferToFP32(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::TransferToFP32, {a});
|
2016-08-07 19:25:12 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::TransferToFP64(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::TransferToFP64, {a});
|
2016-08-07 19:25:12 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::TransferFromFP32(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::TransferFromFP32, {a});
|
2016-08-07 19:25:12 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::TransferFromFP64(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::TransferFromFP64, {a});
|
2016-08-07 19:25:12 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPAbs32(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPAbs32, {a});
|
2016-08-07 01:27:18 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPAbs64(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPAbs64, {a});
|
2016-08-07 01:27:18 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPAdd32(const Value& a, const Value& b, bool fpscr_controlled) {
|
2016-08-06 17:21:29 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPAdd32, {a, b});
|
2016-08-06 17:21:29 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPAdd64(const Value& a, const Value& b, bool fpscr_controlled) {
|
2016-08-06 17:21:29 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPAdd64, {a, b});
|
2016-08-06 17:21:29 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::FPCompare32(const Value& a, const Value& b, bool exc_on_qnan, bool fpscr_controlled) {
|
2016-11-26 11:17:16 +00:00
|
|
|
ASSERT(fpscr_controlled);
|
2017-11-22 17:45:37 +00:00
|
|
|
Inst(Opcode::FPCompare32, {a, b, Imm1(exc_on_qnan)});
|
2016-11-26 11:17:16 +00:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::FPCompare64(const Value& a, const Value& b, bool exc_on_qnan, bool fpscr_controlled) {
|
2016-11-26 11:17:16 +00:00
|
|
|
ASSERT(fpscr_controlled);
|
2017-11-22 17:45:37 +00:00
|
|
|
Inst(Opcode::FPCompare64, {a, b, Imm1(exc_on_qnan)});
|
2016-11-26 11:17:16 +00:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPDiv32(const Value& a, const Value& b, bool fpscr_controlled) {
|
2016-08-07 10:56:12 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPDiv32, {a, b});
|
2016-08-07 10:56:12 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPDiv64(const Value& a, const Value& b, bool fpscr_controlled) {
|
2016-08-07 10:56:12 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPDiv64, {a, b});
|
2016-08-07 10:56:12 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPMul32(const Value& a, const Value& b, bool fpscr_controlled) {
|
2016-08-07 10:21:14 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPMul32, {a, b});
|
2016-08-07 10:21:14 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPMul64(const Value& a, const Value& b, bool fpscr_controlled) {
|
2016-08-07 10:21:14 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPMul64, {a, b});
|
2016-08-07 10:21:14 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPNeg32(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPNeg32, {a});
|
2016-08-07 10:56:12 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPNeg64(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPNeg64, {a});
|
2016-08-07 10:56:12 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPSqrt32(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPSqrt32, {a});
|
2016-08-07 12:19:07 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPSqrt64(const Value& a) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPSqrt64, {a});
|
2016-08-07 12:19:07 +01:00
|
|
|
}
|
2016-08-07 10:56:12 +01:00
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPSub32(const Value& a, const Value& b, bool fpscr_controlled) {
|
2016-08-07 01:41:25 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPSub32, {a, b});
|
2016-08-07 01:41:25 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPSub64(const Value& a, const Value& b, bool fpscr_controlled) {
|
2016-08-07 01:41:25 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPSub64, {a, b});
|
2016-08-07 01:41:25 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPDoubleToSingle(const Value& a, bool fpscr_controlled) {
|
2016-08-23 22:04:46 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPDoubleToSingle, {a});
|
2016-08-23 22:04:46 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPSingleToDouble(const Value& a, bool fpscr_controlled) {
|
2016-08-23 22:04:46 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPSingleToDouble, {a});
|
2016-08-23 22:04:46 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPSingleToS32(const Value& a, bool round_towards_zero, bool fpscr_controlled) {
|
2016-08-23 22:04:46 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPSingleToS32, {a, Imm1(round_towards_zero)});
|
2016-08-23 22:04:46 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPSingleToU32(const Value& a, bool round_towards_zero, bool fpscr_controlled) {
|
2016-08-23 22:04:46 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPSingleToU32, {a, Imm1(round_towards_zero)});
|
2016-08-23 22:04:46 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPDoubleToS32(const Value& a, bool round_towards_zero, bool fpscr_controlled) {
|
2016-08-23 22:04:46 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPDoubleToS32, {a, Imm1(round_towards_zero)});
|
2016-08-23 22:04:46 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPDoubleToU32(const Value& a, bool round_towards_zero, bool fpscr_controlled) {
|
2016-08-23 22:04:46 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPDoubleToU32, {a, Imm1(round_towards_zero)});
|
2016-08-23 22:04:46 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPS32ToSingle(const Value& a, bool round_to_nearest, bool fpscr_controlled) {
|
2016-08-23 22:04:46 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPS32ToSingle, {a, Imm1(round_to_nearest)});
|
2016-08-23 22:04:46 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPU32ToSingle(const Value& a, bool round_to_nearest, bool fpscr_controlled) {
|
2016-08-23 22:04:46 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPU32ToSingle, {a, Imm1(round_to_nearest)});
|
2016-08-23 22:04:46 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPS32ToDouble(const Value& a, bool round_to_nearest, bool fpscr_controlled) {
|
2016-08-23 22:04:46 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPS32ToDouble, {a, Imm1(round_to_nearest)});
|
2016-08-23 22:04:46 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::FPU32ToDouble(const Value& a, bool round_to_nearest, bool fpscr_controlled) {
|
2016-08-23 22:04:46 +01:00
|
|
|
ASSERT(fpscr_controlled);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::FPU32ToDouble, {a, Imm1(round_to_nearest)});
|
2016-08-23 22:04:46 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::ClearExclusive() {
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::ClearExclusive, {});
|
TranslateArm: Implement CLREX, LDREX, LDREXB, LDREXD, LDREXH, STREX, STREXB, STREXD, STREXH, SWP, SWPB
2016-08-09 22:48:20 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::SetExclusive(const Value& vaddr, size_t byte_size) {
|
TranslateArm: Implement CLREX, LDREX, LDREXB, LDREXD, LDREXH, STREX, STREXB, STREXD, STREXH, SWP, SWPB
2016-08-09 22:48:20 +01:00
|
|
|
ASSERT(byte_size == 1 || byte_size == 2 || byte_size == 4 || byte_size == 8 || byte_size == 16);
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::SetExclusive, {vaddr, Imm8(u8(byte_size))});
|
TranslateArm: Implement CLREX, LDREX, LDREXB, LDREXD, LDREXH, STREX, STREXB, STREXD, STREXH, SWP, SWPB
2016-08-09 22:48:20 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::ReadMemory8(const Value& vaddr) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::ReadMemory8, {vaddr});
|
2016-07-11 22:43:53 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::ReadMemory16(const Value& vaddr) {
|
2016-08-25 17:36:42 +01:00
|
|
|
auto value = Inst(Opcode::ReadMemory16, {vaddr});
|
2016-08-01 20:03:13 +01:00
|
|
|
return current_location.EFlag() ? ByteReverseHalf(value) : value;
|
2016-07-11 22:43:53 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::ReadMemory32(const Value& vaddr) {
|
2016-08-25 17:36:42 +01:00
|
|
|
auto value = Inst(Opcode::ReadMemory32, {vaddr});
|
2016-08-01 20:03:13 +01:00
|
|
|
return current_location.EFlag() ? ByteReverseWord(value) : value;
|
2016-07-11 22:43:53 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::ReadMemory64(const Value& vaddr) {
|
2016-08-25 17:36:42 +01:00
|
|
|
auto value = Inst(Opcode::ReadMemory64, {vaddr});
|
2016-08-01 20:03:13 +01:00
|
|
|
return current_location.EFlag() ? ByteReverseDual(value) : value;
|
2016-07-11 22:43:53 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::WriteMemory8(const Value& vaddr, const Value& value) {
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::WriteMemory8, {vaddr, value});
|
2016-07-11 22:43:53 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::WriteMemory16(const Value& vaddr, const Value& value) {
|
2016-08-01 20:03:13 +01:00
|
|
|
if (current_location.EFlag()) {
|
2016-07-22 23:55:00 +01:00
|
|
|
auto v = ByteReverseHalf(value);
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::WriteMemory16, {vaddr, v});
|
2016-07-22 23:55:00 +01:00
|
|
|
} else {
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::WriteMemory16, {vaddr, value});
|
2016-07-20 15:34:17 +01:00
|
|
|
}
|
2016-07-11 22:43:53 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::WriteMemory32(const Value& vaddr, const Value& value) {
|
2016-08-01 20:03:13 +01:00
|
|
|
if (current_location.EFlag()) {
|
2016-07-22 23:55:00 +01:00
|
|
|
auto v = ByteReverseWord(value);
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::WriteMemory32, {vaddr, v});
|
2016-07-22 23:55:00 +01:00
|
|
|
} else {
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::WriteMemory32, {vaddr, value});
|
2016-07-20 15:34:17 +01:00
|
|
|
}
|
2016-07-11 22:43:53 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::WriteMemory64(const Value& vaddr, const Value& value) {
|
2016-08-01 20:03:13 +01:00
|
|
|
if (current_location.EFlag()) {
|
2016-07-22 23:55:00 +01:00
|
|
|
auto v = ByteReverseDual(value);
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::WriteMemory64, {vaddr, v});
|
2016-07-22 23:55:00 +01:00
|
|
|
} else {
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::WriteMemory64, {vaddr, value});
|
2016-07-20 15:34:17 +01:00
|
|
|
}
|
2016-07-11 22:43:53 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::ExclusiveWriteMemory8(const Value& vaddr, const Value& value) {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::ExclusiveWriteMemory8, {vaddr, value});
|
TranslateArm: Implement CLREX, LDREX, LDREXB, LDREXD, LDREXH, STREX, STREXB, STREXD, STREXH, SWP, SWPB
2016-08-09 22:48:20 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::ExclusiveWriteMemory16(const Value& vaddr, const Value& value) {
|
TranslateArm: Implement CLREX, LDREX, LDREXB, LDREXD, LDREXH, STREX, STREXB, STREXD, STREXH, SWP, SWPB
2016-08-09 22:48:20 +01:00
|
|
|
if (current_location.EFlag()) {
|
|
|
|
auto v = ByteReverseHalf(value);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::ExclusiveWriteMemory16, {vaddr, v});
|
TranslateArm: Implement CLREX, LDREX, LDREXB, LDREXD, LDREXH, STREX, STREXB, STREXD, STREXH, SWP, SWPB
2016-08-09 22:48:20 +01:00
|
|
|
} else {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::ExclusiveWriteMemory16, {vaddr, value});
|
TranslateArm: Implement CLREX, LDREX, LDREXB, LDREXD, LDREXH, STREX, STREXB, STREXD, STREXH, SWP, SWPB
2016-08-09 22:48:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::ExclusiveWriteMemory32(const Value& vaddr, const Value& value) {
|
TranslateArm: Implement CLREX, LDREX, LDREXB, LDREXD, LDREXH, STREX, STREXB, STREXD, STREXH, SWP, SWPB
2016-08-09 22:48:20 +01:00
|
|
|
if (current_location.EFlag()) {
|
|
|
|
auto v = ByteReverseWord(value);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::ExclusiveWriteMemory32, {vaddr, v});
|
TranslateArm: Implement CLREX, LDREX, LDREXB, LDREXD, LDREXH, STREX, STREXB, STREXD, STREXH, SWP, SWPB
2016-08-09 22:48:20 +01:00
|
|
|
} else {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::ExclusiveWriteMemory32, {vaddr, value});
|
TranslateArm: Implement CLREX, LDREX, LDREXB, LDREXD, LDREXH, STREX, STREXB, STREXD, STREXH, SWP, SWPB
2016-08-09 22:48:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::ExclusiveWriteMemory64(const Value& vaddr, const Value& value_lo, const Value& value_hi) {
|
TranslateArm: Implement CLREX, LDREX, LDREXB, LDREXD, LDREXH, STREX, STREXB, STREXD, STREXH, SWP, SWPB
2016-08-09 22:48:20 +01:00
|
|
|
if (current_location.EFlag()) {
|
|
|
|
auto vlo = ByteReverseWord(value_lo);
|
|
|
|
auto vhi = ByteReverseWord(value_hi);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::ExclusiveWriteMemory64, {vaddr, vlo, vhi});
|
TranslateArm: Implement CLREX, LDREX, LDREXB, LDREXD, LDREXH, STREX, STREXB, STREXD, STREXH, SWP, SWPB
2016-08-09 22:48:20 +01:00
|
|
|
} else {
|
2016-08-25 17:36:42 +01:00
|
|
|
return Inst(Opcode::ExclusiveWriteMemory64, {vaddr, value_lo, value_hi});
|
TranslateArm: Implement CLREX, LDREX, LDREXB, LDREXD, LDREXH, STREX, STREXB, STREXD, STREXH, SWP, SWPB
2016-08-09 22:48:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::CoprocInternalOperation(size_t coproc_no, bool two, size_t opc1, A32::CoprocReg CRd, A32::CoprocReg CRn, A32::CoprocReg CRm, size_t opc2) {
|
2016-12-31 11:17:47 +00:00
|
|
|
ASSERT(coproc_no <= 15);
|
|
|
|
std::array<u8, 8> coproc_info{static_cast<u8>(coproc_no),
|
|
|
|
static_cast<u8>(two ? 1 : 0),
|
|
|
|
static_cast<u8>(opc1),
|
|
|
|
static_cast<u8>(CRd),
|
|
|
|
static_cast<u8>(CRn),
|
|
|
|
static_cast<u8>(CRm),
|
|
|
|
static_cast<u8>(opc2)};
|
|
|
|
Inst(Opcode::CoprocInternalOperation, {Value(coproc_info)});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::CoprocSendOneWord(size_t coproc_no, bool two, size_t opc1, A32::CoprocReg CRn, A32::CoprocReg CRm, size_t opc2, const Value& word) {
|
2016-12-31 11:17:47 +00:00
|
|
|
ASSERT(coproc_no <= 15);
|
|
|
|
std::array<u8, 8> coproc_info{static_cast<u8>(coproc_no),
|
|
|
|
static_cast<u8>(two ? 1 : 0),
|
|
|
|
static_cast<u8>(opc1),
|
|
|
|
static_cast<u8>(CRn),
|
|
|
|
static_cast<u8>(CRm),
|
|
|
|
static_cast<u8>(opc2)};
|
|
|
|
Inst(Opcode::CoprocSendOneWord, {Value(coproc_info), word});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::CoprocSendTwoWords(size_t coproc_no, bool two, size_t opc, A32::CoprocReg CRm, const Value& word1, const Value& word2) {
|
2016-12-31 11:17:47 +00:00
|
|
|
ASSERT(coproc_no <= 15);
|
|
|
|
std::array<u8, 8> coproc_info{static_cast<u8>(coproc_no),
|
|
|
|
static_cast<u8>(two ? 1 : 0),
|
|
|
|
static_cast<u8>(opc),
|
|
|
|
static_cast<u8>(CRm)};
|
|
|
|
Inst(Opcode::CoprocSendTwoWords, {Value(coproc_info), word1, word2});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::CoprocGetOneWord(size_t coproc_no, bool two, size_t opc1, A32::CoprocReg CRn, A32::CoprocReg CRm, size_t opc2) {
|
2016-12-31 11:17:47 +00:00
|
|
|
ASSERT(coproc_no <= 15);
|
|
|
|
std::array<u8, 8> coproc_info{static_cast<u8>(coproc_no),
|
|
|
|
static_cast<u8>(two ? 1 : 0),
|
|
|
|
static_cast<u8>(opc1),
|
|
|
|
static_cast<u8>(CRn),
|
|
|
|
static_cast<u8>(CRm),
|
|
|
|
static_cast<u8>(opc2)};
|
|
|
|
return Inst(Opcode::CoprocGetOneWord, {Value(coproc_info)});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::CoprocGetTwoWords(size_t coproc_no, bool two, size_t opc, A32::CoprocReg CRm) {
|
2016-12-31 11:17:47 +00:00
|
|
|
ASSERT(coproc_no <= 15);
|
|
|
|
std::array<u8, 8> coproc_info{static_cast<u8>(coproc_no),
|
|
|
|
static_cast<u8>(two ? 1 : 0),
|
|
|
|
static_cast<u8>(opc),
|
|
|
|
static_cast<u8>(CRm)};
|
|
|
|
return Inst(Opcode::CoprocGetTwoWords, {Value(coproc_info)});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::CoprocLoadWords(size_t coproc_no, bool two, bool long_transfer, A32::CoprocReg CRd, const Value& address, bool has_option, u8 option) {
|
2016-12-31 11:17:47 +00:00
|
|
|
ASSERT(coproc_no <= 15);
|
|
|
|
std::array<u8, 8> coproc_info{static_cast<u8>(coproc_no),
|
|
|
|
static_cast<u8>(two ? 1 : 0),
|
|
|
|
static_cast<u8>(long_transfer ? 1 : 0),
|
|
|
|
static_cast<u8>(CRd),
|
|
|
|
static_cast<u8>(has_option ? 1 : 0),
|
|
|
|
static_cast<u8>(option)};
|
|
|
|
Inst(Opcode::CoprocLoadWords, {Value(coproc_info), address});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::CoprocStoreWords(size_t coproc_no, bool two, bool long_transfer, A32::CoprocReg CRd, const Value& address, bool has_option, u8 option) {
|
2016-12-31 11:17:47 +00:00
|
|
|
ASSERT(coproc_no <= 15);
|
|
|
|
std::array<u8, 8> coproc_info{static_cast<u8>(coproc_no),
|
|
|
|
static_cast<u8>(two ? 1 : 0),
|
|
|
|
static_cast<u8>(long_transfer ? 1 : 0),
|
|
|
|
static_cast<u8>(CRd),
|
|
|
|
static_cast<u8>(has_option ? 1 : 0),
|
|
|
|
static_cast<u8>(option)};
|
|
|
|
Inst(Opcode::CoprocStoreWords, {Value(coproc_info), address});
|
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::Breakpoint() {
|
2016-08-25 17:36:42 +01:00
|
|
|
Inst(Opcode::Breakpoint, {});
|
2016-08-05 14:07:27 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
void A32IREmitter::SetTerm(const Terminal& terminal) {
|
2016-08-25 15:35:50 +01:00
|
|
|
block.SetTerminal(terminal);
|
2016-07-07 10:53:09 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 15:23:56 +00:00
|
|
|
Value A32IREmitter::Inst(Opcode op, std::initializer_list<Value> args) {
|
2016-08-25 15:35:50 +01:00
|
|
|
block.AppendNewInst(op, args);
|
2016-08-25 17:36:42 +01:00
|
|
|
return Value(&block.back());
|
2016-07-01 14:01:06 +01:00
|
|
|
}
|
|
|
|
|
2016-08-25 17:36:42 +01:00
|
|
|
} // namespace IR
|
2016-07-01 14:01:06 +01:00
|
|
|
} // namespace Dynarmic
|