aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-12-10 16:57:40 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-12-10 16:57:40 -0500
commitf723f6ef7b01c433f92430d1626aa7b56d34c3eb (patch)
treef2cfb20b4111ff969a2c14c884817f17ff83c74a /gcc
parent4ab3cb6597c6a02d6795975c3abf8f1d4012a8ce (diff)
downloadgcc-f723f6ef7b01c433f92430d1626aa7b56d34c3eb.zip
gcc-f723f6ef7b01c433f92430d1626aa7b56d34c3eb.tar.gz
gcc-f723f6ef7b01c433f92430d1626aa7b56d34c3eb.tar.bz2
(cmpsi): Make this into a define_expand; legitimize PIC addresses if necessary.
(cmpsi): Make this into a define_expand; legitimize PIC addresses if necessary. Old cmpsi code now unnamed define_insn pattern. From-SVN: r8642
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/m68k/m68k.md23
1 files changed, 22 insertions, 1 deletions
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index cfb5704..f71e9ed 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -377,8 +377,29 @@
;; compare instructions.
+;; This is the second "hook" for PIC code (in addition to movsi). See
+;; comment of movsi for a description of PIC handling.
+(define_expand "cmpsi"
+ [(set (cc0)
+ (compare (match_operand:SI 0 "nonimmediate_operand" "")
+ (match_operand:SI 1 "general_operand" "")))]
+ ""
+ "
+{
+ if (flag_pic && symbolic_operand (operands[1], SImode))
+ {
+ /* The source is an address which requires PIC relocation.
+ Call legitimize_pic_address with the source, mode, and a relocation
+ register (a new pseudo, or the final destination if reload_in_progress
+ is set). Then fall through normally */
+ extern rtx legitimize_pic_address();
+ rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
+ operands[1] = legitimize_pic_address (operands[1], SImode, temp);
+ }
+}")
+
;; A composite of the cmp, cmpa, & cmpi m68000 op codes.
-(define_insn "cmpsi"
+(define_insn ""
[(set (cc0)
(compare (match_operand:SI 0 "nonimmediate_operand" "rKs,mr,>")
(match_operand:SI 1 "general_operand" "mr,Ksr,>")))]