[aarch64-port-dev ] Correct register usage in string comparisons
Andrew Haley
aph at redhat.com
Thu Jul 3 15:06:51 UTC 2014
Oh, bah.
It turns out that TEMP registers in C2 instructions can overlap with an
output operand. I think I knew this before, but forgot. It's very
annoying.
Andrew.
# HG changeset patch
# User aph
# Date 1404399858 -3600
# Thu Jul 03 16:04:18 2014 +0100
# Node ID e5a77099a6fac7ab88ddbbe0fb5e0980161cb05c
# Parent 5e653c9bf2aa9baa4ed326c9be7c4233462144ea
Correct register usage in string comparisons
diff -r 5e653c9bf2aa -r e5a77099a6fa src/cpu/aarch64/vm/aarch64.ad
--- a/src/cpu/aarch64/vm/aarch64.ad Thu Jul 03 13:19:59 2014 +0100
+++ b/src/cpu/aarch64/vm/aarch64.ad Thu Jul 03 16:04:18 2014 +0100
@@ -11334,10 +11334,10 @@
%}
instruct string_compare(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2,
- iRegI_R0 result, iRegP tmp1, rFlagsReg cr)
+ iRegI_R0 result, iRegP_R10 tmp1, rFlagsReg cr)
%{
match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
- effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
+ effect(KILL tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result # KILL $tmp1" %}
ins_encode %{
@@ -11349,10 +11349,10 @@
%}
instruct string_equals(iRegP_R1 str1, iRegP_R3 str2, iRegI_R4 cnt,
- iRegI_R0 result, iRegP tmp, rFlagsReg cr)
+ iRegI_R0 result, iRegP_R10 tmp, rFlagsReg cr)
%{
match(Set result (StrEquals (Binary str1 str2) cnt));
- effect(TEMP tmp, USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL cr);
+ effect(KILL tmp, USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL cr);
format %{ "String Equals $str1,$str2,$cnt -> $result // KILL $tmp" %}
ins_encode %{
More information about the aarch64-port-dev
mailing list