mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
target/arm: Implement SVE floating-point trig select coefficient
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20180516223007.10256-22-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
0762cd428f
commit
a1f233f25f
4 changed files with 72 additions and 0 deletions
|
@ -23,6 +23,7 @@
|
|||
#include "exec/cpu_ldst.h"
|
||||
#include "exec/helper-proto.h"
|
||||
#include "tcg/tcg-gvec-desc.h"
|
||||
#include "fpu/softfloat.h"
|
||||
|
||||
|
||||
/* Note that vector data is stored in host-endian 64-bit chunks,
|
||||
|
@ -1192,3 +1193,45 @@ void HELPER(sve_fexpa_d)(void *vd, void *vn, uint32_t desc)
|
|||
d[i] = coeff[idx] | (exp << 52);
|
||||
}
|
||||
}
|
||||
|
||||
void HELPER(sve_ftssel_h)(void *vd, void *vn, void *vm, uint32_t desc)
|
||||
{
|
||||
intptr_t i, opr_sz = simd_oprsz(desc) / 2;
|
||||
uint16_t *d = vd, *n = vn, *m = vm;
|
||||
for (i = 0; i < opr_sz; i += 1) {
|
||||
uint16_t nn = n[i];
|
||||
uint16_t mm = m[i];
|
||||
if (mm & 1) {
|
||||
nn = float16_one;
|
||||
}
|
||||
d[i] = nn ^ (mm & 2) << 14;
|
||||
}
|
||||
}
|
||||
|
||||
void HELPER(sve_ftssel_s)(void *vd, void *vn, void *vm, uint32_t desc)
|
||||
{
|
||||
intptr_t i, opr_sz = simd_oprsz(desc) / 4;
|
||||
uint32_t *d = vd, *n = vn, *m = vm;
|
||||
for (i = 0; i < opr_sz; i += 1) {
|
||||
uint32_t nn = n[i];
|
||||
uint32_t mm = m[i];
|
||||
if (mm & 1) {
|
||||
nn = float32_one;
|
||||
}
|
||||
d[i] = nn ^ (mm & 2) << 30;
|
||||
}
|
||||
}
|
||||
|
||||
void HELPER(sve_ftssel_d)(void *vd, void *vn, void *vm, uint32_t desc)
|
||||
{
|
||||
intptr_t i, opr_sz = simd_oprsz(desc) / 8;
|
||||
uint64_t *d = vd, *n = vn, *m = vm;
|
||||
for (i = 0; i < opr_sz; i += 1) {
|
||||
uint64_t nn = n[i];
|
||||
uint64_t mm = m[i];
|
||||
if (mm & 1) {
|
||||
nn = float64_one;
|
||||
}
|
||||
d[i] = nn ^ (mm & 2) << 62;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue