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: Add SSE4.1 support


On Fri, Apr 20, 2007 at 12:00:59PM -0700, H. J. Lu wrote:
> +	      error ("the third argument be a 4bit immediate");
> +	      error ("the third argument be a 8bit immediate");
> +		error ("the second argument be a 2bit immediate");
> +		error ("the second argument be a 4bit immediate");

s/be/must be/
s/bit/-bit/

>  (define_insn "*movsi_1"
>    [(set (match_operand:SI 0 "nonimmediate_operand"
> -			"=r  ,m  ,*y,*y,?rm,?*y,*x,*x,?r ,m ,?*Yi,*x")
> +			"=r  ,m  ,*y,*y,?rm,?*y,*x,*x,?r ,m ,?*Yi,*x,?r ")
>  	(match_operand:SI 1 "general_operand"
> -			"rinm,rin,C ,*y,*y ,rm ,C ,*x,*Yi,*x,r   ,m "))]
> +			"rinm,rin,C ,*y,*y ,rm ,C ,*x,*Yi,*x,r   ,m ,*Y4"))]
>    "!(MEM_P (operands[0]) && MEM_P (operands[1]))"
>  {
>    switch (get_attr_type (insn))
>      {
> +    case TYPE_SSELOG:
> +      return "pextrd\t{$0, %1, %0|%0, %1, $0}";

Do not do this.  We already have an interunit move alternative,
and it uses movd.

> +#define _MM_EXTRACT_FLOAT(D, S, N) \
> +  { (D) = __builtin_ia32_extractps128 ((__v4sf)(S), (N)); }

You want (), not {} here, I think.

> +  "pmuldq\t{%2, %0|%0, %2}"
> +  [(set_attr "type" "sseimul")
> +   (set_attr "mode" "TI")])

Surely you're going to need to touch the length attribute, 
or at least one of the prefix sub-attributes for these new
2 and 3 byte opcodes?

> +;; FIXME: The old SSE2 expander is no longer available.
>  (define_expand "umaxv8hi3"

You'd better fix that then.  It should be a matter of 3 or 4 lines
of code to call the existing us_minus:V8HI and plus:V8HI patterns.


r~


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