diff options
author | Guinevere Larsen <guinevere@redhat.com> | 2025-01-08 09:37:47 -0300 |
---|---|---|
committer | Guinevere Larsen <guinevere@redhat.com> | 2025-01-14 14:47:56 -0300 |
commit | 5a3f643750a3250d00d845a3a7a50c0aee99d9f9 (patch) | |
tree | 4a0a9cdcc7714067935911275f3b34fd5137768d /gdb/testsuite | |
parent | 2d42150b06529481967e8ffd306a29fce9b24f4c (diff) | |
download | gdb-5a3f643750a3250d00d845a3a7a50c0aee99d9f9.zip gdb-5a3f643750a3250d00d845a3a7a50c0aee99d9f9.tar.gz gdb-5a3f643750a3250d00d845a3a7a50c0aee99d9f9.tar.bz2 |
gdb/record: add support for floating point vunpck instructions
This commit adds support for the AVX instructions vunpck[l|h][ps|pd]
instructions, which was pretty straightforward.
This commit also fixes a mistake in the test, where "record stop" was
used after the recording was already stopped, if it failed during
vpunpck_test recording. It also improved the documentation at the start
of the relevant .c function.
Approved-By: Guinevere Larsen <guinevere@redhat.com>
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/gdb.reverse/i386-avx-reverse.c | 20 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/i386-avx-reverse.exp | 28 |
2 files changed, 44 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.reverse/i386-avx-reverse.c b/gdb/testsuite/gdb.reverse/i386-avx-reverse.c index 9d82bb0..f41c7ff 100644 --- a/gdb/testsuite/gdb.reverse/i386-avx-reverse.c +++ b/gdb/testsuite/gdb.reverse/i386-avx-reverse.c @@ -182,6 +182,7 @@ vpunpck_test () /* Using GDB, load these values onto registers, for ease of testing. ymm0.v2_int128 = {0x1f1e1d1c1b1a19181716151413121110, 0x2f2e2d2c2b2a29282726252423222120} ymm1.v2_int128 = {0x4f4e4d4c4b4a49484746454443424140, 0x3f3e3d3c3b3a39383736353433323130} + ymm2.v2_int128 = {0x0, 0x0} ymm15.v2_int128 = {0xdead, 0xbeef} so that's easy to confirm that the unpacking went as expected. */ @@ -220,6 +221,25 @@ vpunpck_test () asm volatile ("vpunpckhdq %ymm0, %ymm1, %ymm15"); /* 17 16 15 14 13 12 11 10 ...*/ asm volatile ("vpunpckhqdq %ymm0, %ymm1, %ymm15"); + + /* Test some of the floating point unpack instructions. */ + /* 17 27 16 26 15 25 14 24 ...*/ + asm volatile ("vunpcklps %xmm0, %xmm1, %xmm15"); + /* 17 16 27 26 15 14 25 24 ...*/ + asm volatile ("vunpcklps %ymm0, %ymm1, %ymm2"); + /* 17 16 15 14 27 26 25 24 ...*/ + asm volatile ("vunpcklpd %xmm0, %xmm1, %xmm2"); + /* 17 16 15 14 13 12 11 10 ...*/ + asm volatile ("vunpcklpd %ymm0, %ymm1, %ymm15"); + /* 17 27 16 26 15 25 14 24 ...*/ + asm volatile ("vunpckhps %xmm0, %xmm1, %xmm15"); + /* 17 16 27 26 15 14 25 24 ...*/ + asm volatile ("vunpckhps %ymm0, %ymm1, %ymm2"); + /* 17 16 15 14 27 26 25 24 ...*/ + asm volatile ("vunpckhpd %xmm0, %xmm1, %xmm2"); + /* 17 16 15 14 13 12 11 10 ...*/ + asm volatile ("vunpckhpd %ymm0, %ymm1, %ymm15"); + /* We have a return statement to deal with epilogue in different compilers. */ return 0; /* end vpunpck_test */ diff --git a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp index 45d8984..e3d1bbb 100644 --- a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp +++ b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp @@ -298,6 +298,25 @@ gdb_test_no_output \ gdb_test_no_output "set \$ymm2.v2_int128 = {0x0, 0x0}" gdb_test_no_output "set \$ymm15.v2_int128 = {0xdead, 0xbeef}" if {[record_full_function "vpunpck"] == true} { + # Floating point unpack instructions. + test_one_register "vunpckhpd" "ymm15" \ + "0x1f1e1d1c3f3e3d3c1b1a19183b3a3938, 0x0" + test_one_register "vunpckhpd" "ymm2" \ + "0x1f1e1d1c3f3e3d3c1b1a19183b3a3938, 0x2f2e2d2c4f4e4d4c2b2a29284b4a4948" + test_one_register "vunpckhps" "ymm2" \ + "0x17161514131211103736353433323130, 0x0" + test_one_register "vunpckhps" "ymm15" \ + "0x17161514131211103736353433323130, 0x27262524232221204746454443424140" + test_one_register "vunpcklpd" "ymm15" \ + "0x17161514373635341312111033323130, 0x0" + test_one_register "vunpcklpd" "ymm2" \ + "0x17161514373635341312111033323130, 0x27262524474645442322212043424140" + test_one_register "vunpcklps" "ymm2" \ + "0x1f1e1d1c1b1a19183f3e3d3c3b3a3938, 0x0" + test_one_register "vunpcklps" "ymm15" \ + "0x1f1e1d1c1b1a19183f3e3d3c3b3a3938, 0x2f2e2d2c2b2a29284f4e4d4c4b4a4948" + + test_one_register "vpunpckhqdq" "ymm15" \ "0x1f1e1d1c3f3e3d3c1b1a19183b3a3938, 0x2f2e2d2c4f4e4d4c2b2a29284b4a4948" \ "ymm: " @@ -325,14 +344,15 @@ if {[record_full_function "vpunpck"] == true} { test_one_register "vpunpcklwd" "ymm15" \ "0x17371636153514341333123211311030, 0x0" test_one_register "vpunpcklbw" "ymm15" "0xdead, 0xbeef" + + # Move to the end of vmov_test to set up next. + # Stop recording in case of recording errors. + gdb_test "record stop" "Process record is stopped.*" \ + "delete history for vpunpck_test" } else { untested "couldn't test vpunpck tests" } -# Move to the end of vmov_test to set up next. -# Stop recording in case of recording errors. -gdb_test "record stop" "Process record is stopped.*" \ - "delete history for vpunpck_test" gdb_test "finish" "Run till exit from.*vpunpck_test.*" "leaving vpunpck_test" # Start vpbroadcast tests |