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. */
vzeroupper_test ();
vpxor_test ();
vpcmpeq_test ();
+ vpmovmskb_test ();
return 0; /* end of main */
}
"${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.
}
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"