summaryrefslogtreecommitdiff
path: root/target-ppc/dfp_helper.c
diff options
context:
space:
mode:
authorTom Musta <tommusta@gmail.com>2014-04-21 15:55:02 -0500
committerAlexander Graf <agraf@suse.de>2014-06-16 13:24:30 +0200
commit2128f8a57e1f1db97b8ba03eae4d8e5d94bf1ea5 (patch)
treea62e3c75ff83d9cc9590020140732d7507d2a50f /target-ppc/dfp_helper.c
parenta9d7ba03b0fa8c7b6d660c6aafa736d16921728f (diff)
downloadqemu-2128f8a57e1f1db97b8ba03eae4d8e5d94bf1ea5.tar.gz
qemu-2128f8a57e1f1db97b8ba03eae4d8e5d94bf1ea5.tar.bz2
qemu-2128f8a57e1f1db97b8ba03eae4d8e5d94bf1ea5.zip
target-ppc: Introduce DFP Subtract
Add emulation of the PowerPC Decimal Floating Point Subtract instructions dsub[q][.] Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'target-ppc/dfp_helper.c')
-rw-r--r--target-ppc/dfp_helper.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/target-ppc/dfp_helper.c b/target-ppc/dfp_helper.c
index 9f4cd3321c..d6d0c2dc70 100644
--- a/target-ppc/dfp_helper.c
+++ b/target-ppc/dfp_helper.c
@@ -256,6 +256,11 @@ static void dfp_check_for_VXISI_add(struct PPC_DFP *dfp)
dfp_check_for_VXISI(dfp, 0);
}
+static void dfp_check_for_VXISI_subtract(struct PPC_DFP *dfp)
+{
+ dfp_check_for_VXISI(dfp, 1);
+}
+
#define DFP_HELPER_TAB(op, dnop, postprocs, size) \
void helper_##op(CPUPPCState *env, uint64_t *t, uint64_t *a, uint64_t *b) \
{ \
@@ -284,3 +289,16 @@ static void ADD_PPs(struct PPC_DFP *dfp)
DFP_HELPER_TAB(dadd, decNumberAdd, ADD_PPs, 64)
DFP_HELPER_TAB(daddq, decNumberAdd, ADD_PPs, 128)
+
+static void SUB_PPs(struct PPC_DFP *dfp)
+{
+ dfp_set_FPRF_from_FRT(dfp);
+ dfp_check_for_OX(dfp);
+ dfp_check_for_UX(dfp);
+ dfp_check_for_XX(dfp);
+ dfp_check_for_VXSNAN(dfp);
+ dfp_check_for_VXISI_subtract(dfp);
+}
+
+DFP_HELPER_TAB(dsub, decNumberSubtract, SUB_PPs, 64)
+DFP_HELPER_TAB(dsubq, decNumberSubtract, SUB_PPs, 128)