mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
target-ppc: Introduce DFP Test Data Class
Add emulation of the PowerPC Decimal Floating Point Test Data Class instructions dtstdc[q][.]. Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
5833505be6
commit
e601c1eead
3 changed files with 34 additions and 0 deletions
|
@ -421,3 +421,31 @@ static void CMPO_PPs(struct PPC_DFP *dfp)
|
|||
|
||||
DFP_HELPER_BF_AB(dcmpo, decNumberCompare, CMPO_PPs, 64)
|
||||
DFP_HELPER_BF_AB(dcmpoq, decNumberCompare, CMPO_PPs, 128)
|
||||
|
||||
#define DFP_HELPER_TSTDC(op, size) \
|
||||
uint32_t helper_##op(CPUPPCState *env, uint64_t *a, uint32_t dcm) \
|
||||
{ \
|
||||
struct PPC_DFP dfp; \
|
||||
int match = 0; \
|
||||
\
|
||||
dfp_prepare_decimal##size(&dfp, a, 0, env); \
|
||||
\
|
||||
match |= (dcm & 0x20) && decNumberIsZero(&dfp.a); \
|
||||
match |= (dcm & 0x10) && decNumberIsSubnormal(&dfp.a, &dfp.context); \
|
||||
match |= (dcm & 0x08) && decNumberIsNormal(&dfp.a, &dfp.context); \
|
||||
match |= (dcm & 0x04) && decNumberIsInfinite(&dfp.a); \
|
||||
match |= (dcm & 0x02) && decNumberIsQNaN(&dfp.a); \
|
||||
match |= (dcm & 0x01) && decNumberIsSNaN(&dfp.a); \
|
||||
\
|
||||
if (decNumberIsNegative(&dfp.a)) { \
|
||||
dfp.crbf = match ? 0xA : 0x8; \
|
||||
} else { \
|
||||
dfp.crbf = match ? 0x2 : 0x0; \
|
||||
} \
|
||||
\
|
||||
dfp_set_FPCC_from_CRBF(&dfp); \
|
||||
return dfp.crbf; \
|
||||
}
|
||||
|
||||
DFP_HELPER_TSTDC(dtstdc, 64)
|
||||
DFP_HELPER_TSTDC(dtstdcq, 128)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue