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: altivec: vector constant misc


> *************** rs6000_emit_move (dest, source, mode)
> *** 2187,2194 ****
>     /* Handle the case where reload calls us with an invalid address;
>        and the case of CONSTANT_P_RTX.  */
>     if (! general_operand (operands[1], mode)
> !       || ! nonimmediate_operand (operands[0], mode)
> !       || GET_CODE (operands[1]) == CONSTANT_P_RTX)
>       {
>         emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
>         return;
> --- 2210,2218 ----
>     /* Handle the case where reload calls us with an invalid address;
>        and the case of CONSTANT_P_RTX.  */
>     if (! general_operand (operands[1], mode)
> !       || (!VECTOR_MODE_P (mode)
> ! 	  && (! nonimmediate_operand (operands[0], mode)
> ! 	      || GET_CODE (operands[1]) == CONSTANT_P_RTX)))
>       {
>         emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
>         return;
>
> VECTOR_MODE cannot handle CONSTANT_P_RTX and nonimmediate_operand?

we handle that case further below, in the switch, where we check
whether we can emit a constant more efficiently, and if so,
do it one operation.

otherwise, that "if" you have pointed out, will generate:

	(set:VEC (reg:VEC) (const_int blah))

irregardless of if we have an instruction to do so.

btw, i'm revising my patch to remove the (set (reg) (const_int 0))
pattern for vectors in favor of just emit_insn'ing the XOR
directly.  duh.

>
> David
>
>
--
Aldy Hernandez                                E-mail: aldyh@redhat.com
Professional Gypsy Lost in Australia
Red Hat, Inc.


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