From: Andreas Arnez Date: Mon, 22 May 2023 17:49:08 +0000 (+0200) Subject: Bug 470132 - s390x: Increase test coverage for VGM X-Git-Tag: VALGRIND_3_22_0~136 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb684b50e7d4d845b56abea72fd9b9925fed644e;p=thirdparty%2Fvalgrind.git Bug 470132 - s390x: Increase test coverage for VGM Add more tests for the VGM instruction, to verify the fix for the VGM wrap-around case. Also test setting unused bits in the I2 and I3 fields, to check that Valgrind ignores them as it should. --- diff --git a/none/tests/s390x/vec2.c b/none/tests/s390x/vec2.c index 73b04dee49..0d549cb235 100644 --- a/none/tests/s390x/vec2.c +++ b/none/tests/s390x/vec2.c @@ -301,6 +301,31 @@ static void test_all_fp_int_conversions() #undef TEST_EXEC #undef TEST_GENERATE +/* -- Vector generate mask -- */ + +#define XTEST(insn, i2, i3) \ + do { \ + ulong_v out = vec_ini; \ + puts(#insn " " #i2 "," #i3); \ + __asm__(#insn " %[out]," #i2 "," #i3 : [out] "+v"(out) : :); \ + printf("\t%016lx %016lx\n", out[0], out[1]); \ + } while (0) + +static void test_all_generate_mask() +{ + XTEST(vgmb, 2, 1); + XTEST(vgmb, 0xf7, 0x30); + XTEST(vgmb, 0, 0); + XTEST(vgmh, 3, 2); + XTEST(vgmh, 15, 15); + XTEST(vgmf, 4, 3); + XTEST(vgmf, 16, 17); + XTEST(vgmg, 55, 63); + XTEST(vgmg, 43, 55); + XTEST(vgmg, 63, 2); +} + +#undef XTEST int main() { @@ -310,5 +335,6 @@ int main() test_all_double_bitshifts(); test_all_int_fp_conversions(); test_all_fp_int_conversions(); + test_all_generate_mask(); return 0; } diff --git a/none/tests/s390x/vec2.stdout.exp b/none/tests/s390x/vec2.stdout.exp index b32cbe1bc0..7b894b9519 100644 --- a/none/tests/s390x/vec2.stdout.exp +++ b/none/tests/s390x/vec2.stdout.exp @@ -166,3 +166,23 @@ vcsfp 0 vcsfp 8 00ffffff - - - 00000004 - - - +vgmb 2,1 + ffffffffffffffff ffffffffffffffff +vgmb 0xf7,0x30 + 8181818181818181 8181818181818181 +vgmb 0,0 + 8080808080808080 8080808080808080 +vgmh 3,2 + ffffffffffffffff ffffffffffffffff +vgmh 15,15 + 0001000100010001 0001000100010001 +vgmf 4,3 + ffffffffffffffff ffffffffffffffff +vgmf 16,17 + 0000c0000000c000 0000c0000000c000 +vgmg 55,63 + 00000000000001ff 00000000000001ff +vgmg 43,55 + 00000000001fff00 00000000001fff00 +vgmg 63,2 + e000000000000001 e000000000000001