Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(815)

Unified Diff: gcc/gcc/config/i386/i386.md

Issue 6304009: [gcc] Replace rsp/rbp mov source with esp/ebp (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git@master
Patch Set: ready for code review Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/gcc/config/i386/i386.md
diff --git a/gcc/gcc/config/i386/i386.md b/gcc/gcc/config/i386/i386.md
index 1192ce660cca30b2e908dd0569f687f6dfd27d41..93223b29ebb7192f3c997a8b274cdd7f4b84a61e 100644
--- a/gcc/gcc/config/i386/i386.md
+++ b/gcc/gcc/config/i386/i386.md
@@ -2423,24 +2423,35 @@
return "mov{l}\t{%k1, %k0|%k0, %k1}";
else if (which_alternative == 2)
return "movabs{q}\t{%1, %0|%0, %1}";
- else if (!TARGET_NACL)
- return "mov{q}\t{%1, %0|%0, %1}";
- else if (REGNO (operands[0]) == SP_REG)
- {
- if (REGNO (operands[1]) == BP_REG)
- return "mov{q}\t{%1, %0|%0, %1}";
- else
- return "naclrestsp\t{%k1, %%r15|%%r15, %k1}";
- }
- else if (REGNO (operands[0]) == BP_REG)
+ if (TARGET_NACL)
{
- if (REGNO (operands[1]) == SP_REG)
- return "mov{q}\t{%1, %0|%0, %1}";
- else
- return "naclrestbp\t{%k1, %%r15|%%r15, %k1}";
+ /* Set RSP. */
+ if (REG_P (operands[0]) && REGNO (operands[0]) == SP_REG)
+ if (!(REG_P (operands[1]) && REGNO (operands[1]) == BP_REG))
+ return "naclrestsp\t{%k1, %%r15|%%r15, %k1}";
+
+ /* Set RBP. */
+ if (REG_P (operands[0]) && REGNO (operands[0]) == BP_REG)
+ if (!(REG_P (operands[1]) && REGNO (operands[1]) == SP_REG))
+ return "naclrestbp\t{%k1, %%r15|%%r15, %k1}";
+
+ /* Get RSP. */
+ if (REG_P (operands[1]) && REGNO (operands[1]) == SP_REG)
+ {
+ gcc_assert (REG_P (operands[0]));
+ if (REGNO (operands[0]) != BP_REG)
+ return "mov{l}\t{%k1, %k0|%k0, %k1}";
+ }
+
+ /* Get RBP. */
+ if (REG_P (operands[1]) && REGNO (operands[1]) == BP_REG)
+ {
+ gcc_assert (REG_P (operands[0]));
+ if (REGNO (operands[0]) != SP_REG)
+ return "mov{l}\t{%k1, %k0|%k0, %k1}";
+ }
}
- else
- return "mov{q}\t{%1, %0|%0, %1}";
+ return "mov{q}\t{%1, %0|%0, %1}";
}
}
[(set (attr "type")
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698