@samitouri / QOSamiQemu / commits / ffc27ce9be

tests/tcg/loongarch64: Add bitrev smoke tests

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Richard Henderson committed Aug 10, 2026 at 12:42 UTC ffc27ce9be6751a12c30f9a913d1f41003a74962
1 file changed +8
tests/tcg/loongarch64/test_bit.c
+8
@@ -19,6 +19,10 @@ TEST(cto_w, "cto.w")
19 TEST(cto_d, "cto.d")
20 TEST(ctz_w, "ctz.w")
21 TEST(ctz_d, "ctz.d")
22 +TEST(bitrev_4b, "bitrev.4b")
23 +TEST(bitrev_8b, "bitrev.8b")
24 +TEST(bitrev_w, "bitrev.w")
25 +TEST(bitrev_d, "bitrev.d")
26
27 struct vector {
28 uint64_t (*func)(uint64_t);
@@ -35,6 +39,10 @@ static struct vector vectors[] = {
39 {test_cto_d, 0xabd28a64000000, 0},
40 {test_ctz_w, 0xfaffff42392476ab, 0},
41 {test_ctz_d, 0xabd28a64000000, 26},
42 + {test_bitrev_4b, 0xdeadbeef11223344, 0xffffffff8844cc22},
43 + {test_bitrev_8b, 0x1122334455667788, 0x8844cc22aa66ee11},
44 + {test_bitrev_w, 0xdeadbeef89abcdef, 0xfffffffff7b3d591},
45 + {test_bitrev_d, 0x0123456789abcdef, 0xf7b3d591e6a2c480},
46 };
47
48 int main()