This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: patch: promoting complex modes (plus splitting complex args)


On Tue, Jan 21, 2003 at 01:31:43PM -0800, Aldy Hernandez wrote:
> *** optabs.c	16 Dec 2002 18:19:44 -0000	1.154
> --- optabs.c	21 Jan 2003 19:10:16 -0000

I'm not sure any of this is necessary or correct.  Nothing else
in optabs specially handles promoted operands.  Seems like you're
missing something where the DECL_RTL for the promoted operands
is assigned.

I suspect this could also be seen in the debug info, but I don't
know off-hand exactly what to look for.

> + /* Like gen_realpart, but handle mode inconsistencies.  */
> + rtx
> + gen_convert_realpart (mode, x, unsignedp)

I like these better placed next to convert_modes.

> *************** convert_move (to, from, unsignedp)
> +       f1 = simplify_gen_subreg (GET_MODE_INNER (from_mode), from, from_mode,
> + 				0);
> +       f2 = simplify_gen_subreg (GET_MODE_INNER (from_mode), from, from_mode,
> + 				GET_MODE_UNIT_SIZE (from_mode));
> + 
> +       t1 = simplify_gen_subreg (GET_MODE_INNER (to_mode), to, to_mode, 0);
> +       t2 = simplify_gen_subreg (GET_MODE_INNER (to_mode), to, to_mode,
> + 				GET_MODE_UNIT_SIZE (to_mode));

Should be using gen_realpart/imagpart.

> *************** expand_assignment (to, from, want_value,
> *** 4173,4179 ****
>   	      && GET_MODE (to_rtx) != GET_MODE (value))
>   	    value = convert_memory_address (GET_MODE (to_rtx), value);
>   #endif
> - 	  emit_move_insn (to_rtx, value);
> + 	  /* A promoted complex may have the wrong mode.  Convert it's
> + 	     mode rather than aborting in emit_move_insn.  */
> + 	  if (GET_MODE (to_rtx) != GET_MODE (value))
> + 	    convert_move (to_rtx, value, TREE_UNSIGNED (TREE_TYPE (to)));
> + 	  else
> + 	    emit_move_insn (to_rtx, value);

May also be unnecessary if the PARAM_DECL issue is fixed.

>       case REALPART_EXPR:
>         op0 = expand_expr (TREE_OPERAND (exp, 0), 0, VOIDmode, 0);
> ! 
> !       return gen_convert_realpart (mode, op0, TREE_UNSIGNED (TREE_TYPE (exp)));
>   
>       case IMAGPART_EXPR:
>         op0 = expand_expr (TREE_OPERAND (exp, 0), 0, VOIDmode, 0);
> ! 
> !       return gen_convert_imagpart (mode, op0, TREE_UNSIGNED (TREE_TYPE (exp)));

Likewise.

> +   if (TARGET_64BIT && DEFAULT_ABI == ABI_AIX
> +       && GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
> +       && TARGET_HARD_FLOAT)
> +     /* Promote all complex floats to DCmode.  */
> +     return gen_rtx_REG (DCmode, FP_ARG_RETURN);

Wrong for TCmode.



r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]