From: Richard Kenner Date: Sat, 10 Dec 1994 21:57:40 +0000 (-0500) Subject: (cmpsi): Make this into a define_expand; legitimize PIC addresses if necessary. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f723f6ef7b01c433f92430d1626aa7b56d34c3eb;p=gcc.git (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 --- diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md index cfb5704f0eb..f71e9edf708 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,>")))]