* [PATCH 0/3] Add support for recording printf with AVX instructions
@ 2024-11-13 18:39 Guinevere Larsen
2024-11-13 18:39 ` [PATCH 1/3] gdb/record: add support for vpxor instruction Guinevere Larsen
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Guinevere Larsen @ 2024-11-13 18:39 UTC (permalink / raw)
To: gdb-patches; +Cc: Guinevere Larsen
After the recent patches introducing initial support for recording AVX
and AVX2 instructions, we were only 3 instructions short of managing to
record printf (and strlen). This series adds support for those 3
instructions.
Guinevere Larsen (3):
gdb/record: add support for vpxor instruction
gdb/record: Add support for all vpcmpeq instructions
gdb/record: Add support for recording vpmovmskb
gdb/i386-tdep.c | 29 +++++
gdb/testsuite/gdb.reverse/i386-avx-reverse.c | 70 ++++++++++++
.../gdb.reverse/i386-avx-reverse.exp | 104 ++++++++++++++++++
3 files changed, 203 insertions(+)
--
2.47.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] gdb/record: add support for vpxor instruction
2024-11-13 18:39 [PATCH 0/3] Add support for recording printf with AVX instructions Guinevere Larsen
@ 2024-11-13 18:39 ` Guinevere Larsen
2024-11-13 18:39 ` [PATCH 2/3] gdb/record: Add support for all vpcmpeq instructions Guinevere Larsen
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Guinevere Larsen @ 2024-11-13 18:39 UTC (permalink / raw)
To: gdb-patches; +Cc: Guinevere Larsen
This commit adds support for recording the instruction vpxor,
introduced in the AVX extension, and extended in AVX2 to use 256 bit
registers. The test gdb.reverse/i386-avx-reverse.exp has been extended
to test this instruction as well.
---
gdb/i386-tdep.c | 9 +++++++
gdb/testsuite/gdb.reverse/i386-avx-reverse.c | 20 +++++++++++++++
.../gdb.reverse/i386-avx-reverse.exp | 25 +++++++++++++++++++
3 files changed, 54 insertions(+)
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 6a919bf6473..38b1e7a1f02 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -4981,6 +4981,15 @@ i386_record_vex (struct i386_record_s *ir, uint8_t vex_w, uint8_t vex_r,
break;
}
+ case 0xef:
+ {
+ i386_record_modrm (ir);
+ int reg_offset = ir->reg + vex_r * 8;
+ record_full_arch_list_add_reg (ir->regcache,
+ tdep->ymm0_regnum + reg_offset);
+ break;
+ }
+
default:
gdb_printf (gdb_stderr,
_("Process record does not support VEX instruction 0x%02x "
diff --git a/gdb/testsuite/gdb.reverse/i386-avx-reverse.c b/gdb/testsuite/gdb.reverse/i386-avx-reverse.c
index edd931b9f8c..9bdc365ed86 100644
--- a/gdb/testsuite/gdb.reverse/i386-avx-reverse.c
+++ b/gdb/testsuite/gdb.reverse/i386-avx-reverse.c
@@ -210,6 +210,25 @@ vzeroupper_test ()
return 0; /* end vzeroupper_test */
}
+int
+vpxor_test ()
+{
+ /* start vpxor_test. */
+ /* Using GDB, load this value onto the register, for ease of testing.
+ ymm0.v2_int128 = {0x0, 0x12345}
+ ymm1.v2_int128 = {0x1f1e1d1c1b1a1918, 0x0}
+ ymm2.v2_int128 = {0x0, 0xbeef}
+ ymm15.v2_int128 = {0x0, 0xcafeface}
+ this way it's easy to confirm we're undoing things correctly. */
+
+ asm volatile ("vpxor %ymm0, %ymm0, %ymm0");
+ asm volatile ("vpxor %xmm0, %xmm1, %xmm0");
+ asm volatile ("vpxor %ymm2, %ymm15, %ymm1");
+ asm volatile ("vpxor %xmm2, %xmm15, %xmm2");
+ asm volatile ("vpxor %ymm2, %ymm1, %ymm15");
+ return 0; /* end vpxor_test */
+}
+
/* This include is used to allocate the dynamic buffer and have
the pointers aligned to a 32-bit boundary, so we can test instructions
that require aligned memory. */
@@ -235,5 +254,6 @@ main ()
vpunpck_test ();
vpbroadcast_test ();
vzeroupper_test ();
+ vpxor_test ();
return 0; /* end of main */
}
diff --git a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp
index 7ed12937391..c4a54211592 100644
--- a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp
@@ -327,9 +327,34 @@ if {[record_full_function "vzeroupper"] == true} {
"Register ymm15h changed: 3405707982" \
"Register rip changed: \[^\r\n\]+" ] \
"verify vzeroupper recording"
+
+ gdb_test "record stop" "Process record is stopped.*" \
+ "delete history for vzeroupper_test"
} else {
untested "couldn't run vzeroupper tests"
}
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 \$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"
+
+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"
+
+ gdb_test "record stop" "Process record is stopped.*" \
+ "delete history for vpxor_test"
+} else {
+ untested "couldn't run vpxor tests"
+}
+gdb_test "finish" "Run till exit from.*vpxor_test.*" \
+ "leaving vpxor"
--
2.47.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] gdb/record: Add support for all vpcmpeq instructions
2024-11-13 18:39 [PATCH 0/3] Add support for recording printf with AVX instructions Guinevere Larsen
2024-11-13 18:39 ` [PATCH 1/3] gdb/record: add support for vpxor instruction Guinevere Larsen
@ 2024-11-13 18:39 ` Guinevere Larsen
2024-11-13 18:39 ` [PATCH 3/3] gdb/record: Add support for recording vpmovmskb Guinevere Larsen
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Guinevere Larsen @ 2024-11-13 18:39 UTC (permalink / raw)
To: gdb-patches; +Cc: Guinevere Larsen
This commit adds support to recording instructions of the form
VPCMPEQ[B|W|D]. They are all encoded in the same way and only
differentiated by the opcode, so they are all processed together. This
commit also updates the test to (quite exhaustively) test the new
instruction.
---
gdb/i386-tdep.c | 11 +++++
gdb/testsuite/gdb.reverse/i386-avx-reverse.c | 32 +++++++++++++
.../gdb.reverse/i386-avx-reverse.exp | 45 +++++++++++++++++++
3 files changed, 88 insertions(+)
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 38b1e7a1f02..2a076700a67 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -4951,6 +4951,17 @@ i386_record_vex (struct i386_record_s *ir, uint8_t vex_w, uint8_t vex_r,
}
break;
+ case 0x74: /* VPCMPEQB */
+ case 0x75: /* VPCMPEQB */
+ case 0x76: /* VPCMPEQB */
+ {
+ i386_record_modrm (ir);
+ int reg_offset = ir->reg + vex_r * 8;
+ record_full_arch_list_add_reg (ir->regcache,
+ tdep->ymm0_regnum + reg_offset);
+ }
+ break;
+
case 0x78: /* VPBROADCASTB */
case 0x79: /* VPBROADCASTW */
case 0x58: /* VPBROADCASTD */
diff --git a/gdb/testsuite/gdb.reverse/i386-avx-reverse.c b/gdb/testsuite/gdb.reverse/i386-avx-reverse.c
index 9bdc365ed86..57b53d1390c 100644
--- a/gdb/testsuite/gdb.reverse/i386-avx-reverse.c
+++ b/gdb/testsuite/gdb.reverse/i386-avx-reverse.c
@@ -229,6 +229,37 @@ vpxor_test ()
return 0; /* end vpxor_test */
}
+int
+vpcmpeq_test ()
+{
+ /* start vpcmpeq_test. */
+ /* Using GDB, load these values onto registers for testing.
+ ymm0.v2_int128 = {0x0, 0x12345}
+ ymm1.v8_int32 = {0xcafe, 0xbeef, 0xff, 0x1234, 0x0, 0xff00, 0xff0000ff, 0xface0f0f}
+ ymm2.v8_int32 = {0xcafe0, 0xbeef, 0xff00, 0x12345678, 0x90abcdef, 0xffff00, 0xff, 0xf}
+ ymm15.v2_int128 = {0xcafeface, 0xcafeface}
+ this way it's easy to confirm we're undoing things correctly. */
+
+ /* Test all the vpcmpeq variants on a low register (number 0). */
+ asm volatile ("vpcmpeqb %xmm1, %xmm2, %xmm0");
+ asm volatile ("vpcmpeqw %xmm1, %xmm2, %xmm0");
+ asm volatile ("vpcmpeqd %xmm1, %xmm2, %xmm0");
+
+ asm volatile ("vpcmpeqb %ymm1, %ymm2, %ymm0");
+ asm volatile ("vpcmpeqw %ymm1, %ymm2, %ymm0");
+ asm volatile ("vpcmpeqd %ymm1, %ymm2, %ymm0");
+
+ /* Test all the vpcmpeq variants on a high register (number 15). */
+ asm volatile ("vpcmpeqb %xmm1, %xmm2, %xmm15");
+ asm volatile ("vpcmpeqw %xmm1, %xmm2, %xmm15");
+ asm volatile ("vpcmpeqd %xmm1, %xmm2, %xmm15");
+
+ asm volatile ("vpcmpeqb %ymm1, %ymm2, %ymm15");
+ asm volatile ("vpcmpeqw %ymm1, %ymm2, %ymm15");
+ asm volatile ("vpcmpeqd %ymm1, %ymm2, %ymm15");
+ return 0; /* end vpcmpeq_test */
+}
+
/* This include is used to allocate the dynamic buffer and have
the pointers aligned to a 32-bit boundary, so we can test instructions
that require aligned memory. */
@@ -255,5 +286,6 @@ main ()
vpbroadcast_test ();
vzeroupper_test ();
vpxor_test ();
+ vpcmpeq_test ();
return 0; /* end of main */
}
diff --git a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp
index c4a54211592..b4f0e3b38b5 100644
--- a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp
@@ -358,3 +358,48 @@ if {[record_full_function "vpxor"] == true} {
}
gdb_test "finish" "Run till exit from.*vpxor_test.*" \
"leaving vpxor"
+
+# Preparation and testing vpcmpeq instructions.
+gdb_test_no_output "set \$ymm0.v2_int128 = {0x12345, 0x12345}" \
+ "set ymm0 for vpcmpeq"
+gdb_test_no_output \
+ "set \$ymm1.v8_int32 = {0xcafe, 0xbeef, 0xff, 0x1234, 0x0, 0xff00, 0xff0000ff, 0xface0f0f}" \
+ "set ymm1 for vpcmpeq"
+gdb_test_no_output \
+ "set \$ymm2.v8_int32 = {0xcafe0, 0xbeef, 0xff00, 0x12345678, 0x90abcdef, 0xffff00, 0xff, 0xf}" \
+ "set ymm2 for vpcmpeq"
+gdb_test_no_output "set \$ymm15.v2_int128 = {0xcafeface, 0xcafeface}" \
+ "set ymm15 for vpcmpeq"
+
+if {[record_full_function "vpcmpeq"] == true} {
+ test_one_register "vpcmpeqd" "ymm15" \
+ "0xffff0000ffffffff00000000, 0xffff0000ffff00000000" "ymm: "
+ test_one_register "vpcmpeqw" "ymm15" \
+ "0xffff0000ffffffffff000000, 0xff00ffffffff00ffff00000000" "ymm: "
+ test_one_register "vpcmpeqb" "ymm15" \
+ "0xffffffff00000000, 0x0" "ymm: "
+ test_one_register "vpcmpeqd" "ymm15" \
+ "0xffff0000ffffffff00000000, 0x0" "xmm: "
+ test_one_register "vpcmpeqw" "ymm15" \
+ "0xffff0000ffffffffff000000, 0x0" "xmm: "
+ test_one_register "vpcmpeqb" "ymm15" "0xcafeface, 0xcafeface" "xmm: "
+
+ test_one_register "vpcmpeqd" "ymm0" \
+ "0xffff0000ffffffff00000000, 0xffff0000ffff00000000" "ymm: "
+ test_one_register "vpcmpeqw" "ymm0" \
+ "0xffff0000ffffffffff000000, 0xff00ffffffff00ffff00000000" "ymm: "
+ test_one_register "vpcmpeqb" "ymm0" \
+ "0xffffffff00000000, 0x0" "ymm: "
+ test_one_register "vpcmpeqd" "ymm0" \
+ "0xffff0000ffffffff00000000, 0x0" "xmm: "
+ test_one_register "vpcmpeqw" "ymm0" \
+ "0xffff0000ffffffffff000000, 0x0" "xmm: "
+ test_one_register "vpcmpeqb" "ymm0" "0x12345, 0x12345" "xmm: "
+
+ gdb_test "record stop" "Process record is stopped.*" \
+ "delete history for vpcmpeq_test"
+} else {
+ untested "couldn't run vpcmpeq tests"
+}
+gdb_test "finish" "Run till exit from.*vpcmpeq_test.*" \
+ "leaving vpcmpeq"
--
2.47.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] gdb/record: Add support for recording vpmovmskb
2024-11-13 18:39 [PATCH 0/3] Add support for recording printf with AVX instructions Guinevere Larsen
2024-11-13 18:39 ` [PATCH 1/3] gdb/record: add support for vpxor instruction Guinevere Larsen
2024-11-13 18:39 ` [PATCH 2/3] gdb/record: Add support for all vpcmpeq instructions Guinevere Larsen
@ 2024-11-13 18:39 ` Guinevere Larsen
2024-11-14 12:47 ` [PATCH 4/3] gdb/record: introduce recoding support for vpor Guinevere Larsen
2024-11-22 19:25 ` [PATCH 0/3] Add support for recording printf with AVX instructions Tom Tromey
4 siblings, 0 replies; 7+ messages in thread
From: Guinevere Larsen @ 2024-11-13 18:39 UTC (permalink / raw)
To: gdb-patches; +Cc: Guinevere Larsen
This commit adds support for recording the AVX instruction vpmovmskb,
and tests to the relevant file. The test didn't really support checking
general purpose registers, so this commit also adds a proc to
gdb.reverse/i386-avx-reverse.exp, which can be used to test them
---
gdb/i386-tdep.c | 9 +++++
gdb/testsuite/gdb.reverse/i386-avx-reverse.c | 18 ++++++++++
.../gdb.reverse/i386-avx-reverse.exp | 34 +++++++++++++++++++
3 files changed, 61 insertions(+)
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 2a076700a67..0f366daa29f 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -4992,6 +4992,15 @@ i386_record_vex (struct i386_record_s *ir, uint8_t vex_w, uint8_t vex_r,
break;
}
+ case 0xd7: /* VPMOVMSKB */
+ {
+ i386_record_modrm (ir);
+ record_full_arch_list_add_reg (ir->regcache,
+ ir->regmap[X86_RECORD_REAX_REGNUM
+ + ir->reg + 8 * vex_r]);
+ }
+ break;
+
case 0xef:
{
i386_record_modrm (ir);
diff --git a/gdb/testsuite/gdb.reverse/i386-avx-reverse.c b/gdb/testsuite/gdb.reverse/i386-avx-reverse.c
index 57b53d1390c..02fd3da3fc0 100644
--- a/gdb/testsuite/gdb.reverse/i386-avx-reverse.c
+++ b/gdb/testsuite/gdb.reverse/i386-avx-reverse.c
@@ -260,6 +260,23 @@ vpcmpeq_test ()
return 0; /* end vpcmpeq_test */
}
+int
+vpmovmskb_test ()
+{
+ /* start vpmovmskb_test. */
+ /* Using GDB, load these values onto registers for testing.
+ rbx = 2
+ r8 = 3
+ r9 = 4
+ this way it's easy to confirm we're undoing things correctly. */
+ asm volatile ("vpmovmskb %ymm0, %eax");
+ asm volatile ("vpmovmskb %ymm0, %ebx");
+
+ asm volatile ("vpmovmskb %ymm0, %r8");
+ asm volatile ("vpmovmskb %ymm0, %r9");
+ return 0; /* end vpmovmskb_test */
+}
+
/* This include is used to allocate the dynamic buffer and have
the pointers aligned to a 32-bit boundary, so we can test instructions
that require aligned memory. */
@@ -287,5 +304,6 @@ main ()
vzeroupper_test ();
vpxor_test ();
vpcmpeq_test ();
+ vpmovmskb_test ();
return 0; /* end of main */
}
diff --git a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp
index b4f0e3b38b5..198025ed885 100644
--- a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp
@@ -63,6 +63,19 @@ proc test_one_register {insn register value {prefix ""}} {
"${prefix}verify $register before $insn"
}
+# Shorthand to test reversing through one instruction and
+# testing if a general purpose register has the expected value.
+# Prefix, if included, should end with a colon and space.
+
+proc test_one_general_register {insn register value {prefix ""}} {
+ gdb_test "reverse-step" "$insn.*" \
+ "${prefix}reverse-step from $insn to test register $register"
+
+ gdb_test "info register $register" \
+ "$register\\s+$value.*" \
+ "${prefix}verify $register before $insn"
+}
+
# Shorthand to test reversing through one instruction and
# testing if a variable has the expected value.
# Prefix, if used, should end with a colon and space.
@@ -403,3 +416,24 @@ if {[record_full_function "vpcmpeq"] == true} {
}
gdb_test "finish" "Run till exit from.*vpcmpeq_test.*" \
"leaving vpcmpeq"
+
+# Preparation and testing vpcmpeq instructions.
+gdb_test_no_output "set \$rbx = 2" "set rbx for vpmovmskb"
+gdb_test_no_output "set \$r8 = 3" "set r8 for vpmovmskb"
+gdb_test_no_output "set \$r9 = 4" "set ymm15 for vpmovmskb"
+
+if {[record_full_function "vpmovmskb"] == true} {
+ test_one_general_register "vpmovmskb" "r9" "0x4"
+ test_one_general_register "vpmovmskb" "r8" "0x3"
+ test_one_general_register "vpmovmskb" "rbx" "0x2"
+ # Because of the infrastructure of the test, we can't set rax.
+ # However, it seems to always be set to 0, so this should be fine.
+ test_one_general_register "vpmovmskb" "rax" "0x0"
+
+ gdb_test "record stop" "Process record is stopped.*" \
+ "delete history for vpmovmskb_test"
+} else {
+ untested "couldn't run vpmovmskb tests"
+}
+gdb_test "finish" "Run till exit from.*vpmovmskb_test.*" \
+ "leaving vpmovmskb"
--
2.47.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 4/3] gdb/record: introduce recoding support for vpor
2024-11-13 18:39 [PATCH 0/3] Add support for recording printf with AVX instructions Guinevere Larsen
` (2 preceding siblings ...)
2024-11-13 18:39 ` [PATCH 3/3] gdb/record: Add support for recording vpmovmskb Guinevere Larsen
@ 2024-11-14 12:47 ` Guinevere Larsen
2024-11-22 19:25 ` [PATCH 0/3] Add support for recording printf with AVX instructions Tom Tromey
4 siblings, 0 replies; 7+ messages in thread
From: Guinevere Larsen @ 2024-11-14 12:47 UTC (permalink / raw)
To: gdb-patches; +Cc: Guinevere Larsen
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.
---
A bit after sending the first 3 patches, I realized that another
instruction was necessary to fully support printf, otherwise we won't be
able to record printf using modifiers. This is the missing instruction.
---
gdb/i386-tdep.c | 3 +-
gdb/testsuite/gdb.reverse/i386-avx-reverse.c | 14 +++++++---
.../gdb.reverse/i386-avx-reverse.exp | 28 +++++++++++--------
3 files changed, 29 insertions(+), 16 deletions(-)
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 0f366daa29f..eb8ddfc43c0 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -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;
diff --git a/gdb/testsuite/gdb.reverse/i386-avx-reverse.c b/gdb/testsuite/gdb.reverse/i386-avx-reverse.c
index 02fd3da3fc0..5ce363f31ef 100644
--- a/gdb/testsuite/gdb.reverse/i386-avx-reverse.c
+++ b/gdb/testsuite/gdb.reverse/i386-avx-reverse.c
@@ -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 */
diff --git a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp
index 198025ed885..6d8990067f2 100644
--- a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp
@@ -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}" \
--
2.47.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] Add support for recording printf with AVX instructions
2024-11-13 18:39 [PATCH 0/3] Add support for recording printf with AVX instructions Guinevere Larsen
` (3 preceding siblings ...)
2024-11-14 12:47 ` [PATCH 4/3] gdb/record: introduce recoding support for vpor Guinevere Larsen
@ 2024-11-22 19:25 ` Tom Tromey
2024-11-22 20:41 ` Guinevere Larsen
4 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2024-11-22 19:25 UTC (permalink / raw)
To: Guinevere Larsen; +Cc: gdb-patches
>>>>> "Guinevere" == Guinevere Larsen <guinevere@redhat.com> writes:
Guinevere> After the recent patches introducing initial support for recording AVX
Guinevere> and AVX2 instructions, we were only 3 instructions short of managing to
Guinevere> record printf (and strlen). This series adds support for those 3
Guinevere> instructions.
Thanks, I take your word for it on the encodings and whatnot, anyway I
think it's fine.
Approved-By: Tom Tromey <tom@tromey.com>
Tom
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] Add support for recording printf with AVX instructions
2024-11-22 19:25 ` [PATCH 0/3] Add support for recording printf with AVX instructions Tom Tromey
@ 2024-11-22 20:41 ` Guinevere Larsen
0 siblings, 0 replies; 7+ messages in thread
From: Guinevere Larsen @ 2024-11-22 20:41 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
On 11/22/24 4:25 PM, Tom Tromey wrote:
>>>>>> "Guinevere" == Guinevere Larsen <guinevere@redhat.com> writes:
> Guinevere> After the recent patches introducing initial support for recording AVX
> Guinevere> and AVX2 instructions, we were only 3 instructions short of managing to
> Guinevere> record printf (and strlen). This series adds support for those 3
> Guinevere> instructions.
>
> Thanks, I take your word for it on the encodings and whatnot, anyway I
> think it's fine.
>
> Approved-By: Tom Tromey <tom@tromey.com>
Thank you for the review! Pushed!
>
> Tom
>
--
Cheers,
Guinevere Larsen
She/Her/Hers
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-11-22 20:41 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-13 18:39 [PATCH 0/3] Add support for recording printf with AVX instructions Guinevere Larsen
2024-11-13 18:39 ` [PATCH 1/3] gdb/record: add support for vpxor instruction Guinevere Larsen
2024-11-13 18:39 ` [PATCH 2/3] gdb/record: Add support for all vpcmpeq instructions Guinevere Larsen
2024-11-13 18:39 ` [PATCH 3/3] gdb/record: Add support for recording vpmovmskb Guinevere Larsen
2024-11-14 12:47 ` [PATCH 4/3] gdb/record: introduce recoding support for vpor Guinevere Larsen
2024-11-22 19:25 ` [PATCH 0/3] Add support for recording printf with AVX instructions Tom Tromey
2024-11-22 20:41 ` Guinevere Larsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).