From 069b07bf95a4a461cf593044cdae7ba1fbdfb984 Mon Sep 17 00:00:00 2001 From: bje Date: Sun, 18 Dec 2005 21:40:47 +0000 Subject: * optabs.c (init_floating_libfuncs): Handle decimal float modes. (init_optabs): Handle libfuncs for decimal float. * genopinit.c (gen_insn): Handle MODE_DECIMAL_FLOAT. * stor-layout.c (int_mode_for_mode): Likewise. * simplify-rtx.c (simplify_immed_subreg): Likewise. (simplify_unary_operation_1): Skip optimisations for decimal float modes. * varasm.c (output_constant_pool_2): Handle MODE_DECIMAL_FLOAT. * emit-rtl.c (gen_const_vector): Add assertion check. (init_emit_once): Populate const_tiny_rtx with constants in each decimal float mode. * expmed.c (extract_high_half, expand_mult_highpart_optab, expand_mult_highpart): Assert that mode is not a scalar float mode. * expr.c (convert_move): Handle conversion between decimal and binary floats of the same size. * convert.c (convert_to_real): Consider decimal float types when folding. * dwarf2out.c (base_type_die): Use DW_ATE_decimal_float to describe decimal floating point types. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108762 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/expr.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gcc/expr.c') diff --git a/gcc/expr.c b/gcc/expr.c index df86a57ee18..322db4ff273 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -410,10 +410,15 @@ convert_move (rtx to, rtx from, int unsignedp) rtx value, insns; convert_optab tab; - gcc_assert (GET_MODE_PRECISION (from_mode) - != GET_MODE_PRECISION (to_mode)); + gcc_assert ((GET_MODE_PRECISION (from_mode) + != GET_MODE_PRECISION (to_mode)) + || (DECIMAL_FLOAT_MODE_P (from_mode) + != DECIMAL_FLOAT_MODE_P (to_mode))); - if (GET_MODE_PRECISION (from_mode) < GET_MODE_PRECISION (to_mode)) + if (GET_MODE_PRECISION (from_mode) == GET_MODE_PRECISION (to_mode)) + /* Conversion between decimal float and binary float, same size. */ + tab = DECIMAL_FLOAT_MODE_P (from_mode) ? trunc_optab : sext_optab; + else if (GET_MODE_PRECISION (from_mode) < GET_MODE_PRECISION (to_mode)) tab = sext_optab; else tab = trunc_optab; -- cgit v1.2.3