On 9/29/25 8:01 AM, Yoshinori Sato wrote:
gcc/ChangeLog:
* config/rx/predicates.md (rx_plt_call_operand): New predicate.
* config/rx/rx.md (PIC_REG): New constant.
(UNSPEC_PIC): Likewise.
(UNSPEC_GOT): Likewise.
(UNSPEC_GOTOFF): Likewise.
(UNSPEC_PLT): Likewise.
(UNSPEC_GOTFUNCDESC): Likewise.
(UNSPEC_GOTOFFFUNCDESC): Likewise.
(UNSPEC_PCOFFSET): Likewise.
(UNSPEC_PIC_RESTORE): Likewise.
(UNSPEC_PC_LOCATION): Likewise.
(tablejump): Use relative in pic case.
(call): Add FDPIC call.
(call_value): Likewise.
(call_internal): Add use PICREG.
(call_value_internal): Likewise.
(mov<register_modes:mode>): Generate got reference code in pic.
(addsi3): Generate got reference code in pic.
(sym2GOT): New.
(sym2GOTreg): New.
(sym2GOTOFF): New.
(sym2GOTOFFreg): New.
(sym2GOTFUNCDESC): New.
(sym2GOTFUNCDESCreg): New.
(sym2GOTOFFFUNCDESC): New.
(sym2GOTOFFFUNCDESCreg): New.
(sym2PLT): New.
(call_fdpic): New.
(call_internal_fd): New.
(call_internal_plt): New.
(call_value_fdpic): New.
(call_value_internal_fd): New.
(call_value_internal_plt): New.
(pcoffset_label): New.
(set_got): New.
(load_pc_location): New.
Signed-off-by: Yoshinori Sato <[email protected]>
No technical concerns so far. Just the high level need to convert the
port to LRA (which obviously would be an independent patch) and
formatting stuff.
@@ -342,9 +353,9 @@
(match_operand:SI 0 "register_operand" "r"))
(use (label_ref (match_operand 1 "" "")))]
""
- { return TARGET_PID ? (TARGET_AS100_SYNTAX ? "\n?:\tbra\t%0"
- : "\n1:\tbra\t%0")
- : "\n1:jmp\t%0";
+ { return TARGET_PID || flag_pic ? (TARGET_AS100_SYNTAX ? "\n?:\tbra\t%0"
+ : "\n1:\tbra\t%0")
+ : "\n1:jmp\t%0";
}
[(set_attr "timings" "33")
(set_attr "length" "2")]
Generally we try to keep lines wrapped at 80 columns. This blows
through that pretty badly and needs to be cleaned up. Also note we do
not generally include code on the same line as an open or close bracket.
I realize you were merely changing the existing code which was written
that way, but if you could fix it it'd be greatly appreciated.
+ else
+ {
+ emit_call_insn (gen_call_fdpic(operands[0], operands[1], operands[2]));
+ }
Space between the function name and its argument list. THis may need
wrapping as it's likely at or past the 80 column limit. > ""
{
rtx dest = XEXP (operands[1], 0);
- if (! rx_call_operand (dest, Pmode))
- dest = force_reg (Pmode, dest);
- emit_call_insn (gen_call_value_internal (operands[0], dest));
+ if (!TARGET_FDPIC ||
+ (SYMBOL_REF_P(dest) && SYMBOL_REF_LOCAL_P(dest)))
Bring the "||" down to the next line and indent it just inside the outer
paren from the previous line
if (!TARGET_FDPIC
|| SYMBOL_REF_P (dest) ...
You need a space between the macro invocation and its argument list,
just like function calls. This is a recurring problem. Please review
all 4 patches and update appropriately. I'm not going to call this out
every time I see it.
+ {
+ if (! rx_call_operand (dest, Pmode))
+ dest = force_reg (Pmode, dest);
+ emit_call_insn (gen_call_value_internal (operands[0], dest));
+ }
+ else
+ {
+ emit_call_insn (gen_call_value_fdpic(operands[0], operands[1],
operands[2]));
Space between function name and argument list. This certainly needs
wrapping as it's > 80 columns.
rtx_insn t = gen_call_value_fdpic (operands[0],
operands[1],
operands[2]);
emit_call_insn (t);
Or something like that would be acceptable.
Jeff