if (TARGET_PA_20)
return (length + 32);
+ if (!TARGET_NO_SPACE_REGS)
+ length += 8;
+
if (!sibcall)
length += 8;
- return (length + 40);
+ return (length + 32);
}
}
}
if (!sibcall && !TARGET_PA_20)
{
output_asm_insn ("{bl|b,l} .+8,%%r2", xoperands);
- output_asm_insn ("addi 16,%%r2,%%r2", xoperands);
+ if (TARGET_NO_SPACE_REGS)
+ output_asm_insn ("addi 8,%%r2,%%r2", xoperands);
+ else
+ output_asm_insn ("addi 16,%%r2,%%r2", xoperands);
}
}
}
else
{
- output_asm_insn ("ldsid (%%r1),%%r31\n\tmtsp %%r31,%%sr0",
- xoperands);
+ if (!TARGET_NO_SPACE_REGS)
+ output_asm_insn ("ldsid (%%r1),%%r31\n\tmtsp %%r31,%%sr0",
+ xoperands);
if (sibcall)
- output_asm_insn ("be 0(%%sr0,%%r1)", xoperands);
+ {
+ if (TARGET_NO_SPACE_REGS)
+ output_asm_insn ("be 0(%%sr4,%%r1)", xoperands);
+ else
+ output_asm_insn ("be 0(%%sr0,%%r1)", xoperands);
+ }
else
{
- output_asm_insn ("ble 0(%%sr0,%%r1)", xoperands);
+ if (TARGET_NO_SPACE_REGS)
+ output_asm_insn ("ble 0(%%sr4,%%r1)", xoperands);
+ else
+ output_asm_insn ("ble 0(%%sr0,%%r1)", xoperands);
if (indirect_call)
output_asm_insn ("stw %%r31,-24(%%sp)", xoperands);
pa_output_function_prologue (file, 0);
if (VAL_14_BITS_P (delta))
{
- if (! TARGET_64BIT && ! TARGET_PORTABLE_RUNTIME && flag_pic)
+ if (!TARGET_64BIT && !TARGET_PORTABLE_RUNTIME && flag_pic)
{
fprintf (file, "\taddil LT'%s,%%r19\n", lab);
fprintf (file, "\tldw RT'%s(%%r1),%%r22\n", lab);
fprintf (file, "\tdepi 0,31,2,%%r22\n");
fprintf (file, "\tldw 4(%%sr0,%%r22),%%r19\n");
fprintf (file, "\tldw 0(%%sr0,%%r22),%%r22\n");
- fprintf (file, "\tldsid (%%sr0,%%r22),%%r1\n\tmtsp %%r1,%%sr0\n");
- fprintf (file, "\tbe 0(%%sr0,%%r22)\n\tldo ");
+ if (TARGET_NO_SPACE_REGS)
+ fprintf (file, "\tbe 0(%%sr4,%%r22)\n\tldo ");
+ else
+ {
+ fprintf (file, "\tldsid (%%sr0,%%r22),%%r1\n");
+ fprintf (file, "\tmtsp %%r1,%%sr0\n");
+ fprintf (file, "\tbe 0(%%sr0,%%r22)\n\tldo ");
+ }
fprintf (file, HOST_WIDE_INT_PRINT_DEC, delta);
fprintf (file, "(%%r26),%%r26\n");
}
}
else
{
- if (! TARGET_64BIT && ! TARGET_PORTABLE_RUNTIME && flag_pic)
+ if (!TARGET_64BIT && !TARGET_PORTABLE_RUNTIME && flag_pic)
{
fprintf (file, "\taddil L'");
fprintf (file, HOST_WIDE_INT_PRINT_DEC, delta);
fprintf (file, "\tdepi 0,31,2,%%r22\n");
fprintf (file, "\tldw 4(%%sr0,%%r22),%%r19\n");
fprintf (file, "\tldw 0(%%sr0,%%r22),%%r22\n");
- fprintf (file, "\tldsid (%%sr0,%%r22),%%r1\n\tmtsp %%r1,%%sr0\n");
- fprintf (file, "\tbe,n 0(%%sr0,%%r22)\n");
+ if (TARGET_NO_SPACE_REGS)
+ fprintf (file, "\tbe 0(%%sr4,%%r22)");
+ else
+ {
+ fprintf (file, "\tldsid (%%sr0,%%r22),%%r1\n");
+ fprintf (file, "\tmtsp %%r1,%%sr0\n");
+ fprintf (file, "\tbe,n 0(%%sr0,%%r22)\n");
+ }
}
else
{
[(return)
(clobber (reg:SI 1))
(use (reg:SI 2))]
- "flag_pic && current_function_calls_eh_return"
+ "!TARGET_NO_SPACE_REGS && flag_pic && current_function_calls_eh_return"
"ldsid (%%sr0,%%r2),%%r1\;mtsp %%r1,%%sr0\;be%* 0(%%sr0,%%r2)"
[(set_attr "type" "branch")
(set_attr "length" "12")])
/* EH returns bypass the normal return stub. Thus, we must do an
interspace branch to return from functions that call eh_return.
- This is only a problem for returns from shared code. */
- if (flag_pic && current_function_calls_eh_return)
+ This is only a problem for returns from shared code on ports
+ using space registers. */
+ if (!TARGET_NO_SPACE_REGS
+ && flag_pic && current_function_calls_eh_return)
x = gen_return_external_pic ();
else
x = gen_return_internal ();
;;; EH does longjmp's from and within the data section. Thus,
;;; an interspace branch is required for the longjmp implementation.
-;;; Registers r1 and r2 are used as scratch registers for the jump.
+;;; Registers r1 and r2 are used as scratch registers for the jump
+;;; when necessary.
(define_expand "interspace_jump"
[(parallel
[(set (pc) (match_operand 0 "pmode_register_operand" "a"))
(define_insn ""
[(set (pc) (match_operand 0 "pmode_register_operand" "a"))
(clobber (reg:SI 2))]
+ "TARGET_PA_20 && !TARGET_64BIT"
+ "bve%* (%0)"
+ [(set_attr "type" "branch")
+ (set_attr "length" "4")])
+
+(define_insn ""
+ [(set (pc) (match_operand 0 "pmode_register_operand" "a"))
+ (clobber (reg:SI 2))]
+ "TARGET_NO_SPACE_REGS && !TARGET_64BIT"
+ "be%* 0(%%sr4,%0)"
+ [(set_attr "type" "branch")
+ (set_attr "length" "4")])
+
+(define_insn ""
+ [(set (pc) (match_operand 0 "pmode_register_operand" "a"))
+ (clobber (reg:SI 2))]
"!TARGET_64BIT"
"ldsid (%%sr0,%0),%%r2\; mtsp %%r2,%%sr0\; be%* 0(%%sr0,%0)"
[(set_attr "type" "branch")
[(set (pc) (match_operand 0 "pmode_register_operand" "a"))
(clobber (reg:DI 2))]
"TARGET_64BIT"
- "ldsid (%%sr0,%0),%%r2\; mtsp %%r2,%%sr0\; be%* 0(%%sr0,%0)"
+ "bve%* (%0)"
[(set_attr "type" "branch")
- (set_attr "length" "12")])
+ (set_attr "length" "4")])
(define_expand "builtin_longjmp"
[(unspec_volatile [(match_operand 0 "register_operand" "r")] 3)]