diff options
author | Sebastian Perta <sebastian.perta@renesas.com> | 2017-10-14 00:33:58 +0000 |
---|---|---|
committer | DJ Delorie <dj@gcc.gnu.org> | 2017-10-13 20:33:58 -0400 |
commit | a0bf6cf784e56448d81d144f83eaaf90a9fe83b7 (patch) | |
tree | 40fcdea8010a8fa679256d58b1bd874e7c47285c /gcc | |
parent | 41841c3269593d1a308ea0bd4992e6c073f2ce63 (diff) | |
download | gcc-a0bf6cf784e56448d81d144f83eaaf90a9fe83b7.zip gcc-a0bf6cf784e56448d81d144f83eaaf90a9fe83b7.tar.gz gcc-a0bf6cf784e56448d81d144f83eaaf90a9fe83b7.tar.bz2 |
rl78.c (rl78_emit_libcall): New function.
[gcc]
* config/rl78/rl78.c (rl78_emit_libcall): New function.
* config/rl78/rl78-protos.h (rl78_emit_libcall): New function.
* config/rl78/rl78.md: New define_expand "adddi3".
[libgcc]
* config/rl78/adddi3.S: New assembly file.
* config/rl78/t-rl78: Added adddi3.S to LIB2ADD.
From-SVN: r253748
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/rl78/rl78-protos.h | 10 | ||||
-rw-r--r-- | gcc/config/rl78/rl78.c | 39 | ||||
-rw-r--r-- | gcc/config/rl78/rl78.md | 10 |
4 files changed, 65 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5134120..749b754 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-10-13 Sebastian Perta <sebastian.perta@renesas.com> + + * config/rl78/rl78.c (rl78_emit_libcall): New function. + * config/rl78/rl78-protos.h (rl78_emit_libcall): New function. + * config/rl78/rl78.md: New define_expand "adddi3". + 2017-10-13 Jan Hubicka <hubicka@ucw.cz> * cfghooks.c (verify_flow_info): Disable check that all probabilities diff --git a/gcc/config/rl78/rl78-protos.h b/gcc/config/rl78/rl78-protos.h index a155df6..976bffa 100644 --- a/gcc/config/rl78/rl78-protos.h +++ b/gcc/config/rl78/rl78-protos.h @@ -54,3 +54,13 @@ void rl78_output_aligned_common (FILE *, tree, const char *, int, int, int); int rl78_one_far_p (rtx *operands, int num_operands); + +#ifdef RTX_CODE +#ifdef HAVE_MACHINE_MODES + +rtx rl78_emit_libcall (const char*, enum rtx_code, + enum machine_mode, enum machine_mode, + int, rtx*); + +#endif +#endif diff --git a/gcc/config/rl78/rl78.c b/gcc/config/rl78/rl78.c index 6b13a80..c835dc0 100644 --- a/gcc/config/rl78/rl78.c +++ b/gcc/config/rl78/rl78.c @@ -4791,6 +4791,45 @@ rl78_addsi3_internal (rtx * operands, unsigned int alternative) } } +rtx +rl78_emit_libcall (const char *name, enum rtx_code code, + enum machine_mode dmode, enum machine_mode smode, + int noperands, rtx *operands) +{ + rtx ret; + rtx_insn *insns; + rtx libcall; + rtx equiv; + + start_sequence (); + libcall = gen_rtx_SYMBOL_REF (Pmode, name); + + switch (noperands) + { + case 2: + ret = emit_library_call_value (libcall, NULL_RTX, LCT_CONST, + dmode, operands[1], smode); + equiv = gen_rtx_fmt_e (code, dmode, operands[1]); + break; + + case 3: + ret = emit_library_call_value (libcall, NULL_RTX, + LCT_CONST, dmode, + operands[1], smode, operands[2], + smode); + equiv = gen_rtx_fmt_ee (code, dmode, operands[1], operands[2]); + break; + + default: + gcc_unreachable (); + } + + insns = get_insns (); + end_sequence (); + emit_libcall_block (insns, operands[0], ret, equiv); + return ret; +} + #undef TARGET_PREFERRED_RELOAD_CLASS #define TARGET_PREFERRED_RELOAD_CLASS rl78_preferred_reload_class diff --git a/gcc/config/rl78/rl78.md b/gcc/config/rl78/rl78.md index 722d984..105d9be 100644 --- a/gcc/config/rl78/rl78.md +++ b/gcc/config/rl78/rl78.md @@ -224,6 +224,16 @@ DONE;" ) +(define_expand "adddi3" + [(set (match_operand:DI 0 "nonimmediate_operand" "") + (plus:DI (match_operand:DI 1 "general_operand" "") + (match_operand:DI 2 "general_operand" ""))) + ] + "" + "rl78_emit_libcall (\"__adddi3\", PLUS, DImode, DImode, 3, operands); + DONE;" +) + (define_insn "addsi3_internal_virt" [(set (match_operand:SI 0 "nonimmediate_operand" "=v,&vm, vm") (plus:SI (match_operand:SI 1 "general_operand" "0, vim, vim") |