]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 470132 - s390x: Increase test coverage for VGM
authorAndreas Arnez <arnez@linux.ibm.com>
Mon, 22 May 2023 17:49:08 +0000 (19:49 +0200)
committerAndreas Arnez <arnez@linux.ibm.com>
Thu, 6 Jul 2023 15:15:08 +0000 (17:15 +0200)
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.

none/tests/s390x/vec2.c
none/tests/s390x/vec2.stdout.exp

index 73b04dee491fd0e4f302dcffe1ccf675c560790c..0d549cb235fb43384eca4f0dd404bb54bce7cb36 100644 (file)
@@ -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;
 }
index b32cbe1bc0a8b91373081b1a35dbf9de82da6dd7..7b894b9519c406aef9fc43465d2351cd475187d3 100644 (file)
@@ -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