mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
target/arm: Implement FMOPA, FMOPS (non-widening)
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20220708151540.18136-25-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
bc4420d9bd
commit
558e956c71
4 changed files with 115 additions and 0 deletions
|
@ -25,6 +25,7 @@
|
|||
#include "exec/cpu_ldst.h"
|
||||
#include "exec/exec-all.h"
|
||||
#include "qemu/int128.h"
|
||||
#include "fpu/softfloat.h"
|
||||
#include "vec_internal.h"
|
||||
#include "sve_ldst_internal.h"
|
||||
|
||||
|
@ -918,3 +919,71 @@ void HELPER(sme_addva_d)(void *vzda, void *vzn, void *vpn,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HELPER(sme_fmopa_s)(void *vza, void *vzn, void *vzm, void *vpn,
|
||||
void *vpm, void *vst, uint32_t desc)
|
||||
{
|
||||
intptr_t row, col, oprsz = simd_maxsz(desc);
|
||||
uint32_t neg = simd_data(desc) << 31;
|
||||
uint16_t *pn = vpn, *pm = vpm;
|
||||
float_status fpst;
|
||||
|
||||
/*
|
||||
* Make a copy of float_status because this operation does not
|
||||
* update the cumulative fp exception status. It also produces
|
||||
* default nans.
|
||||
*/
|
||||
fpst = *(float_status *)vst;
|
||||
set_default_nan_mode(true, &fpst);
|
||||
|
||||
for (row = 0; row < oprsz; ) {
|
||||
uint16_t pa = pn[H2(row >> 4)];
|
||||
do {
|
||||
if (pa & 1) {
|
||||
void *vza_row = vza + tile_vslice_offset(row);
|
||||
uint32_t n = *(uint32_t *)(vzn + H1_4(row)) ^ neg;
|
||||
|
||||
for (col = 0; col < oprsz; ) {
|
||||
uint16_t pb = pm[H2(col >> 4)];
|
||||
do {
|
||||
if (pb & 1) {
|
||||
uint32_t *a = vza_row + H1_4(col);
|
||||
uint32_t *m = vzm + H1_4(col);
|
||||
*a = float32_muladd(n, *m, *a, 0, vst);
|
||||
}
|
||||
col += 4;
|
||||
pb >>= 4;
|
||||
} while (col & 15);
|
||||
}
|
||||
}
|
||||
row += 4;
|
||||
pa >>= 4;
|
||||
} while (row & 15);
|
||||
}
|
||||
}
|
||||
|
||||
void HELPER(sme_fmopa_d)(void *vza, void *vzn, void *vzm, void *vpn,
|
||||
void *vpm, void *vst, uint32_t desc)
|
||||
{
|
||||
intptr_t row, col, oprsz = simd_oprsz(desc) / 8;
|
||||
uint64_t neg = (uint64_t)simd_data(desc) << 63;
|
||||
uint64_t *za = vza, *zn = vzn, *zm = vzm;
|
||||
uint8_t *pn = vpn, *pm = vpm;
|
||||
float_status fpst = *(float_status *)vst;
|
||||
|
||||
set_default_nan_mode(true, &fpst);
|
||||
|
||||
for (row = 0; row < oprsz; ++row) {
|
||||
if (pn[H1(row)] & 1) {
|
||||
uint64_t *za_row = &za[tile_vslice_index(row)];
|
||||
uint64_t n = zn[row] ^ neg;
|
||||
|
||||
for (col = 0; col < oprsz; ++col) {
|
||||
if (pm[H1(col)] & 1) {
|
||||
uint64_t *a = &za_row[col];
|
||||
*a = float64_muladd(n, zm[col], *a, 0, &fpst);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue