diff options
author | m.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-29 03:11:21 +0000 |
---|---|---|
committer | m.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-29 03:11:21 +0000 |
commit | 6cc56c00ba9c06096e9ba6bc4661d1b0501dd194 (patch) | |
tree | f2745ad204745a38a58525098f6c5be5aad7db18 /gcc/config/c4x/c4x.c | |
parent | b9c319d42fef178c82f8c389ea9ccfd6665bfe01 (diff) | |
download | ppe42-gcc-6cc56c00ba9c06096e9ba6bc4661d1b0501dd194.tar.gz ppe42-gcc-6cc56c00ba9c06096e9ba6bc4661d1b0501dd194.zip |
2000-01-29 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
* c4x.h (INIT_TARGET_OPTABS): Add all missing local optab entries.
* c4x.c: Define the optab rtx values.
(c4x_add_gc_roots): Add the ggc roots for these optab rtx values.
(c4x_emit_libcall): Use new optab rtx values.
(c4x_emit_libcall3): Likewise.
(c4x_emit_libcall_mulhi): Likewise.
* c4x-protos.h: Add prototypes for optab rtx values and change
prototypes for above c4x_emit_libcall functions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31683 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/c4x/c4x.c')
-rw-r--r-- | gcc/config/c4x/c4x.c | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c index 5072d234a53..e0051ea8f40 100644 --- a/gcc/config/c4x/c4x.c +++ b/gcc/config/c4x/c4x.c @@ -46,6 +46,17 @@ #include "ggc.h" #include "c4x-protos.h" +rtx smulhi3_libfunc; +rtx umulhi3_libfunc; +rtx fix_truncqfhi2_libfunc; +rtx fixuns_truncqfhi2_libfunc; +rtx fix_trunchfhi2_libfunc; +rtx fixuns_trunchfhi2_libfunc; +rtx floathiqf2_libfunc; +rtx floatunshiqf2_libfunc; +rtx floathihf2_libfunc; +rtx floatunshihf2_libfunc; + static int c4x_leaf_function; static char *float_reg_names[] = FLOAT_REGISTER_NAMES; @@ -163,6 +174,16 @@ c4x_add_gc_roots () ggc_add_tree_root (&pure_tree, 1); ggc_add_tree_root (&noreturn_tree, 1); ggc_add_tree_root (&interrupt_tree, 1); + ggc_add_rtx_root (&smulhi3_libfunc, 1); + ggc_add_rtx_root (&umulhi3_libfunc, 1); + ggc_add_rtx_root (&fix_truncqfhi2_libfunc, 1); + ggc_add_rtx_root (&fixuns_truncqfhi2_libfunc, 1); + ggc_add_rtx_root (&fix_trunchfhi2_libfunc, 1); + ggc_add_rtx_root (&fixuns_trunchfhi2_libfunc, 1); + ggc_add_rtx_root (&floathiqf2_libfunc, 1); + ggc_add_rtx_root (&floatunshiqf2_libfunc, 1); + ggc_add_rtx_root (&floathihf2_libfunc, 1); + ggc_add_rtx_root (&floatunshihf2_libfunc, 1); } @@ -1237,8 +1258,8 @@ c4x_emit_move_sequence (operands, mode) void -c4x_emit_libcall (name, code, dmode, smode, noperands, operands) - const char *name; +c4x_emit_libcall (libcall, code, dmode, smode, noperands, operands) + rtx libcall; enum rtx_code code; enum machine_mode dmode; enum machine_mode smode; @@ -1247,13 +1268,9 @@ c4x_emit_libcall (name, code, dmode, smode, noperands, operands) { rtx ret; rtx insns; - rtx libcall; rtx equiv; start_sequence (); - if (ggc_p) - name = ggc_alloc_string (name, -1); - libcall = gen_rtx_SYMBOL_REF (Pmode, name); switch (noperands) { case 2: @@ -1279,30 +1296,28 @@ c4x_emit_libcall (name, code, dmode, smode, noperands, operands) void -c4x_emit_libcall3 (name, code, mode, operands) - const char *name; +c4x_emit_libcall3 (libcall, code, mode, operands) + rtx libcall; enum rtx_code code; enum machine_mode mode; rtx *operands; { - return c4x_emit_libcall (name, code, mode, mode, 3, operands); + return c4x_emit_libcall (libcall, code, mode, mode, 3, operands); } void -c4x_emit_libcall_mulhi (name, code, mode, operands) - char *name; +c4x_emit_libcall_mulhi (libcall, code, mode, operands) + rtx libcall; enum rtx_code code; enum machine_mode mode; rtx *operands; { rtx ret; rtx insns; - rtx libcall; rtx equiv; start_sequence (); - libcall = gen_rtx_SYMBOL_REF (Pmode, name); ret = emit_library_call_value (libcall, NULL_RTX, 1, mode, 2, operands[1], mode, operands[2], mode); equiv = gen_rtx_TRUNCATE (mode, @@ -2329,8 +2344,8 @@ c4x_shiftable_constant (op) break; } mask = ((0xffff >> i) << 16) | 0xffff; - if (IS_INT16_CONST (val & 0x80000000 ? (val >> i) | ~mask - : (val >> i) & mask)) + if (IS_INT16_CONST (val & (1 << 31) ? (val >> i) | ~mask + : (val >> i) & mask)) return i; return -1; } @@ -3000,7 +3015,6 @@ std_reg_operand (op, mode) return REG_P (op) && IS_STD_OR_PSEUDO_REG (op); } - /* Standard precision or normal register. */ int |