diff options
author | Nikunj A Dadhania | 2017-01-10 09:50:41 +0100 |
---|---|---|
committer | David Gibson | 2017-01-31 00:10:14 +0100 |
commit | c5969d2eb17103d6c38c2d244d33ed2404210cd9 (patch) | |
tree | 871d5c46df0dff1831b13a19a4caf4c1905aa3a1 /target/ppc/fpu_helper.c | |
parent | target-ppc: Add xvxexpdp instruction (diff) | |
download | qemu-c5969d2eb17103d6c38c2d244d33ed2404210cd9.tar.gz qemu-c5969d2eb17103d6c38c2d244d33ed2404210cd9.tar.xz qemu-c5969d2eb17103d6c38c2d244d33ed2404210cd9.zip |
target-ppc: Add xvxsigsp instruction
xvxsigsp: VSX Vector Extract Significand Single Precision
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target/ppc/fpu_helper.c')
-rw-r--r-- | target/ppc/fpu_helper.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c index 77f68e9dcd..4da83d9272 100644 --- a/target/ppc/fpu_helper.c +++ b/target/ppc/fpu_helper.c @@ -3026,3 +3026,23 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \ VSX_XXPERM(xxperm, 0) VSX_XXPERM(xxpermr, 1) + +void helper_xvxsigsp(CPUPPCState *env, uint32_t opcode) +{ + ppc_vsr_t xt, xb; + uint32_t exp, i, fraction; + + getVSR(xB(opcode), &xb, env); + memset(&xt, 0, sizeof(xt)); + + for (i = 0; i < 4; i++) { + exp = (xb.VsrW(i) >> 23) & 0xFF; + fraction = xb.VsrW(i) & 0x7FFFFF; + if (exp != 0 && exp != 255) { + xt.VsrW(i) = fraction | 0x00800000; + } else { + xt.VsrW(i) = fraction; + } + } + putVSR(xT(opcode), &xt, env); +} |