Support [v]movsd in delocate.
Newer versions of LLVM can emit this instruction. Note that there are
two different Intel instructions, both called “movsd”. The old one is an
auto-incrementing move that doesn't take any arguments. That's not the
one that is targetted in this change.
Change-Id: Id0c96e0c7fe0f6e4feb8a72b5bc0fa40878225b9
Reviewed-on: https://boringssl-review.googlesource.com/20425
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/util/fipstools/delocate.go b/util/fipstools/delocate.go
index b06e354..6d56f92 100644
--- a/util/fipstools/delocate.go
+++ b/util/fipstools/delocate.go
@@ -804,7 +804,7 @@
return instrPush
}
- case "mov", "movq", "vmovq":
+ case "mov", "movq", "vmovq", "movsd", "vmovsd":
if len(args) == 2 {
return instrMove
}
diff --git a/util/fipstools/testdata/x86_64-GOTRewrite/in.s b/util/fipstools/testdata/x86_64-GOTRewrite/in.s
index 60ef13a..3b7bbfb 100644
--- a/util/fipstools/testdata/x86_64-GOTRewrite/in.s
+++ b/util/fipstools/testdata/x86_64-GOTRewrite/in.s
@@ -23,6 +23,9 @@
cmovneq stderr@GOTPCREL(%rip), %r11
cmovneq foo@GOTPCREL(%rip), %r11
+ movsd foo@GOTPCREL(%rip), %xmm0
+ vmovsd foo@GOTPCREL(%rip), %xmm0
+
# Synthesized symbols do not use the GOT.
movq BORINGSSL_bcm_text_start@GOTPCREL(%rip), %r11
movq foobar_bss_get@GOTPCREL(%rip), %r11
diff --git a/util/fipstools/testdata/x86_64-GOTRewrite/out.s b/util/fipstools/testdata/x86_64-GOTRewrite/out.s
index d38c5ff..6866623 100644
--- a/util/fipstools/testdata/x86_64-GOTRewrite/out.s
+++ b/util/fipstools/testdata/x86_64-GOTRewrite/out.s
@@ -98,6 +98,21 @@
leaq .Lfoo_local_target(%rip), %r11
999:
+# WAS movsd foo@GOTPCREL(%rip), %xmm0
+ leaq -128(%rsp), %rsp
+ pushq %rax
+ leaq .Lfoo_local_target(%rip), %rax
+ movq %rax, %xmm0
+ popq %rax
+ leaq 128(%rsp), %rsp
+# WAS vmovsd foo@GOTPCREL(%rip), %xmm0
+ leaq -128(%rsp), %rsp
+ pushq %rax
+ leaq .Lfoo_local_target(%rip), %rax
+ vmovq %rax, %xmm0
+ popq %rax
+ leaq 128(%rsp), %rsp
+
# Synthesized symbols do not use the GOT.
# WAS movq BORINGSSL_bcm_text_start@GOTPCREL(%rip), %r11
leaq BORINGSSL_bcm_text_start(%rip), %r11