diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2021-05-24 18:02:31 -0700 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2021-05-25 16:01:43 +0100 |
commit | 8b3f15b0a3b6d6ffbe7dfcb8dfbceb6d8da7ee6a (patch) | |
tree | 270d5ebbdd7b231ab39ac14eb46c43e50f89e2ce /target/arm/kvm_arm.h | |
parent | db366da809bf18749e43f6cbd947ffc596500675 (diff) | |
download | qemu-8b3f15b0a3b6d6ffbe7dfcb8dfbceb6d8da7ee6a.zip qemu-8b3f15b0a3b6d6ffbe7dfcb8dfbceb6d8da7ee6a.tar.gz qemu-8b3f15b0a3b6d6ffbe7dfcb8dfbceb6d8da7ee6a.tar.bz2 |
target/arm: Split out saturating/rounding shifts from neon
Split these operations out into a header that can be shared
between neon and sve. The "sat" pointer acts both as a boolean
for control of saturating behavior and controls the difference
in behavior between neon and sve -- QC bit or no QC bit.
Widen the shift operand in the new helpers, as the SVE2 insns treat
the whole input element as significant. For the neon uses, truncate
the shift to int8_t while passing the parameter.
Implement right-shift rounding as
tmp = src >> (shift - 1);
dst = (tmp >> 1) + (tmp & 1);
This is the same number of instructions as the current
tmp = 1 << (shift - 1);
dst = (src + tmp) >> shift;
without any possibility of intermediate overflow.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210525010358.152808-6-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/arm/kvm_arm.h')
0 files changed, 0 insertions, 0 deletions