[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 030/118] target-ppc: Introduce DFP Post Processor Uti
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PULL 030/118] target-ppc: Introduce DFP Post Processor Utilities |
Date: |
Wed, 4 Jun 2014 14:43:31 +0200 |
From: Tom Musta <address@hidden>
Add post-processing utilities to the PowerPC Decimal Floating Point
(DFP) helper code. Post-processors are small routines that execute
after a preliminary DFP result is computed. They are used, among other
things, to compute status bits.
This change defines a function type for post processors as well as a
generic routine to run a list (array) of post-processors.
Actual post-processor implementations will be added as needed by specific
DFP helpers in subsequent changes.
Some routines are annotated with the GCC unused attribute in order to
preserve build bisection. The annotation will be removed in subsequent
patches.
Signed-off-by: Tom Musta <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
target-ppc/dfp_helper.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/target-ppc/dfp_helper.c b/target-ppc/dfp_helper.c
index b4f0139..9e9bc57 100644
--- a/target-ppc/dfp_helper.c
+++ b/target-ppc/dfp_helper.c
@@ -130,3 +130,34 @@ static void dfp_prepare_decimal128(struct PPC_DFP *dfp,
uint64_t *a,
decNumberZero(&dfp->b);
}
}
+
+#define FP_FX (1ull << FPSCR_FX)
+#define FP_FEX (1ull << FPSCR_FEX)
+#define FP_OX (1ull << FPSCR_OX)
+#define FP_OE (1ull << FPSCR_OE)
+#define FP_UX (1ull << FPSCR_UX)
+#define FP_UE (1ull << FPSCR_UE)
+#define FP_XX (1ull << FPSCR_XX)
+#define FP_XE (1ull << FPSCR_XE)
+#define FP_ZX (1ull << FPSCR_ZX)
+#define FP_ZE (1ull << FPSCR_ZE)
+#define FP_VX (1ull << FPSCR_VX)
+#define FP_VXSNAN (1ull << FPSCR_VXSNAN)
+#define FP_VXISI (1ull << FPSCR_VXISI)
+#define FP_VXIMZ (1ull << FPSCR_VXIMZ)
+#define FP_VXZDZ (1ull << FPSCR_VXZDZ)
+#define FP_VXIDI (1ull << FPSCR_VXIDI)
+#define FP_VXVC (1ull << FPSCR_VXVC)
+#define FP_VXCVI (1ull << FPSCR_VXCVI)
+#define FP_VE (1ull << FPSCR_VE)
+#define FP_FI (1ull << FPSCR_FI)
+
+__attribute__ ((unused))
+static void dfp_set_FPSCR_flag(struct PPC_DFP *dfp, uint64_t flag,
+ uint64_t enabled)
+{
+ dfp->env->fpscr |= (flag | FP_FX);
+ if (dfp->env->fpscr & enabled) {
+ dfp->env->fpscr |= FP_FEX;
+ }
+}
--
1.8.1.4
- [Qemu-devel] [PULL 014/118] mac99: Added FW_CFG_PPC_BUSFREQ to match CLOCKFREQ and TBFREQ already there, (continued)
- [Qemu-devel] [PULL 014/118] mac99: Added FW_CFG_PPC_BUSFREQ to match CLOCKFREQ and TBFREQ already there, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 004/118] spapr_nvram: Correct max nvram size, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 011/118] spapr_pci: Fix number of returned vectors in ibm, change-msi, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 007/118] target-ppc: Create versionless CPU class per family if KVM, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 006/118] target-ppc: gdbstub allow byte swapping for reading/writing registers, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 013/118] target-ppc: Remove PVR check from migration, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 021/118] libdecnumber: Eliminate Unused Variable in decSetSubnormal, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 022/118] target-ppc: Enable Building of libdecnumber, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 019/118] libdecnumber: Change gstdint.h to stdint.h, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 012/118] target-ppc: Eliminate Magic Number MSR Masks, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 030/118] target-ppc: Introduce DFP Post Processor Utilities,
Alexander Graf <=
- [Qemu-devel] [PULL 025/118] libdecnumber: Fix decNumberSetBCD, Alexander Graf, 2014/06/04
- [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