OSDN Git Service

qemu/bitops.h: Limit rotate amounts
authorDickon Hood <dickon.hood@codethink.co.uk>
Fri, 28 Apr 2023 14:47:46 +0000 (15:47 +0100)
committerRichard Henderson <richard.henderson@linaro.org>
Tue, 2 May 2023 19:36:46 +0000 (12:36 -0700)
commit8841c815a93a2da3e60fb8173d9c5dc01f552dab
tree0ebf6cb98461c94cc35c3473509ca30bb0e2971f
parentac01ec6fe59458978b32624a6e93b5f2e55b593f
qemu/bitops.h: Limit rotate amounts

Rotates have been fixed up to only allow for reasonable rotate amounts
(ie, no rotates >7 on an 8b value etc.)  This fixes a problem with riscv
vector rotate instructions.

Signed-off-by: Dickon Hood <dickon.hood@codethink.co.uk>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230428144757.57530-9-lawrence.hunter@codethink.co.uk>
[rth: Mask shifts in both directions.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
include/qemu/bitops.h