+Wed Nov 5 11:27:14 1997 Jim Wilson <wilson@cygnus.com>
+
+ * i386.c (load_pic_register): Call prologue_get_pc_and_set_got.
+ * i386.md (prologue_set_got, prologue_get_pc): Add UNSPEC_VOLATILE
+ to pattern.
+ (prologue_get_pc_and_set_got): New pattern.
+
Tue Nov 4 20:36:50 1997 Richard Henderson (rth@cygnus.com)
* alpha.c (summarize_insn): Handle ASM_OPERANDS. Don't recurse
if (do_rtl)
{
- emit_insn (gen_prologue_get_pc (xops[0], xops[1]));
- emit_insn (gen_pop (xops[0]));
- emit_insn (gen_prologue_set_got
- (xops[0],
- gen_rtx (SYMBOL_REF, Pmode, "$_GLOBAL_OFFSET_TABLE_"),
- xops[1]));
+ /* We can't put a raw CODE_LABEL into the RTL, and we can't emit
+ a new CODE_LABEL after reload, so we need a single pattern to
+ emit the 3 necessary instructions. */
+ emit_insn (gen_prologue_get_pc_and_set_got (xops[0]));
}
else
{
(define_insn "prologue_set_got"
[(set (match_operand:SI 0 "" "")
- (plus:SI (match_dup 0)
- (plus:SI (match_operand:SI 1 "symbolic_operand" "")
- (minus:SI (pc) (match_operand 2 "" "")))))]
+ (unspec_volatile
+ [(plus:SI (match_dup 0)
+ (plus:SI (match_operand:SI 1 "symbolic_operand" "")
+ (minus:SI (pc) (match_operand 2 "" ""))))] 1))]
""
"*
{
(define_insn "prologue_get_pc"
[(set (match_operand:SI 0 "" "")
- (plus:SI (pc) (match_operand 1 "" "")))]
+ (unspec_volatile [(plus:SI (pc) (match_operand 1 "" ""))] 2))]
""
"*
{
RET;
}")
+(define_insn "prologue_get_pc_and_set_got"
+ [(unspec_volatile [(match_operand:SI 0 "" "")] 3)]
+ ""
+ "*
+{
+ operands[1] = gen_label_rtx ();
+ output_asm_insn (AS1 (call,%P1), operands);
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ CODE_LABEL_NUMBER (operands[1]));
+ output_asm_insn (AS1 (pop%L0,%0), operands);
+ output_asm_insn (\"addl $_GLOBAL_OFFSET_TABLE_+[.-%P1],%0\", operands);
+ RET;
+}")
+
(define_expand "epilogue"
[(const_int 1)]
""