]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/record: introduce recoding support for vpor
authorGuinevere Larsen <guinevere@redhat.com>
Thu, 14 Nov 2024 12:31:00 +0000 (09:31 -0300)
committerGuinevere Larsen <guinevere@redhat.com>
Fri, 22 Nov 2024 20:40:26 +0000 (17:40 -0300)
This commit adds recording support for the AVX instruction vpor, and the
AVX2 extension. Since the encoding of vpor and vpxor are the same, and
their semantics are basically the same, modulo the mathematical
operation, they are handled by the same switch case block.

This also updates the vpxor function, to test vpor and vpxor, and
updates the name to vpor_xor_test to better reflect what it does.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/i386-tdep.c
gdb/testsuite/gdb.reverse/i386-avx-reverse.c
gdb/testsuite/gdb.reverse/i386-avx-reverse.exp

index 0f366daa29f5dd9eb59adc3c97a9da916079ad3b..eb8ddfc43c07f175e24094f44867fb73d70d3161 100644 (file)
@@ -5001,7 +5001,8 @@ i386_record_vex (struct i386_record_s *ir, uint8_t vex_w, uint8_t vex_r,
       }
       break;
 
-    case 0xef:
+    case 0xef: /* VPXOR  */
+    case 0xeb: /* VPOR   */
       {
        i386_record_modrm (ir);
        int reg_offset = ir->reg + vex_r * 8;
index 02fd3da3fc04c97be49732f2fb769a8af80c22dd..5ce363f31ef8b256686ff07898c06434cb4457e9 100644 (file)
@@ -211,9 +211,9 @@ vzeroupper_test ()
 }
 
 int
-vpxor_test ()
+vpor_xor_test ()
 {
-  /* start vpxor_test.  */
+  /* start vpor_xor_test.  */
   /* Using GDB, load this value onto the register, for ease of testing.
      ymm0.v2_int128  = {0x0, 0x12345}
      ymm1.v2_int128  = {0x1f1e1d1c1b1a1918, 0x0}
@@ -226,7 +226,13 @@ vpxor_test ()
   asm volatile ("vpxor %ymm2, %ymm15, %ymm1");
   asm volatile ("vpxor %xmm2, %xmm15, %xmm2");
   asm volatile ("vpxor %ymm2, %ymm1, %ymm15");
-  return 0; /* end vpxor_test  */
+
+  asm volatile ("vpor %ymm0, %ymm0, %ymm0");
+  asm volatile ("vpor %xmm0, %xmm1, %xmm0");
+  asm volatile ("vpor %ymm2, %ymm15, %ymm1");
+  asm volatile ("vpor %xmm2, %xmm15, %xmm2");
+  asm volatile ("vpor %ymm2, %ymm1, %ymm15");
+  return 0; /* end vpor_xor_test  */
 }
 
 int
@@ -302,7 +308,7 @@ main ()
   vpunpck_test ();
   vpbroadcast_test ();
   vzeroupper_test ();
-  vpxor_test ();
+  vpor_xor_test ();
   vpcmpeq_test ();
   vpmovmskb_test ();
   return 0;    /* end of main */
index 198025ed885b0031ff579d808a6233329f8f2e5c..6d8990067f2251f61cdae69e18c81cb78834cee3 100644 (file)
@@ -351,26 +351,32 @@ gdb_test "finish" "Run till exit from.*vzeroupper_test.*" \
     "leaving vzeroupper"
 
 # Preparation and testing vpxor instructions.
-gdb_test_no_output "set \$ymm0.v2_int128 = {0x0, 0x12345}" "set ymm0 for vpxor"
+gdb_test_no_output "set \$ymm0.v2_int128 = {0x0, 0x12345}" "set ymm0 for vpor_xor"
 gdb_test_no_output "set \$ymm1.v2_int128 = {0x1f1e1d1c1b1a1918, 0x0}" \
-    "set ymm1 for vpxor"
-gdb_test_no_output "set \$ymm2.v2_int128 = {0x0, 0xbeef}" "set ymm2 for vpxor"
-gdb_test_no_output "set \$ymm15.v2_int128 = {0x0, 0xcafeface}" "set ymm15 for vpxor"
+    "set ymm1 for vpor_xor"
+gdb_test_no_output "set \$ymm2.v2_int128 = {0x0, 0xbeef}" "set ymm2 for vpor_xor"
+gdb_test_no_output "set \$ymm15.v2_int128 = {0x0, 0xcafeface}" "set ymm15 for vpor_xor"
+
+if {[record_full_function "vpor_xor"] == true} {
+    test_one_register "vpor" "ymm15" "0x0, 0xcafe4421"
+    test_one_register "vpor" "ymm2" "0x0, 0x0"
+    test_one_register "vpor" "ymm1" "0x0, 0xcafe4421"
+    test_one_register "vpor" "ymm0" "0x1f1e1d1c1b1a1918, 0x0" "first: "
+    test_one_register "vpor" "ymm0" "0x1f1e1d1c1b1a1918, 0x0" "second: "
 
-if {[record_full_function "vpxor"] == true} {
     test_one_register "vpxor" "ymm15" "0x0, 0xcafeface"
     test_one_register "vpxor" "ymm2" "0x0, 0xbeef"
     test_one_register "vpxor" "ymm1" "0x1f1e1d1c1b1a1918, 0x0"
-    test_one_register "vpxor" "ymm0" "0x0, 0x0" "first"
-    test_one_register "vpxor" "ymm0" "0x0, 0x12345" "second"
+    test_one_register "vpxor" "ymm0" "0x0, 0x0" "first"
+    test_one_register "vpxor" "ymm0" "0x0, 0x12345" "second"
 
     gdb_test "record stop" "Process record is stopped.*" \
-       "delete history for vpxor_test"
+       "delete history for vpor_xor_test"
 } else {
-    untested "couldn't run vpxor tests"
+    untested "couldn't run vpor_xor tests"
 }
-gdb_test "finish" "Run till exit from.*vpxor_test.*" \
-    "leaving vpxor"
+gdb_test "finish" "Run till exit from.*vpor_xor_test.*" \
+    "leaving vpor_xor"
 
 # Preparation and testing vpcmpeq instructions.
 gdb_test_no_output "set \$ymm0.v2_int128 = {0x12345, 0x12345}" \