[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 032/118] target-ppc: Introduce DFP Subtract
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PULL 032/118] target-ppc: Introduce DFP Subtract |
Date: |
Wed, 4 Jun 2014 14:43:33 +0200 |
From: Tom Musta <address@hidden>
Add emulation of the PowerPC Decimal Floating Point Subtract instructions
dsub[q][.]
Signed-off-by: Tom Musta <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
target-ppc/dfp_helper.c | 18 ++++++++++++++++++
target-ppc/helper.h | 2 ++
target-ppc/translate.c | 5 ++++-
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/target-ppc/dfp_helper.c b/target-ppc/dfp_helper.c
index 9f4cd33..d6d0c2d 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)
diff --git a/target-ppc/helper.h b/target-ppc/helper.h
index 99e6198..d560e53 100644
--- a/target-ppc/helper.h
+++ b/target-ppc/helper.h
@@ -618,3 +618,5 @@ DEF_HELPER_3(store_601_batu, void, env, i32, tl)
DEF_HELPER_4(dadd, void, env, fprp, fprp, fprp)
DEF_HELPER_4(daddq, void, env, fprp, fprp, fprp)
+DEF_HELPER_4(dsub, void, env, fprp, fprp, fprp)
+DEF_HELPER_4(dsubq, void, env, fprp, fprp, fprp)
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index b65b848..d4077c2 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -8357,7 +8357,8 @@ static void gen_##name(DisasContext *ctx) \
GEN_DFP_T_A_B_Rc(dadd)
GEN_DFP_T_A_B_Rc(daddq)
-
+GEN_DFP_T_A_B_Rc(dsub)
+GEN_DFP_T_A_B_Rc(dsubq)
/*** SPE extension ***/
/* Register moves */
@@ -11287,6 +11288,8 @@ _GEN_DFP_QUADx2(name, op1, op2, 0x00210000)
GEN_DFP_T_A_B_Rc(dadd, 0x02, 0x00),
GEN_DFP_Tp_Ap_Bp_Rc(daddq, 0x02, 0x00),
+GEN_DFP_T_A_B_Rc(dsub, 0x02, 0x10),
+GEN_DFP_Tp_Ap_Bp_Rc(dsubq, 0x02, 0x10),
#undef GEN_SPE
#define GEN_SPE(name0, name1, opc2, opc3, inval0, inval1, type) \
GEN_OPCODE_DUAL(name0##_##name1, 0x04, opc2, opc3, inval0, inval1, type,
PPC_NONE)
--
1.8.1.4
- [Qemu-devel] [PULL 017/118] libdecnumber: Prepare libdecnumber for QEMU include structure, (continued)
- [Qemu-devel] [PULL 017/118] libdecnumber: Prepare libdecnumber for QEMU include structure, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 033/118] target-ppc: Introduce DFP Multiply, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 029/118] target-ppc: Introduce DFP Helper Utilities, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 020/118] libdecnumber: Eliminate redundant declarations, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 027/118] target-ppc: Introduce Generator Macros for DFP Arithmetic Forms, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 026/118] target-ppc: Define FPR Pointer Type for Helpers, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 023/118] libdecnumber: Introduce decNumberFrom[U]Int64, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 024/118] libdecnumber: Introduce decNumberIntegralToInt64, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 016/118] libdecnumber: Eliminate #include *Symbols.h, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 037/118] target-ppc: Introduce DFP Test Data Group, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 032/118] target-ppc: Introduce DFP Subtract,
Alexander Graf <=
- [Qemu-devel] [PULL 018/118] libdecnumber: Modify dconfig.h to Integrate with QEMU, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 031/118] target-ppc: Introduce DFP Add, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 028/118] target-ppc: Introduce Decoder Macros for DFP, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 035/118] target-ppc: Introduce DFP Compares, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 038/118] target-ppc: Introduce DFP Test Exponent, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 039/118] target-ppc: Introduce DFP Test Significance, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 045/118] target-ppc: Introduce DFP Convert to Fixed, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 043/118] target-ppc: Introduce DFP Convert to Long/Extended, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 036/118] target-ppc: Introduce DFP Test Data Class, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 040/118] target-ppc: Introduce DFP Quantize, Alexander Graf, 2014/06/04