|
Mark Wielaard |
b3eda9 |
commit 97d336b79e36f6c99d8b07f49ebc9b780e6df84e
|
|
Mark Wielaard |
b3eda9 |
Author: Julian Seward <jseward@acm.org>
|
|
Mark Wielaard |
b3eda9 |
Date: Tue Nov 20 11:07:37 2018 +0100
|
|
Mark Wielaard |
b3eda9 |
|
|
Mark Wielaard |
b3eda9 |
Add ppc host-side isel and instruction support for IROps added in previous commit.
|
|
Mark Wielaard |
b3eda9 |
|
|
Mark Wielaard |
b3eda9 |
VEX/priv/host_ppc_defs.c, VEX/priv/host_ppc_defs.h:
|
|
Mark Wielaard |
b3eda9 |
|
|
Mark Wielaard |
b3eda9 |
Dont emit cnttz{w,d}. We may need them on a target which doesn't support
|
|
Mark Wielaard |
b3eda9 |
them. Instead we can generate a fairly reasonable alternative sequence with
|
|
Mark Wielaard |
b3eda9 |
cntlz{w,d} instead.
|
|
Mark Wielaard |
b3eda9 |
|
|
Mark Wielaard |
b3eda9 |
Add support for emitting popcnt{w,d}.
|
|
Mark Wielaard |
b3eda9 |
|
|
Mark Wielaard |
b3eda9 |
VEX/priv/host_ppc_isel.c
|
|
Mark Wielaard |
b3eda9 |
|
|
Mark Wielaard |
b3eda9 |
Add support for: Iop_ClzNat32 Iop_ClzNat64
|
|
Mark Wielaard |
b3eda9 |
|
|
Mark Wielaard |
b3eda9 |
Redo support for: Iop_Ctz{32,64} and their Nat equivalents, so as to not use
|
|
Mark Wielaard |
b3eda9 |
cnttz{w,d}, as mentioned above.
|
|
Mark Wielaard |
b3eda9 |
|
|
Mark Wielaard |
b3eda9 |
Add support for: Iop_PopCount64 Iop_PopCount32 Iop_Reverse8sIn32_x1
|
|
Mark Wielaard |
b3eda9 |
|
|
Mark Wielaard |
b3eda9 |
diff --git a/VEX/priv/host_ppc_defs.c b/VEX/priv/host_ppc_defs.c
|
|
Mark Wielaard |
b3eda9 |
index b073c1d..f4b52e4 100644
|
|
Mark Wielaard |
b3eda9 |
--- a/VEX/priv/host_ppc_defs.c
|
|
Mark Wielaard |
b3eda9 |
+++ b/VEX/priv/host_ppc_defs.c
|
|
Mark Wielaard |
b3eda9 |
@@ -501,9 +501,9 @@ const HChar* showPPCUnaryOp ( PPCUnaryOp op ) {
|
|
Mark Wielaard |
b3eda9 |
case Pun_NEG: return "neg";
|
|
Mark Wielaard |
b3eda9 |
case Pun_CLZ32: return "cntlzw";
|
|
Mark Wielaard |
b3eda9 |
case Pun_CLZ64: return "cntlzd";
|
|
Mark Wielaard |
b3eda9 |
- case Pun_CTZ32: return "cnttzw";
|
|
Mark Wielaard |
b3eda9 |
- case Pun_CTZ64: return "cnttzd";
|
|
Mark Wielaard |
b3eda9 |
case Pun_EXTSW: return "extsw";
|
|
Mark Wielaard |
b3eda9 |
+ case Pun_POP32: return "popcntw";
|
|
Mark Wielaard |
b3eda9 |
+ case Pun_POP64: return "popcntd";
|
|
Mark Wielaard |
b3eda9 |
default: vpanic("showPPCUnaryOp");
|
|
Mark Wielaard |
b3eda9 |
}
|
|
Mark Wielaard |
b3eda9 |
}
|
|
Mark Wielaard |
b3eda9 |
@@ -4265,20 +4265,19 @@ Int emit_PPCInstr ( /*MB_MOD*/Bool* is_profInc,
|
|
Mark Wielaard |
b3eda9 |
vassert(mode64);
|
|
Mark Wielaard |
b3eda9 |
p = mkFormX(p, 31, r_src, r_dst, 0, 58, 0, endness_host);
|
|
Mark Wielaard |
b3eda9 |
break;
|
|
Mark Wielaard |
b3eda9 |
- case Pun_CTZ32: // cnttzw r_dst, r_src
|
|
Mark Wielaard |
b3eda9 |
- /* Note oder of src and dst is backwards from normal */
|
|
Mark Wielaard |
b3eda9 |
- p = mkFormX(p, 31, r_src, r_dst, 0, 538, 0, endness_host);
|
|
Mark Wielaard |
b3eda9 |
- break;
|
|
Mark Wielaard |
b3eda9 |
- case Pun_CTZ64: // cnttzd r_dst, r_src
|
|
Mark Wielaard |
b3eda9 |
- /* Note oder of src and dst is backwards from normal */
|
|
Mark Wielaard |
b3eda9 |
- vassert(mode64);
|
|
Mark Wielaard |
b3eda9 |
- p = mkFormX(p, 31, r_src, r_dst, 0, 570, 0, endness_host);
|
|
Mark Wielaard |
b3eda9 |
- break;
|
|
Mark Wielaard |
b3eda9 |
case Pun_EXTSW: // extsw r_dst, r_src
|
|
Mark Wielaard |
b3eda9 |
vassert(mode64);
|
|
Mark Wielaard |
b3eda9 |
p = mkFormX(p, 31, r_src, r_dst, 0, 986, 0, endness_host);
|
|
Mark Wielaard |
b3eda9 |
break;
|
|
Mark Wielaard |
b3eda9 |
- default: goto bad;
|
|
Mark Wielaard |
b3eda9 |
+ case Pun_POP32: // popcntw r_dst, r_src
|
|
Mark Wielaard |
b3eda9 |
+ p = mkFormX(p, 31, r_src, r_dst, 0, 378, 0, endness_host);
|
|
Mark Wielaard |
b3eda9 |
+ break;
|
|
Mark Wielaard |
b3eda9 |
+ case Pun_POP64: // popcntd r_dst, r_src
|
|
Mark Wielaard |
b3eda9 |
+ vassert(mode64);
|
|
Mark Wielaard |
b3eda9 |
+ p = mkFormX(p, 31, r_src, r_dst, 0, 506, 0, endness_host);
|
|
Mark Wielaard |
b3eda9 |
+ break;
|
|
Mark Wielaard |
b3eda9 |
+ default:
|
|
Mark Wielaard |
b3eda9 |
+ goto bad;
|
|
Mark Wielaard |
b3eda9 |
}
|
|
Mark Wielaard |
b3eda9 |
goto done;
|
|
Mark Wielaard |
b3eda9 |
}
|
|
Mark Wielaard |
b3eda9 |
diff --git a/VEX/priv/host_ppc_defs.h b/VEX/priv/host_ppc_defs.h
|
|
Mark Wielaard |
b3eda9 |
index 17baff5..321fba9 100644
|
|
Mark Wielaard |
b3eda9 |
--- a/VEX/priv/host_ppc_defs.h
|
|
Mark Wielaard |
b3eda9 |
+++ b/VEX/priv/host_ppc_defs.h
|
|
Mark Wielaard |
b3eda9 |
@@ -291,9 +291,9 @@ typedef
|
|
Mark Wielaard |
b3eda9 |
Pun_NOT,
|
|
Mark Wielaard |
b3eda9 |
Pun_CLZ32,
|
|
Mark Wielaard |
b3eda9 |
Pun_CLZ64,
|
|
Mark Wielaard |
b3eda9 |
- Pun_CTZ32,
|
|
Mark Wielaard |
b3eda9 |
- Pun_CTZ64,
|
|
Mark Wielaard |
b3eda9 |
- Pun_EXTSW
|
|
Mark Wielaard |
b3eda9 |
+ Pun_EXTSW,
|
|
Mark Wielaard |
b3eda9 |
+ Pun_POP32, // popcntw
|
|
Mark Wielaard |
b3eda9 |
+ Pun_POP64 // popcntd
|
|
Mark Wielaard |
b3eda9 |
}
|
|
Mark Wielaard |
b3eda9 |
PPCUnaryOp;
|
|
Mark Wielaard |
b3eda9 |
|
|
Mark Wielaard |
b3eda9 |
diff --git a/VEX/priv/host_ppc_isel.c b/VEX/priv/host_ppc_isel.c
|
|
Mark Wielaard |
b3eda9 |
index 6bdb5f7..5242176 100644
|
|
Mark Wielaard |
b3eda9 |
--- a/VEX/priv/host_ppc_isel.c
|
|
Mark Wielaard |
b3eda9 |
+++ b/VEX/priv/host_ppc_isel.c
|
|
Mark Wielaard |
b3eda9 |
@@ -2065,12 +2065,15 @@ static HReg iselWordExpr_R_wrk ( ISelEnv* env, const IRExpr* e,
|
|
Mark Wielaard |
b3eda9 |
return r_dst;
|
|
Mark Wielaard |
b3eda9 |
}
|
|
Mark Wielaard |
b3eda9 |
break;
|
|
Mark Wielaard |
b3eda9 |
- case Iop_Clz32:
|
|
Mark Wielaard |
b3eda9 |
- case Iop_Clz64: {
|
|
Mark Wielaard |
b3eda9 |
+
|
|
Mark Wielaard |
b3eda9 |
+ case Iop_Clz32: case Iop_ClzNat32:
|
|
Mark Wielaard |
b3eda9 |
+ case Iop_Clz64: case Iop_ClzNat64: {
|
|
Mark Wielaard |
b3eda9 |
+ // cntlz is available even in the most basic (earliest) ppc
|
|
Mark Wielaard |
b3eda9 |
+ // variants, so it's safe to generate it unconditionally.
|
|
Mark Wielaard |
b3eda9 |
HReg r_src, r_dst;
|
|
Mark Wielaard |
b3eda9 |
- PPCUnaryOp op_clz = (op_unop == Iop_Clz32) ? Pun_CLZ32 :
|
|
Mark Wielaard |
b3eda9 |
- Pun_CLZ64;
|
|
Mark Wielaard |
b3eda9 |
- if (op_unop == Iop_Clz64 && !mode64)
|
|
Mark Wielaard |
b3eda9 |
+ PPCUnaryOp op_clz = (op_unop == Iop_Clz32 || op_unop == Iop_ClzNat32)
|
|
Mark Wielaard |
b3eda9 |
+ ? Pun_CLZ32 : Pun_CLZ64;
|
|
Mark Wielaard |
b3eda9 |
+ if ((op_unop == Iop_Clz64 || op_unop == Iop_ClzNat64) && !mode64)
|
|
Mark Wielaard |
b3eda9 |
goto irreducible;
|
|
Mark Wielaard |
b3eda9 |
/* Count leading zeroes. */
|
|
Mark Wielaard |
b3eda9 |
r_dst = newVRegI(env);
|
|
Mark Wielaard |
b3eda9 |
@@ -2079,18 +2082,133 @@ static HReg iselWordExpr_R_wrk ( ISelEnv* env, const IRExpr* e,
|
|
Mark Wielaard |
b3eda9 |
return r_dst;
|
|
Mark Wielaard |
b3eda9 |
}
|
|
Mark Wielaard |
b3eda9 |
|
|
Mark Wielaard |
b3eda9 |
- case Iop_Ctz32:
|
|
Mark Wielaard |
b3eda9 |
- case Iop_Ctz64: {
|
|
Mark Wielaard |
b3eda9 |
- HReg r_src, r_dst;
|
|
Mark Wielaard |
b3eda9 |
- PPCUnaryOp op_clz = (op_unop == Iop_Ctz32) ? Pun_CTZ32 :
|
|
Mark Wielaard |
b3eda9 |
- Pun_CTZ64;
|
|
Mark Wielaard |
b3eda9 |
- if (op_unop == Iop_Ctz64 && !mode64)
|
|
Mark Wielaard |
b3eda9 |
- goto irreducible;
|
|
Mark Wielaard |
b3eda9 |
- /* Count trailing zeroes. */
|
|
Mark Wielaard |
b3eda9 |
- r_dst = newVRegI(env);
|
|
Mark Wielaard |
b3eda9 |
- r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess);
|
|
Mark Wielaard |
b3eda9 |
- addInstr(env, PPCInstr_Unary(op_clz,r_dst,r_src));
|
|
Mark Wielaard |
b3eda9 |
- return r_dst;
|
|
Mark Wielaard |
b3eda9 |
+ //case Iop_Ctz32:
|
|
Mark Wielaard |
b3eda9 |
+ case Iop_CtzNat32:
|
|
Mark Wielaard |
b3eda9 |
+ //case Iop_Ctz64:
|
|
Mark Wielaard |
b3eda9 |
+ case Iop_CtzNat64:
|
|
Mark Wielaard |
b3eda9 |
+ {
|
|
Mark Wielaard |
b3eda9 |
+ // Generate code using Clz, because we can't assume the host has
|
|
Mark Wielaard |
b3eda9 |
+ // Ctz. In particular, part of the fix for bug 386945 involves
|
|
Mark Wielaard |
b3eda9 |
+ // creating a Ctz in ir_opt.c from smaller fragments.
|
|
Mark Wielaard |
b3eda9 |
+ PPCUnaryOp op_clz = Pun_CLZ64;
|
|
Mark Wielaard |
b3eda9 |
+ Int WS = 64;
|
|
Mark Wielaard |
b3eda9 |
+ if (op_unop == Iop_Ctz32 || op_unop == Iop_CtzNat32) {
|
|
Mark Wielaard |
b3eda9 |
+ op_clz = Pun_CLZ32;
|
|
Mark Wielaard |
b3eda9 |
+ WS = 32;
|
|
Mark Wielaard |
b3eda9 |
+ }
|
|
Mark Wielaard |
b3eda9 |
+ /* Compute ctz(arg) = wordsize - clz(~arg & (arg - 1)), thusly:
|
|
Mark Wielaard |
b3eda9 |
+ t1 = arg - 1
|
|
Mark Wielaard |
b3eda9 |
+ t2 = not arg
|
|
Mark Wielaard |
b3eda9 |
+ t2 = t2 & t1
|
|
Mark Wielaard |
b3eda9 |
+ t2 = clz t2
|
|
Mark Wielaard |
b3eda9 |
+ t1 = WS
|
|
Mark Wielaard |
b3eda9 |
+ t2 = t1 - t2
|
|
Mark Wielaard |
b3eda9 |
+ // result in t2
|
|
Mark Wielaard |
b3eda9 |
+ */
|
|
Mark Wielaard |
b3eda9 |
+ HReg arg = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess);
|
|
Mark Wielaard |
b3eda9 |
+ HReg t1 = newVRegI(env);
|
|
Mark Wielaard |
b3eda9 |
+ HReg t2 = newVRegI(env);
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Alu(Palu_SUB, t1, arg, PPCRH_Imm(True, 1)));
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Unary(Pun_NOT, t2, arg));
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Alu(Palu_AND, t2, t2, PPCRH_Reg(t1)));
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Unary(op_clz, t2, t2));
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_LI(t1, WS, False/*!64-bit imm*/));
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Alu(Palu_SUB, t2, t1, PPCRH_Reg(t2)));
|
|
Mark Wielaard |
b3eda9 |
+ return t2;
|
|
Mark Wielaard |
b3eda9 |
+ }
|
|
Mark Wielaard |
b3eda9 |
+
|
|
Mark Wielaard |
b3eda9 |
+ case Iop_PopCount64: {
|
|
Mark Wielaard |
b3eda9 |
+ // popcnt{x,d} is only available in later arch revs (ISA 3.0,
|
|
Mark Wielaard |
b3eda9 |
+ // maybe) so it's not really correct to emit it here without a caps
|
|
Mark Wielaard |
b3eda9 |
+ // check for the host.
|
|
Mark Wielaard |
b3eda9 |
+ if (mode64) {
|
|
Mark Wielaard |
b3eda9 |
+ HReg r_dst = newVRegI(env);
|
|
Mark Wielaard |
b3eda9 |
+ HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess);
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Unary(Pun_POP64, r_dst, r_src));
|
|
Mark Wielaard |
b3eda9 |
+ return r_dst;
|
|
Mark Wielaard |
b3eda9 |
+ }
|
|
Mark Wielaard |
b3eda9 |
+ // We don't expect to be required to handle this in 32-bit mode.
|
|
Mark Wielaard |
b3eda9 |
+ break;
|
|
Mark Wielaard |
b3eda9 |
+ }
|
|
Mark Wielaard |
b3eda9 |
+
|
|
Mark Wielaard |
b3eda9 |
+ case Iop_PopCount32: {
|
|
Mark Wielaard |
b3eda9 |
+ // Similar comment as for Ctz just above applies -- we really
|
|
Mark Wielaard |
b3eda9 |
+ // should have a caps check here.
|
|
Mark Wielaard |
b3eda9 |
+
|
|
Mark Wielaard |
b3eda9 |
+ HReg r_dst = newVRegI(env);
|
|
Mark Wielaard |
b3eda9 |
+ // This actually generates popcntw, which in 64 bit mode does a
|
|
Mark Wielaard |
b3eda9 |
+ // 32-bit count individually for both low and high halves of the
|
|
Mark Wielaard |
b3eda9 |
+ // word. Per the comment at the top of iselIntExpr_R, in the 64
|
|
Mark Wielaard |
b3eda9 |
+ // bit mode case, the user of this result is required to ignore
|
|
Mark Wielaard |
b3eda9 |
+ // the upper 32 bits of the result. In 32 bit mode this is all
|
|
Mark Wielaard |
b3eda9 |
+ // moot. It is however unclear from the PowerISA 3.0 docs that
|
|
Mark Wielaard |
b3eda9 |
+ // the instruction exists in 32 bit mode; however our own front
|
|
Mark Wielaard |
b3eda9 |
+ // end (guest_ppc_toIR.c) accepts it, so I guess it does exist.
|
|
Mark Wielaard |
b3eda9 |
+ HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess);
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Unary(Pun_POP32, r_dst, r_src));
|
|
Mark Wielaard |
b3eda9 |
+ return r_dst;
|
|
Mark Wielaard |
b3eda9 |
+ }
|
|
Mark Wielaard |
b3eda9 |
+
|
|
Mark Wielaard |
b3eda9 |
+ case Iop_Reverse8sIn32_x1: {
|
|
Mark Wielaard |
b3eda9 |
+ // A bit of a mouthful, but simply .. 32-bit byte swap.
|
|
Mark Wielaard |
b3eda9 |
+ // This is pretty rubbish code. We could do vastly better if
|
|
Mark Wielaard |
b3eda9 |
+ // rotates, and better, rotate-inserts, were allowed. Note that
|
|
Mark Wielaard |
b3eda9 |
+ // even on a 64 bit target, the right shifts must be done as 32-bit
|
|
Mark Wielaard |
b3eda9 |
+ // so as to introduce zero bits in the right places. So it seems
|
|
Mark Wielaard |
b3eda9 |
+ // simplest to do the whole sequence in 32-bit insns.
|
|
Mark Wielaard |
b3eda9 |
+ /*
|
|
Mark Wielaard |
b3eda9 |
+ r = <argument> // working temporary, initial byte order ABCD
|
|
Mark Wielaard |
b3eda9 |
+ Mask = 00FF00FF
|
|
Mark Wielaard |
b3eda9 |
+ nMask = not Mask
|
|
Mark Wielaard |
b3eda9 |
+ tHi = and r, Mask
|
|
Mark Wielaard |
b3eda9 |
+ tHi = shl tHi, 8
|
|
Mark Wielaard |
b3eda9 |
+ tLo = and r, nMask
|
|
Mark Wielaard |
b3eda9 |
+ tLo = shr tLo, 8
|
|
Mark Wielaard |
b3eda9 |
+ r = or tHi, tLo // now r has order BADC
|
|
Mark Wielaard |
b3eda9 |
+ and repeat for 16 bit chunks ..
|
|
Mark Wielaard |
b3eda9 |
+ Mask = 0000FFFF
|
|
Mark Wielaard |
b3eda9 |
+ nMask = not Mask
|
|
Mark Wielaard |
b3eda9 |
+ tHi = and r, Mask
|
|
Mark Wielaard |
b3eda9 |
+ tHi = shl tHi, 16
|
|
Mark Wielaard |
b3eda9 |
+ tLo = and r, nMask
|
|
Mark Wielaard |
b3eda9 |
+ tLo = shr tLo, 16
|
|
Mark Wielaard |
b3eda9 |
+ r = or tHi, tLo // now r has order DCBA
|
|
Mark Wielaard |
b3eda9 |
+ */
|
|
Mark Wielaard |
b3eda9 |
+ HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess);
|
|
Mark Wielaard |
b3eda9 |
+ HReg rr = newVRegI(env);
|
|
Mark Wielaard |
b3eda9 |
+ HReg rMask = newVRegI(env);
|
|
Mark Wielaard |
b3eda9 |
+ HReg rnMask = newVRegI(env);
|
|
Mark Wielaard |
b3eda9 |
+ HReg rtHi = newVRegI(env);
|
|
Mark Wielaard |
b3eda9 |
+ HReg rtLo = newVRegI(env);
|
|
Mark Wielaard |
b3eda9 |
+ // Copy r_src since we need to modify it
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, mk_iMOVds_RR(rr, r_src));
|
|
Mark Wielaard |
b3eda9 |
+ // Swap within 16-bit lanes
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_LI(rMask, 0x00FF00FFULL,
|
|
Mark Wielaard |
b3eda9 |
+ False/* !64bit imm*/));
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Unary(Pun_NOT, rnMask, rMask));
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Alu(Palu_AND, rtHi, rr, PPCRH_Reg(rMask)));
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Shft(Pshft_SHL, True/*32 bit shift*/,
|
|
Mark Wielaard |
b3eda9 |
+ rtHi, rtHi,
|
|
Mark Wielaard |
b3eda9 |
+ PPCRH_Imm(False/*!signed imm*/, 8)));
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Alu(Palu_AND, rtLo, rr, PPCRH_Reg(rnMask)));
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Shft(Pshft_SHR, True/*32 bit shift*/,
|
|
Mark Wielaard |
b3eda9 |
+ rtLo, rtLo,
|
|
Mark Wielaard |
b3eda9 |
+ PPCRH_Imm(False/*!signed imm*/, 8)));
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Alu(Palu_OR, rr, rtHi, PPCRH_Reg(rtLo)));
|
|
Mark Wielaard |
b3eda9 |
+ // And now swap the two 16-bit chunks
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_LI(rMask, 0x0000FFFFULL,
|
|
Mark Wielaard |
b3eda9 |
+ False/* !64bit imm*/));
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Unary(Pun_NOT, rnMask, rMask));
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Alu(Palu_AND, rtHi, rr, PPCRH_Reg(rMask)));
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Shft(Pshft_SHL, True/*32 bit shift*/,
|
|
Mark Wielaard |
b3eda9 |
+ rtHi, rtHi,
|
|
Mark Wielaard |
b3eda9 |
+ PPCRH_Imm(False/*!signed imm*/, 16)));
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Alu(Palu_AND, rtLo, rr, PPCRH_Reg(rnMask)));
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Shft(Pshft_SHR, True/*32 bit shift*/,
|
|
Mark Wielaard |
b3eda9 |
+ rtLo, rtLo,
|
|
Mark Wielaard |
b3eda9 |
+ PPCRH_Imm(False/*!signed imm*/, 16)));
|
|
Mark Wielaard |
b3eda9 |
+ addInstr(env, PPCInstr_Alu(Palu_OR, rr, rtHi, PPCRH_Reg(rtLo)));
|
|
Mark Wielaard |
b3eda9 |
+ return rr;
|
|
Mark Wielaard |
b3eda9 |
}
|
|
Mark Wielaard |
b3eda9 |
|
|
Mark Wielaard |
b3eda9 |
case Iop_Left8:
|