[ARM] Update the ArmEmitter with a bunch of NEON emitters. This adds around 47 instruction emitters if I counted correctly. None well tested at this point. On going to add all the NEON emitters.

This commit is contained in:
Ryan Houdek
2013-10-08 10:16:42 +00:00
parent 4a0745799f
commit 7dd8deecec
2 changed files with 557 additions and 85 deletions

View File

@ -339,6 +339,12 @@ struct LiteralPool
typedef const u8* JumpTarget;
u32 EncodeVd(ARMReg Vd);
u32 EncodeVn(ARMReg Vn);
u32 EncodeVm(ARMReg Vm);
// Subtracts the base from the register to give us the real one
ARMReg SubBase(ARMReg Reg);
class ARMXEmitter
{
friend struct OpArg; // for Write8 etc
@ -355,9 +361,6 @@ private:
void WriteShiftedDataOp(u32 op, bool SetFlags, ARMReg dest, ARMReg src, Operand2 op2);
void WriteSignedMultiply(u32 Op, u32 Op2, u32 Op3, ARMReg dest, ARMReg r1, ARMReg r2);
u32 EncodeVd(ARMReg Vd);
u32 EncodeVn(ARMReg Vn);
u32 EncodeVm(ARMReg Vm);
void WriteVFPDataOp(u32 Op, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void WriteVFPDataOp6bit(u32 Op, ARMReg Vd, ARMReg Vn, ARMReg Vm, u32 bit6);
@ -530,9 +533,6 @@ public:
// None of these will be created with conditional since ARM
// is deprecating conditional execution of ASIMD instructions.
// ASIMD instructions don't even have a conditional encoding.
// Subtracts the base from the register to give us the real one
ARMReg SubBase(ARMReg Reg);
// VFP Only
void VLDR(ARMReg Dest, ARMReg Base, s16 offset);
@ -603,7 +603,6 @@ class NEONXEmitter
{
private:
ARMXEmitter *_emit;
ARMReg SubBase(ARMReg Reg) { return _emit->SubBase(Reg); }
inline void Write32(u32 value) { _emit->Write32(value); }
inline u32 encodedSize(u32 value)
@ -612,7 +611,7 @@ private:
return 0;
else if (value & I_16)
return 1;
else if (value & I_32)
else if ((value & I_32) || (value & F_32))
return 2;
else if (value & I_64)
return 3;
@ -628,8 +627,51 @@ public:
: _emit(emit)
{}
void VABA(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VABAL(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VABD(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VABDL(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VABS(NEONElementType Size, ARMReg Vd, ARMReg Vm);
void VACGE(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VACGT(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VACLE(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VACLT(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VADD(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VADDHN(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VADDL(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VADDW(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VAND(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VBIC(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VBIF(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VBIT(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VBSL(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VCEQ(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VCEQ(NEONElementType Size, ARMReg Vd, ARMReg Vm);
void VCGE(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VCGE(NEONElementType Size, ARMReg Vd, ARMReg Vm);
void VCGT(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VCGT(NEONElementType Size, ARMReg Vd, ARMReg Vm);
void VCLE(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VCLE(NEONElementType Size, ARMReg Vd, ARMReg Vm);
void VCLS(NEONElementType Size, ARMReg Vd, ARMReg Vm);
void VCLT(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VCLT(NEONElementType Size, ARMReg Vd, ARMReg Vm);
void VCLZ(NEONElementType Size, ARMReg Vd, ARMReg Vm);
void VCNT(NEONElementType Size, ARMReg Vd, ARMReg Vm);
void VDUP(NEONElementType Size, ARMReg Vd, ARMReg Vm, u8 index);
void VDUP(NEONElementType Size, ARMReg Vd, ARMReg Rt);
void VEOR(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VEXT(ARMReg Vd, ARMReg Vn, ARMReg Vm, u8 index);
void VFMA(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VFMS(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VHADD(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VHSUB(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VMAX(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VMIN(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VMLA(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VMLS(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VMLAL(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VMLSL(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VSUB(NEONElementType Size, ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VREV64(NEONElementType Size, ARMReg Vd, ARMReg Vm);
void VREV32(NEONElementType Size, ARMReg Vd, ARMReg Vm);
@ -637,7 +679,6 @@ public:
void VRSQRTE(NEONElementType Size, ARMReg Vd, ARMReg Vm);
void VEOR(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VORR(ARMReg Vd, ARMReg Vn, ARMReg Vm);
void VLD1(NEONElementType Size, ARMReg Vd, ARMReg Rn, NEONAlignment align = ALIGN_NONE, ARMReg Rm = _PC);