• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisión700904331bba3e9d0675f57ef011a68a7262c96e (tree)
Tiempo2022-11-23 18:25:34
AutorYoshinori Sato <yo-satoh@sios...>
CommiterYoshinori Sato

Log Message

wip: rx pic

Signed-off-by: Yoshinori Sato <yo-satoh@sios.com>

Cambiar Resumen

Diferencia incremental

--- a/gcc/config/rx/rx.md
+++ b/gcc/config/rx/rx.md
@@ -470,7 +470,10 @@
470470
471471 if (! rx_call_operand (dest, Pmode))
472472 dest = force_reg (Pmode, dest);
473- emit_call_insn (gen_call_value_internal (operands[0], dest));
473+ if (!flag_pic || !(GET_CODE (dest) == SYMBOL_REF && !SYMBOL_REF_LOCAL_P (dest)))
474+ emit_call_insn (gen_call_value_internal (operands[0], dest));
475+ else
476+ emit_call_insn (gen_call_value_pcrel (operands[0], dest));
474477 DONE;
475478 }
476479 )
@@ -2998,3 +3001,25 @@
29983001 return "mvfc\tpc,%0\n\tadd\t#_GLOBAL_OFFSET_TABLE_,%0";
29993002 }
30003003 )
3004+
3005+(define_expand "call_value_pcrel"
3006+ [(set (match_operand 0 "register_operand" "=r,r")
3007+ (call (mem:QI (match_operand:SI 1 "rx_call_operand" "r,CALL_OP_SYMBOL_REF"))
3008+ (const_int 0)))
3009+ (clobber (reg:CC CC_REG))]
3010+ ""
3011+{
3012+ rtx gotoffsym;
3013+ rtx t = (!can_create_pseudo_p ()
3014+ ? operands[0]
3015+ : gen_reg_rtx (GET_MODE (operands[0])));
3016+
3017+ rtx picreg = gen_rtx_REG (Pmode, PIC_REG);
3018+
3019+ gotoffsym = gen_sym2GOTOFF (operands[1]);
3020+ emit_move_insn (t, gotoffsym);
3021+ emit_move_insn (operands[0], t);
3022+ emit_insn(gen_mov_from_rirb(operands[0], picreg));
3023+ emit_call_insn (gen_call_internal (operands[0]));
3024+ DONE;
3025+})