}
break;
+ case 0x78: /* VPBROADCASTB */
+ case 0x79: /* VPBROADCASTW */
+ case 0x58: /* VPBROADCASTD */
+ case 0x59: /* VPBROADCASTQ */
+ {
+ i386_record_modrm (ir);
+ int reg_offset = ir->reg + vex_r * 8;
+ gdb_assert (tdep->num_ymm_regs > reg_offset);
+ 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 "
return 0; /* end vpunpck_test */
}
+/* Test if we can record vpbroadcast instructions. */
+int
+vpbroadcast_test ()
+{
+ /* Using GDB, load this value onto the register, for ease of testing.
+ xmm0.uint128 = 0x0
+ xmm1.uint128 = 0x1f1e1d1c1b1a19181716151413121110
+ xmm15.uint128 = 0x0
+ this way it's easy to confirm we're undoing things correctly. */
+ /* start vpbroadcast_test. */
+
+ asm volatile ("vpbroadcastb %xmm1, %xmm0");
+ asm volatile ("vpbroadcastb %xmm1, %xmm15");
+
+ asm volatile ("vpbroadcastw %xmm1, %ymm0");
+ asm volatile ("vpbroadcastw %xmm1, %ymm15");
+
+ asm volatile ("vpbroadcastd %xmm1, %xmm0");
+ asm volatile ("vpbroadcastd %xmm1, %xmm15");
+
+ asm volatile ("vpbroadcastq %xmm1, %ymm0");
+ asm volatile ("vpbroadcastq %xmm1, %ymm15");
+
+ /* We have a return statement to deal with
+ epilogue in different compilers. */
+ return 0; /* end vpbroadcast_test */
+}
+
int
main ()
{
vmov_test ();
vpunpck_test ();
+ vpbroadcast_test ();
return 0; /* end of main */
}
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
+gdb_test_no_output "set \$ymm0.v2_int128 = {0x0, 0x0}" "set xmm0 for vpbroadcast"
+gdb_test_no_output "set \$xmm1.v2_int64 = {0x1716151413121110, 0x1f1e1d1c1b1a1918}" \
+ "set xmm1 for vpbroadcast"
+gdb_test_no_output "set \$ymm15.v2_int128 = {0x0, 0x0}" "set xmm15 for vpbroadcast"
+if {[record_full_function "vpbroadcast"] == true} {
+ test_one_register "vpbroadcastq" "ymm15" "0x13121110131211101312111013121110, 0x0"
+ test_one_register "vpbroadcastq" "ymm0" "0x13121110131211101312111013121110, 0x0"
+
+ test_one_register "vpbroadcastd" "ymm15" \
+ "0x11101110111011101110111011101110, 0x11101110111011101110111011101110"
+ test_one_register "vpbroadcastd" "ymm0" \
+ "0x11101110111011101110111011101110, 0x11101110111011101110111011101110"
+
+ test_one_register "vpbroadcastw" "ymm15" "0x10101010101010101010101010101010, 0x0"
+ test_one_register "vpbroadcastw" "ymm0" "0x10101010101010101010101010101010, 0x0"
+
+ test_one_register "vpbroadcastb" "ymm15" "0x0, 0x0"
+ test_one_register "vpbroadcastb" "ymm0" "0x0, 0x0"
+
+ gdb_test "record stop" "Process record is stopped.*" \
+ "delete history for vpbroadcast_test"
+} else {
+ untested "couldn't run vpbroadcast tests"
+}
+
+gdb_test "finish" "Run till exit from.*vpbroadcast_test.*" \
+ "leaving vpbroadcast"