All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: peter.maydell@linaro.org
Cc: agraf@suse.de, qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	thuth@redhat.com, lvivier@redhat.com, mdroth@linux.vnet.ibm.com,
	aik@ozlabs.ru, Bharata B Rao <bharata@linux.vnet.ibm.com>,
	Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PULL 065/107] target-ppc: Add xscvqpdp instruction
Date: Thu,  2 Feb 2017 16:14:03 +1100	[thread overview]
Message-ID: <20170202051445.5735-66-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20170202051445.5735-1-david@gibson.dropbear.id.au>

From: Bharata B Rao <bharata@linux.vnet.ibm.com>

xscvqpdp:  VSX Scalar round & Convert Quad-Precision format to
           Double-Precision format

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 target/ppc/fpu_helper.c             | 28 ++++++++++++++++++++++++++++
 target/ppc/helper.h                 |  1 +
 target/ppc/translate/vsx-impl.inc.c |  1 +
 target/ppc/translate/vsx-ops.inc.c  |  1 +
 4 files changed, 31 insertions(+)

diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c
index 16397ef..8c8e3c5 100644
--- a/target/ppc/fpu_helper.c
+++ b/target/ppc/fpu_helper.c
@@ -2778,6 +2778,34 @@ void helper_##op(CPUPPCState *env, uint32_t opcode)                \
 VSX_CVT_FP_TO_FP_HP(xscvdphp, float64, float16, VsrD(0), VsrH(3))
 VSX_CVT_FP_TO_FP_HP(xscvhpdp, float16, float64, VsrH(3), VsrD(0))
 
+/*
+ * xscvqpdp isn't using VSX_CVT_FP_TO_FP() because xscvqpdpo will be
+ * added to this later.
+ */
+void helper_xscvqpdp(CPUPPCState *env, uint32_t opcode)
+{
+    ppc_vsr_t xt, xb;
+
+    getVSR(rB(opcode) + 32, &xb, env);
+    getVSR(rD(opcode) + 32, &xt, env);
+
+    if (unlikely(Rc(opcode) != 0)) {
+        /* TODO: Support xscvqpdpo after round-to-odd is implemented */
+        abort();
+    }
+
+    xt.VsrD(0) = float128_to_float64(xb.f128, &env->fp_status);
+    if (unlikely(float128_is_signaling_nan(xb.f128,
+                                           &env->fp_status))) {
+        float_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN, 0);
+        xt.VsrD(0) = float64_snan_to_qnan(xt.VsrD(0));
+    }
+    helper_compute_fprf_float64(env, xt.VsrD(0));
+
+    putVSR(rD(opcode) + 32, &xt, env);
+    float_check_status(env);
+}
+
 uint64_t helper_xscvdpspn(CPUPPCState *env, uint64_t xb)
 {
     float_status tstat = env->fp_status;
diff --git a/target/ppc/helper.h b/target/ppc/helper.h
index d185eb0..ec0ae8a 100644
--- a/target/ppc/helper.h
+++ b/target/ppc/helper.h
@@ -428,6 +428,7 @@ DEF_HELPER_2(xscvdphp, void, env, i32)
 DEF_HELPER_2(xscvdpqp, void, env, i32)
 DEF_HELPER_2(xscvdpsp, void, env, i32)
 DEF_HELPER_2(xscvdpspn, i64, env, i64)
+DEF_HELPER_2(xscvqpdp, void, env, i32)
 DEF_HELPER_2(xscvhpdp, void, env, i32)
 DEF_HELPER_2(xscvspdp, void, env, i32)
 DEF_HELPER_2(xscvspdpn, i64, env, i64)
diff --git a/target/ppc/translate/vsx-impl.inc.c b/target/ppc/translate/vsx-impl.inc.c
index 01b5621..2d9fe50 100644
--- a/target/ppc/translate/vsx-impl.inc.c
+++ b/target/ppc/translate/vsx-impl.inc.c
@@ -810,6 +810,7 @@ GEN_VSX_HELPER_2(xscvdphp, 0x16, 0x15, 0x11, PPC2_ISA300)
 GEN_VSX_HELPER_2(xscvdpsp, 0x12, 0x10, 0, PPC2_VSX)
 GEN_VSX_HELPER_2(xscvdpqp, 0x04, 0x1A, 0x16, PPC2_ISA300)
 GEN_VSX_HELPER_XT_XB_ENV(xscvdpspn, 0x16, 0x10, 0, PPC2_VSX207)
+GEN_VSX_HELPER_2(xscvqpdp, 0x04, 0x1A, 0x14, PPC2_ISA300)
 GEN_VSX_HELPER_2(xscvhpdp, 0x16, 0x15, 0x10, PPC2_ISA300)
 GEN_VSX_HELPER_2(xscvspdp, 0x12, 0x14, 0, PPC2_VSX)
 GEN_VSX_HELPER_XT_XB_ENV(xscvspdpn, 0x16, 0x14, 0, PPC2_VSX207)
diff --git a/target/ppc/translate/vsx-ops.inc.c b/target/ppc/translate/vsx-ops.inc.c
index e75ecd1..aeeaff2 100644
--- a/target/ppc/translate/vsx-ops.inc.c
+++ b/target/ppc/translate/vsx-ops.inc.c
@@ -113,6 +113,7 @@ GEN_VSX_XFORM_300_EO(xsnabsqp, 0x04, 0x19, 0x08, 0x00000001),
 GEN_VSX_XFORM_300_EO(xsnegqp, 0x04, 0x19, 0x10, 0x00000001),
 GEN_VSX_XFORM_300(xscpsgnqp, 0x04, 0x03, 0x00000001),
 GEN_VSX_XFORM_300_EO(xscvdpqp, 0x04, 0x1A, 0x16, 0x00000001),
+GEN_VSX_XFORM_300_EO(xscvqpdp, 0x04, 0x1A, 0x14, 0x0),
 
 #ifdef TARGET_PPC64
 GEN_XX2FORM_EO(xsxexpdp, 0x16, 0x15, 0x00, PPC2_ISA300),
-- 
2.9.3

  parent reply	other threads:[~2017-02-02  5:15 UTC|newest]

Thread overview: 130+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-02  5:12 [Qemu-devel] [PULL 000/107] ppc-for-2.9 queue 20170202 David Gibson
2017-02-02  5:12 ` [Qemu-devel] [PULL 001/107] disas/ppc: Fix indefinite articles in comments David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 002/107] target-ppc: Consolidate instruction decode helpers David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 003/107] target-ppc: rename CRF_* defines as CRF_*_BIT David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 004/107] target-ppc: Fix xscmpodp and xscmpudp instructions David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 005/107] target-ppc: Add xscmpexp[dp, qp] instructions David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 006/107] target-ppc: Add xscmpoqp and xscmpuqp instructions David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 007/107] target-ppc: implement lxsd and lxssp instructions David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 008/107] target-ppc: implement stxsd and stxssp David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 009/107] target-ppc: implement lxv/lxvx and stxv/stxvx David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 010/107] target-ppc: Implement bcdcfsq. instruction David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 011/107] target-ppc: Implement bcdctsq. instruction David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 012/107] target-ppc: Implement bcdcpsgn. instruction David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 013/107] target-ppc: Implement bcdsetsgn. instruction David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 014/107] target-ppc: add vextu[bhw][lr]x instructions David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 015/107] pseries: Always use core objects for CPU construction David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 016/107] pseries: Make cpu_update during CAS unconditional David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 017/107] ppc: Clean up and QOMify hypercall emulation David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 018/107] ppc: Rename cpu_version to compat_pvr David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 019/107] ppc/spapr: implement H_SIGNAL_SYS_RESET David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 020/107] target-ppc: move ppc_vsr_t to common header David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 021/107] target-ppc: implement stop instruction David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 022/107] target-ppc: implement xsabsqp/xsnabsqp instruction David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 023/107] target-ppc: Implement bcd_is_valid function David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 024/107] target-ppc: implement xsnegqp instruction David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 025/107] target-ppc: implement xscpsgnqp instruction David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 026/107] target-ppc: Add xxperm and xxpermr instructions David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 027/107] target-ppc: implement lxvl instruction David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 028/107] target-ppc: implement lxvll instruction David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 029/107] target-ppc: implement stxvl instruction David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 030/107] target-ppc: implement stxvll instructions David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 031/107] hw/ppc/spapr: Fix boot path of usb-host storage devices David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 032/107] prep: do not use global variable to access nvram David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 033/107] pseries: Add pseries-2.9 machine type David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 034/107] ppc: Rewrite ppc_set_compat() David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 035/107] ppc: Rewrite ppc_get_compat_smt_threads() David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 036/107] ppc: Validate compatibility modes when setting David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 037/107] qtest: add netfilter tests for ppc64 David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 038/107] qtest: add display-vga-test to ppc64 David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 039/107] libqos: fix spapr qpci_map() David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 040/107] qtest: convert ivshmem-test to use libqos David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 041/107] qtest: add ivshmem-test for ppc64 David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 042/107] hw/gpio: QOM'ify mpc8xxx.c David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 043/107] hw/ppc: QOM'ify e500.c David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 044/107] hw/ppc: QOM'ify ppce500_spin.c David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 045/107] hw/ppc: QOM'ify spapr_vio.c David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 046/107] target-ppc: Add xxextractuw instruction David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 047/107] target-ppc: Add xxinsertw instruction David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 048/107] prep: add PReP System I/O David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 049/107] prep: add IBM RS/6000 7020 (40p) memory controller David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 050/107] prep: add IBM RS/6000 7020 (40p) machine emulation David Gibson
2017-02-12 21:15   ` Artyom Tarasenko
2017-02-18 22:31     ` Hervé Poussineau
2017-02-02  5:13 ` [Qemu-devel] [PULL 051/107] target-ppc: Use float64 arg in helper_compute_fprf() David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 052/107] target-ppc: Replace isden by float64_is_zero_or_denormal David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 053/107] target-ppc: Rename helper_compute_fprf to helper_compute_fprf_float64 David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 054/107] target-ppc: Add xscvdphp, xscvhpdp David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 055/107] target-ppc: Use correct precision for FPRF setting David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 056/107] target-ppc: Add xsxexpdp instruction David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 057/107] target-ppc: Add xsxexpqp instruction David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 058/107] target-ppc: Add xsxsigdp instruction David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 059/107] target-ppc: Add xsxsigqp instructions David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 060/107] pxb: Restrict to x86 David Gibson
2017-02-02  5:13 ` [Qemu-devel] [PULL 061/107] pseries: Rewrite CAS PVR compatibility logic David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 062/107] ppc: Add ppc_set_compat_all() David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 063/107] target-ppc: Add xsaddqp instructions David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 064/107] target-ppc: Add xscvdpqp instruction David Gibson
2017-02-02  5:14 ` David Gibson [this message]
2017-02-02  5:14 ` [Qemu-devel] [PULL 066/107] ppc: Prevent inifnite loop in decrementer auto-reload David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 067/107] ppc: Fix a warning in bcdcfz code and improve BCD_DIG_BYTE macro David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 068/107] target-ppc: xscvqpdp zero VSR David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 069/107] softfloat: Fix the default qNAN for target-ppc David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 070/107] host-utils: Move 128-bit guard macro to .c file David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 071/107] host-utils: Implement unsigned quadword left/right shift and unit tests David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 072/107] ppc: Implement bcds. instruction David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 073/107] ppc: Implement bcdus. instruction David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 074/107] ppc: Implement bcdsr. instruction David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 075/107] target-ppc: Add xsiexpdp instruction David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 076/107] target-ppc: Add xsiexpqp instruction David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 077/107] target-ppc: Add xviexpsp instruction David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 078/107] target-ppc: Add xviexpdp instruction David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 079/107] target-ppc: Add xvxexpsp instruction David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 080/107] target-ppc: Add xvxexpdp instruction David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 081/107] target-ppc: Add xvxsigsp instruction David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 082/107] target-ppc: Add xvxsigdp instruction David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 083/107] target-ppc: Add xscvqps[d, w]z instructions David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 084/107] ppc/prep: update MAINTAINERS file David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 085/107] ppc: Implement bcdtrunc. instruction David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 086/107] ppc: Implement bcdutrunc. instruction David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 087/107] target-ppc: Use ppc_vsr_t.f128 in xscmp[o, u, exp]qp David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 088/107] target-ppc: Add xscvsdqp and xscvudqp instructions David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 089/107] target-ppc: Add xsdivqp instruction David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 090/107] target-ppc: Add xsmulqp instruction David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 091/107] target-ppc: Add xvcv[hpsp, sphp] instructions David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 092/107] powerpc/cpu-models: rename ISAv3.00 logical PVR definition David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 093/107] target/ppc: Add pcr_supported to POWER9 cpu class definition David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 094/107] ppc: Remove unused function cpu_ppc601_rtc_init() David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 095/107] spapr: clock should count only if vm is running David Gibson
2017-02-02  8:37   ` Mark Cave-Ayland
2017-02-02  9:13     ` Laurent Vivier
2017-02-02 10:40       ` Mark Cave-Ayland
2017-02-02 14:20         ` Laurent Vivier
2017-02-02 15:50           ` Mark Cave-Ayland
2017-02-07 15:46             ` Laurent Vivier
2017-02-09 13:11               ` Mark Cave-Ayland
2017-02-09 14:36                 ` Laurent Vivier
2017-12-13 19:19   ` Alexander Graf
2017-12-13 19:29     ` Laurent Vivier
2017-12-13 19:33       ` Alexander Graf
2017-12-13 19:59       ` Alexander Graf
2017-12-14  7:33         ` Laurent Vivier
2017-12-18 10:17         ` Laurent Vivier
2017-02-02  5:14 ` [Qemu-devel] [PULL 096/107] target/ppc: Remove unused POWERPC_FAMILY(POWER) David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 097/107] target/ppc/cpu-models: Fix/remove bad CPU aliases David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 098/107] ppc: switch to constants within BUILD_BUG_ON David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 099/107] target-ppc: Add MMU model check for booke machines David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 100/107] target-ppc: Add xvtstdc[sp, dp] instructions David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 101/107] target-ppc: Add xststdc[sp, dp, qp] instructions David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 102/107] target/ppc/debug: Print LPCR register value if register exists David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 103/107] tcg/POWER9: NOOP the cp_abort instruction David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 104/107] target/ppc/mmu_hash64: Fix printing unsigned as signed int David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 105/107] target/ppc/mmu_hash64: Fix incorrect shift value in amr calculation David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 106/107] ppc/kvm: Handle the "family" CPU via alias instead of registering new types David Gibson
2017-02-02  5:14 ` [Qemu-devel] [PULL 107/107] hw/ppc/pnv: Use error_report instead of hw_error if a ROM file can't be found David Gibson
2017-02-02  7:41 ` [Qemu-devel] [PULL 000/107] ppc-for-2.9 queue 20170202 no-reply
2017-02-02 22:44   ` David Gibson
2017-02-03  8:36     ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
2017-02-03  9:46       ` Peter Maydell
2017-02-03 10:09         ` Thomas Huth
2017-02-03  9:43 ` [Qemu-devel] " Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170202051445.5735-66-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=lvivier@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=nikunj@linux.vnet.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.