Commit f723f6ef by Richard Kenner

(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
parent 4ab3cb65
......@@ -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,>")))]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment