summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/optabs.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/optabs.c')
-rw-r--r--contrib/gcc/optabs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/gcc/optabs.c b/contrib/gcc/optabs.c
index 539b3ad..3b9a23d 100644
--- a/contrib/gcc/optabs.c
+++ b/contrib/gcc/optabs.c
@@ -2591,6 +2591,10 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
goto try_libcall;
}
+ /* We can't widen a bswap. */
+ if (unoptab == bswap_optab)
+ goto try_libcall;
+
if (CLASS_HAS_WIDER_MODES_P (class))
for (wider_mode = GET_MODE_WIDER_MODE (mode);
wider_mode != VOIDmode;
@@ -5253,6 +5257,7 @@ init_optabs (void)
absv_optab = init_optabv (ABS);
addcc_optab = init_optab (UNKNOWN);
one_cmpl_optab = init_optab (NOT);
+ bswap_optab = init_optab (BSWAP);
ffs_optab = init_optab (FFS);
clz_optab = init_optab (CLZ);
ctz_optab = init_optab (CTZ);
@@ -5456,6 +5461,11 @@ init_optabs (void)
init_interclass_conv_libfuncs (trunc_optab, "trunc", MODE_FLOAT, MODE_DECIMAL_FLOAT);
init_interclass_conv_libfuncs (trunc_optab, "trunc", MODE_DECIMAL_FLOAT, MODE_FLOAT);
+ /* Explicitly initialize the bswap libfuncs since we need them to be
+ valid for things other than word_mode. */
+ set_optab_libfunc (bswap_optab, SImode, "__bswapsi2");
+ set_optab_libfunc (bswap_optab, DImode, "__bswapdi2");
+
/* Use cabs for double complex abs, since systems generally have cabs.
Don't define any libcall for float complex, so that cabs will be used. */
if (complex_double_type_node)
OpenPOWER on IntegriCloud