}
break;
+ case 0x2e: /* VUCOMIS[S|D]. */
+ case 0x2f: /* VCOMIS[S|D]. */
+ {
+ /* Despite what the manual implies, saying that the first register
+ will be written to, actual testing shows that the only register
+ changed is EFLAGS. */
+ record_full_arch_list_add_reg (ir->regcache,
+ ir->regmap[X86_RECORD_EFLAGS_REGNUM]);
+ break;
+ }
+
case 0x77:/* VZEROUPPER */
{
int num_regs = tdep->num_ymm_regs;
return 0; /* end blend_test */
}
+int
+compare_test ()
+{
+ /* start compare_test. */
+ /* Using GDB, load these values onto registers for testing.
+ xmm0.v4_float = {0, 1.5, 2, 0}
+ xmm1.v4_float = {0, 1, 2.5, -1}
+ xmm15.v4_float = {-1, -2, 10, 100}
+ eflags = 2
+ eflags can't be set to some values, if we set it to 0, it'll
+ be reset to 2, so set it to that directly to make results less
+ confusing.
+ this way it's easy to confirm we're undoing things correctly. */
+
+ asm volatile ("vcomisd %xmm0, %xmm1");
+ asm volatile ("vcomiss %xmm15, %xmm1");
+ asm volatile ("vucomiss %xmm1, %xmm15");
+ asm volatile ("vucomisd %xmm15, %xmm0");
+
+ return 0; /* end compare_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. */
permute_test ();
extract_insert_test ();
blend_test ();
+ compare_test ();
return 0; /* end of main */
}
}
gdb_test "finish" "Run till exit from.*blend_test.*" \
"leaving blend"
+
+# Preparation and testing compare instructions.
+gdb_test_no_output \
+ "set \$xmm0.v4_float = {0, 1.5, 2, 0}" "set ymm0 for compare"
+gdb_test_no_output \
+ "set \$xmm1.v4_float = {0, 1, 2.5, -1}" "set ymm1 for compare"
+gdb_test_no_output \
+ "set \$xmm15.v4_float = {-1, -2, 10, 100}" "set ymm15 for compare"
+gdb_test_no_output "set \$eflags = 2"
+
+if {[record_full_function "compare"] == true} {
+ test_one_general_register "vucomisd" "eflags" "0x203"
+ test_one_general_register "vucomiss" "eflags" "0x202"
+ test_one_general_register "vcomiss" "eflags" "0x203"
+ test_one_general_register "vcomisd" "eflags" "0x202"
+
+ gdb_test "record stop" "Process record is stopped.*" \
+ "delete history for compare_test"
+} else {
+ untested "couldn't run compare tests"
+}
+gdb_test "finish" "Run till exit from.*compare_test.*" \
+ "leaving compare"