diff options
author | David Hildenbrand <david@redhat.com> | 2021-06-08 11:23:21 +0200 |
---|---|---|
committer | Cornelia Huck <cohuck@redhat.com> | 2021-06-21 08:48:21 +0200 |
commit | 4da79375c2a368bb548266e90e3d600afc05d165 (patch) | |
tree | fec9c5f42576525fdfdfe6ce7dc322fab7e6773e /target | |
parent | 977e43d977c0b64a1b582cb4cc1c5711b5bc01a7 (diff) | |
download | qemu-4da79375c2a368bb548266e90e3d600afc05d165.zip qemu-4da79375c2a368bb548266e90e3d600afc05d165.tar.gz qemu-4da79375c2a368bb548266e90e3d600afc05d165.tar.bz2 |
s390x/tcg: Simplify wfc64() handling
... and prepare for 32/128 bit support.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210608092337.12221-11-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'target')
-rw-r--r-- | target/s390x/vec_fpu_helper.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c index 7ca9c89..4af59ea 100644 --- a/target/s390x/vec_fpu_helper.c +++ b/target/s390x/vec_fpu_helper.c @@ -201,8 +201,8 @@ static int wfc64(const S390Vector *v1, const S390Vector *v2, CPUS390XState *env, bool signal, uintptr_t retaddr) { /* only the zero-indexed elements are compared */ - const float64 a = s390_vec_read_element64(v1, 0); - const float64 b = s390_vec_read_element64(v2, 0); + const float64 a = s390_vec_read_float64(v1, 0); + const float64 b = s390_vec_read_float64(v2, 0); uint8_t vxc, vec_exc = 0; int cmp; @@ -217,17 +217,18 @@ static int wfc64(const S390Vector *v1, const S390Vector *v2, return float_comp_to_cc(env, cmp); } -void HELPER(gvec_wfc64)(const void *v1, const void *v2, CPUS390XState *env, - uint32_t desc) -{ - env->cc_op = wfc64(v1, v2, env, false, GETPC()); +#define DEF_GVEC_WFC_B(NAME, SIGNAL, BITS) \ +void HELPER(gvec_##NAME##BITS)(const void *v1, const void *v2, \ + CPUS390XState *env, uint32_t desc) \ +{ \ + env->cc_op = wfc##BITS(v1, v2, env, SIGNAL, GETPC()); \ } -void HELPER(gvec_wfk64)(const void *v1, const void *v2, CPUS390XState *env, - uint32_t desc) -{ - env->cc_op = wfc64(v1, v2, env, true, GETPC()); -} +#define DEF_GVEC_WFC(NAME, SIGNAL) \ + DEF_GVEC_WFC_B(NAME, SIGNAL, 64) + +DEF_GVEC_WFC(wfc, false) +DEF_GVEC_WFC(wfk, true) typedef bool (*vfc64_fn)(float64 a, float64 b, float_status *status); static int vfc64(S390Vector *v1, const S390Vector *v2, const S390Vector *v3, |