public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, ARM, iWMMXt][1/5]: ARM code generic change
@ 2011-07-06 10:24 Xinyu Qi
  2011-07-12 22:45 ` Ramana Radhakrishnan
  0 siblings, 1 reply; 12+ messages in thread
From: Xinyu Qi @ 2011-07-06 10:24 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 460 bytes --]

Hi,

It is the first part of iWMMXt maintenance.

*config/arm/arm.c (arm_option_override):
 Enable iWMMXt with VFP. iWMMXt and NEON are incompatible. iWMMXt unsupported under Thumb-2 mode.
 (arm_expand_binop_builtin): Accept immediate op (with mode VOID)
*config/arm/arm.md:
 Resettle include location of iwmmxt.md so that *arm_movdi and *arm_movsi_insn could be used when iWMMXt is enabled.
 Add pipeline description file include.

Thanks,
Xinyu

[-- Attachment #2: 1_generic.diff --]
[-- Type: application/octet-stream, Size: 3066 bytes --]

Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	(revision 175285)
+++ gcc/config/arm/arm.c	(working copy)
@@ -1605,12 +1605,15 @@ arm_option_override (void)
     }
 
   /* FPA and iWMMXt are incompatible because the insn encodings overlap.
-     VFP and iWMMXt can theoretically coexist, but it's unlikely such silicon
-     will ever exist.  GCC makes no attempt to support this combination.  */
-  if (TARGET_IWMMXT && !TARGET_SOFT_FLOAT)
-    sorry ("iWMMXt and hardware floating point");
+     VFP and iWMMXt however can coexist.  */
+  if (TARGET_IWMMXT && TARGET_HARD_FLOAT && !TARGET_VFP)
+    sorry ("iWMMXt and non-VFP floating point unit");
+
+  /* iWMMXt and NEON are incompatible.  */
+  if (TARGET_IWMMXT && TARGET_NEON)
+    sorry ("iWMMXt and NEON");
 
-  /* ??? iWMMXt insn patterns need auditing for Thumb-2.  */
+  /* iWMMXt unsupported under Thumb-2 mode.  */
   if (TARGET_THUMB2 && TARGET_IWMMXT)
     sorry ("Thumb-2 iWMMXt");
 
@@ -19313,7 +19316,8 @@ arm_expand_binop_builtin (enum insn_code
       || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
     target = gen_reg_rtx (tmode);
 
-  gcc_assert (GET_MODE (op0) == mode0 && GET_MODE (op1) == mode1);
+  gcc_assert ((GET_MODE (op0) == mode0 || GET_MODE (op0) == VOIDmode)
+	      && (GET_MODE (op1) == mode1 || GET_MODE (op1) == VOIDmode));
 
   if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
     op0 = copy_to_mode_reg (mode0, op0);
Index: gcc/config/arm/arm.md
===================================================================
--- gcc/config/arm/arm.md	(revision 175285)
+++ gcc/config/arm/arm.md	(working copy)
@@ -535,6 +535,10 @@ (define_attr "generic_vfp" "yes,no"
 (include "cortex-m4.md")
 (include "cortex-m4-fpu.md")
 (include "vfp11.md")
+(include "marvell-f-iwmmxt.md")
+
+;; Load the Intel Wireless Multimedia Extension patterns
+(include "iwmmxt.md")
 
 \f
 ;;---------------------------------------------------------------------------
@@ -4969,7 +4973,6 @@ (define_insn "*arm_movdi"
 	(match_operand:DI 1 "di_operand"              "rDa,Db,Dc,mi,r"))]
   "TARGET_32BIT
    && !(TARGET_HARD_FLOAT && (TARGET_MAVERICK || TARGET_VFP))
-   && !TARGET_IWMMXT
    && (   register_operand (operands[0], DImode)
        || register_operand (operands[1], DImode))"
   "*
@@ -5237,7 +5240,7 @@ (define_insn "*arm_movt"
 (define_insn "*arm_movsi_insn"
   [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,r,rk,m")
 	(match_operand:SI 1 "general_operand"      "rk, I,K,j,mi,rk"))]
-  "TARGET_ARM && ! TARGET_IWMMXT
+  "TARGET_ARM
    && !(TARGET_HARD_FLOAT && TARGET_VFP)
    && (   register_operand (operands[0], SImode)
        || register_operand (operands[1], SImode))"
@@ -10842,8 +10845,6 @@ (define_expand "bswapsi2"
 (include "cirrus.md")
 ;; Vector bits common to IWMMXT and Neon
 (include "vec-common.md")
-;; Load the Intel Wireless Multimedia Extension patterns
-(include "iwmmxt.md")
 ;; Load the VFP co-processor patterns
 (include "vfp.md")
 ;; Thumb-2 patterns

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, ARM, iWMMXt][1/5]: ARM code generic change
  2011-07-06 10:24 [PATCH, ARM, iWMMXt][1/5]: ARM code generic change Xinyu Qi
@ 2011-07-12 22:45 ` Ramana Radhakrishnan
  2011-07-14  7:38   ` Xinyu Qi
  0 siblings, 1 reply; 12+ messages in thread
From: Ramana Radhakrishnan @ 2011-07-12 22:45 UTC (permalink / raw)
  To: Xinyu Qi; +Cc: gcc-patches

On 06/07/11 11:11, Xinyu Qi wrote:
> Hi,
>
> It is the first part of iWMMXt maintenance.
>
> *config/arm/arm.c (arm_option_override):
>   Enable iWMMXt with VFP. iWMMXt and NEON are incompatible. iWMMXt unsupported under Thumb-2 mode.
>   (arm_expand_binop_builtin): Accept immediate op (with mode VOID)
> *config/arm/arm.md:
>   Resettle include location of iwmmxt.md so that *arm_movdi and *arm_movsi_insn could be used when iWMMXt is enabled.

With the current work in trunk to handle enabled attributes and
per-alternative predicable attributes (Thanks Bernd) we should be able
to get rid of
*cond_iwmmxt_movsi_insn"  in iwmmxt.md file. It's not a matter for
this patch but for a follow-up patch.

Actually we should probably do the same for the various insns that
are dotted around all over the place with final conditions that prevent
matching - atleast makes the backend description slightly smaller :).

>   Add pipeline description file include.

It is enough to say

 (<filename>): Include.

in the changelog entry.

The include for the pipeline description file should be with the patch
that you add this in i.e. patch #5. Please add this to MD_INCLUDES in
t-arm as well.

Also as a general note, please provide a correct Changelog entry.

This is not the format that we expect Changelog entries to be in.
Please look at the coding standards on the website for this or at
other patches submitted with respect to Changelog entries. Please fix
this for each patch in the patch stack.


cheers
Ramana

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH, ARM, iWMMXt][1/5]: ARM code generic change
  2011-07-12 22:45 ` Ramana Radhakrishnan
@ 2011-07-14  7:38   ` Xinyu Qi
  2011-08-18  2:21     ` Ramana Radhakrishnan
  2011-12-14 17:03     ` Richard Earnshaw
  0 siblings, 2 replies; 12+ messages in thread
From: Xinyu Qi @ 2011-07-14  7:38 UTC (permalink / raw)
  To: Ramana Radhakrishnan, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1944 bytes --]

> > Hi,
> >
> > It is the first part of iWMMXt maintenance.
> >
> > *config/arm/arm.c (arm_option_override):
> >   Enable iWMMXt with VFP. iWMMXt and NEON are incompatible. 
> iWMMXt unsupported under Thumb-2 mode.
> >   (arm_expand_binop_builtin): Accept immediate op (with mode VOID)
> > *config/arm/arm.md:
> >   Resettle include location of iwmmxt.md so that *arm_movdi 
> and *arm_movsi_insn could be used when iWMMXt is enabled.
> 
> With the current work in trunk to handle enabled attributes 
> and per-alternative predicable attributes (Thanks Bernd) we 
> should be able to get rid of *cond_iwmmxt_movsi_insn"  in 
> iwmmxt.md file. It's not a matter for this patch but for a 
> follow-up patch.
> 
> Actually we should probably do the same for the various insns 
> that are dotted around all over the place with final 
> conditions that prevent matching - atleast makes the backend 
> description slightly smaller :).
> 
> >   Add pipeline description file include.
> 
> It is enough to say
> 
>  (<filename>): Include.
> 
> in the changelog entry.
> 
> The include for the pipeline description file should be with 
> the patch that you add this in i.e. patch #5. Please add this 
> to MD_INCLUDES in t-arm as well.
> 
> Also as a general note, please provide a correct Changelog entry.
> 
> This is not the format that we expect Changelog entries to be in.
> Please look at the coding standards on the website for this 
> or at other patches submitted with respect to Changelog 
> entries. Please fix this for each patch in the patch stack.
> 
> 
> cheers
> Ramana

Thanks for reviewing. I have updated the patches and the Changelog.

*config/arm/arm.c (arm_option_override): Enable iWMMXt with VFP.
 (arm_expand_binop_builtin): Accept VOIDmode op.
*config/arm/arm.md (*arm_movdi, *arm_movsi_insn): Remove condition !TARGET_IWMMXT.
 (iwmmxt.md): Include location.

Thanks,
Xinyu

[-- Attachment #2: 1_generic.diff --]
[-- Type: application/octet-stream, Size: 3024 bytes --]

Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	(revision 175285)
+++ gcc/config/arm/arm.c	(working copy)
@@ -1605,12 +1605,15 @@ arm_option_override (void)
     }
 
   /* FPA and iWMMXt are incompatible because the insn encodings overlap.
-     VFP and iWMMXt can theoretically coexist, but it's unlikely such silicon
-     will ever exist.  GCC makes no attempt to support this combination.  */
-  if (TARGET_IWMMXT && !TARGET_SOFT_FLOAT)
-    sorry ("iWMMXt and hardware floating point");
+     VFP and iWMMXt however can coexist.  */
+  if (TARGET_IWMMXT && TARGET_HARD_FLOAT && !TARGET_VFP)
+    sorry ("iWMMXt and non-VFP floating point unit");
+
+  /* iWMMXt and NEON are incompatible.  */
+  if (TARGET_IWMMXT && TARGET_NEON)
+    sorry ("iWMMXt and NEON");
 
-  /* ??? iWMMXt insn patterns need auditing for Thumb-2.  */
+  /* iWMMXt unsupported under Thumb-2 mode.  */
   if (TARGET_THUMB2 && TARGET_IWMMXT)
     sorry ("Thumb-2 iWMMXt");
 
@@ -19313,7 +19316,8 @@ arm_expand_binop_builtin (enum insn_code
       || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
     target = gen_reg_rtx (tmode);
 
-  gcc_assert (GET_MODE (op0) == mode0 && GET_MODE (op1) == mode1);
+  gcc_assert ((GET_MODE (op0) == mode0 || GET_MODE (op0) == VOIDmode)
+	      && (GET_MODE (op1) == mode1 || GET_MODE (op1) == VOIDmode));
 
   if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
     op0 = copy_to_mode_reg (mode0, op0);
Index: gcc/config/arm/arm.md
===================================================================
--- gcc/config/arm/arm.md	(revision 175285)
+++ gcc/config/arm/arm.md	(working copy)
@@ -536,6 +536,9 @@ (define_attr "generic_vfp" "yes,no"
 (include "cortex-m4-fpu.md")
 (include "vfp11.md")
 
+;; Load the Intel Wireless Multimedia Extension patterns
+(include "iwmmxt.md")
+
 \f
 ;;---------------------------------------------------------------------------
 ;; Insn patterns
@@ -4969,7 +4972,6 @@ (define_insn "*arm_movdi"
 	(match_operand:DI 1 "di_operand"              "rDa,Db,Dc,mi,r"))]
   "TARGET_32BIT
    && !(TARGET_HARD_FLOAT && (TARGET_MAVERICK || TARGET_VFP))
-   && !TARGET_IWMMXT
    && (   register_operand (operands[0], DImode)
        || register_operand (operands[1], DImode))"
   "*
@@ -5237,7 +5239,7 @@ (define_insn "*arm_movt"
 (define_insn "*arm_movsi_insn"
   [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,r,rk,m")
 	(match_operand:SI 1 "general_operand"      "rk, I,K,j,mi,rk"))]
-  "TARGET_ARM && ! TARGET_IWMMXT
+  "TARGET_ARM
    && !(TARGET_HARD_FLOAT && TARGET_VFP)
    && (   register_operand (operands[0], SImode)
        || register_operand (operands[1], SImode))"
@@ -10842,8 +10844,6 @@ (define_expand "bswapsi2"
 (include "cirrus.md")
 ;; Vector bits common to IWMMXT and Neon
 (include "vec-common.md")
-;; Load the Intel Wireless Multimedia Extension patterns
-(include "iwmmxt.md")
 ;; Load the VFP co-processor patterns
 (include "vfp.md")
 ;; Thumb-2 patterns

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, ARM, iWMMXt][1/5]: ARM code generic change
  2011-07-14  7:38   ` Xinyu Qi
@ 2011-08-18  2:21     ` Ramana Radhakrishnan
  2011-08-18  8:24       ` Xinyu Qi
  2011-12-14 17:03     ` Richard Earnshaw
  1 sibling, 1 reply; 12+ messages in thread
From: Ramana Radhakrishnan @ 2011-08-18  2:21 UTC (permalink / raw)
  To: Xinyu Qi; +Cc: gcc-patches

Hi ,

Sorry about the delayed review - It's taken me a while to get back to this .

On 14 July 2011 08:35, Xinyu Qi <xyqi@marvell.com> wrote:
>> > Hi,
>> >
>> > It is the first part of iWMMXt maintenance.
>> >
>> > *config/arm/arm.c (arm_option_override):
>> >   Enable iWMMXt with VFP. iWMMXt and NEON are incompatible.
>> iWMMXt unsupported under Thumb-2 mode.
>> >   (arm_expand_binop_builtin): Accept immediate op (with mode VOID)
>> > *config/arm/arm.md:
>> >   Resettle include location of iwmmxt.md so that *arm_movdi
>> and *arm_movsi_insn could be used when iWMMXt is enabled.

This is OK modulo the Changelog entry.

Please write this as :

<TAB>* config/arm/arm.c (arm_option_override): Enable use of iwMMXt
with VFP. Disable use of iwMMXt and Neon.
<TAB>* config/arm/arm.md (iwmmxt.md): Include earlier.
            (*arm_movsi_insn): Remove check for TARGET_IWMMXT.
            (*arm_movdi_insn): Likewise.


cheers
Ramana

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH, ARM, iWMMXt][1/5]: ARM code generic change
  2011-08-18  2:21     ` Ramana Radhakrishnan
@ 2011-08-18  8:24       ` Xinyu Qi
  0 siblings, 0 replies; 12+ messages in thread
From: Xinyu Qi @ 2011-08-18  8:24 UTC (permalink / raw)
  To: Ramana Radhakrishnan; +Cc: gcc-patches


> -----Original Message-----
> From: Ramana Radhakrishnan [mailto:ramana.radhakrishnan@linaro.org]
At 2011-08-18 09:29:34,"Ramana Radhakrishnan" <ramana.radhakrishnan@linaro.org> wrote: 
> Hi ,
> 
> Sorry about the delayed review - It's taken me a while to get back to this .
> 
> On 14 July 2011 08:35, Xinyu Qi <xyqi@marvell.com> wrote:
> >> > Hi,
> >> >
> >> > It is the first part of iWMMXt maintenance.
> >> >
> >> > *config/arm/arm.c (arm_option_override):
> >> >   Enable iWMMXt with VFP. iWMMXt and NEON are incompatible.
> >> iWMMXt unsupported under Thumb-2 mode.
> >> >   (arm_expand_binop_builtin): Accept immediate op (with mode VOID)
> >> > *config/arm/arm.md:
> >> >   Resettle include location of iwmmxt.md so that *arm_movdi
> >> and *arm_movsi_insn could be used when iWMMXt is enabled.
> 
> This is OK modulo the Changelog entry.
> 
> Please write this as :
> 
> <TAB>* config/arm/arm.c (arm_option_override): Enable use of iwMMXt
> with VFP. Disable use of iwMMXt and Neon.
> <TAB>* config/arm/arm.md (iwmmxt.md): Include earlier.
>             (*arm_movsi_insn): Remove check for TARGET_IWMMXT.
>             (*arm_movdi_insn): Likewise.
> 
> 
> cheers
> Ramana

Thanks for reviewing!

I remember updating the patch stack according to your previous comment several weeks ago.

http://gcc.gnu.org/ml/gcc-patches/2011-07/msg01100.html
http://gcc.gnu.org/ml/gcc-patches/2011-07/msg01101.html
http://gcc.gnu.org/ml/gcc-patches/2011-07/msg01103.html
http://gcc.gnu.org/ml/gcc-patches/2011-07/msg01105.html
http://gcc.gnu.org/ml/gcc-patches/2011-07/msg01106.html

The new ChangLog for this part:
	*config/arm/arm.c (arm_option_override): Enable use of iWMMXt with VFP. Disable use of iwMMXt and Neon.
      (arm_expand_binop_builtin): Accept VOIDmode op.
	*config/arm/arm.md (*arm_movdi, *arm_movsi_insn): Remove check for TARGET_IWMMXT.
      (iwmmxt.md): Include earlier.

Thanks,
Xinyu

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, ARM, iWMMXt][1/5]: ARM code generic change
  2011-07-14  7:38   ` Xinyu Qi
  2011-08-18  2:21     ` Ramana Radhakrishnan
@ 2011-12-14 17:03     ` Richard Earnshaw
  2011-12-22  6:39       ` Xinyu Qi
                         ` (3 more replies)
  1 sibling, 4 replies; 12+ messages in thread
From: Richard Earnshaw @ 2011-12-14 17:03 UTC (permalink / raw)
  To: Xinyu Qi; +Cc: Ramana Radhakrishnan, gcc-patches

On 14/07/11 08:35, Xinyu Qi wrote:
>>> Hi,
>>>
>>> It is the first part of iWMMXt maintenance.
>>>
>>> *config/arm/arm.c (arm_option_override):
>>>   Enable iWMMXt with VFP. iWMMXt and NEON are incompatible. 
>> iWMMXt unsupported under Thumb-2 mode.
>>>   (arm_expand_binop_builtin): Accept immediate op (with mode VOID)
>>> *config/arm/arm.md:
>>>   Resettle include location of iwmmxt.md so that *arm_movdi 
>> and *arm_movsi_insn could be used when iWMMXt is enabled.
>>
>> With the current work in trunk to handle enabled attributes 
>> and per-alternative predicable attributes (Thanks Bernd) we 
>> should be able to get rid of *cond_iwmmxt_movsi_insn"  in 
>> iwmmxt.md file. It's not a matter for this patch but for a 
>> follow-up patch.
>>
>> Actually we should probably do the same for the various insns 
>> that are dotted around all over the place with final 
>> conditions that prevent matching - atleast makes the backend 
>> description slightly smaller :).
>>
>>>   Add pipeline description file include.
>>
>> It is enough to say
>>
>>  (<filename>): Include.
>>
>> in the changelog entry.
>>
>> The include for the pipeline description file should be with 
>> the patch that you add this in i.e. patch #5. Please add this 
>> to MD_INCLUDES in t-arm as well.
>>
>> Also as a general note, please provide a correct Changelog entry.
>>
>> This is not the format that we expect Changelog entries to be in.
>> Please look at the coding standards on the website for this 
>> or at other patches submitted with respect to Changelog 
>> entries. Please fix this for each patch in the patch stack.
>>
>>
>> cheers
>> Ramana
> 
> Thanks for reviewing. I have updated the patches and the Changelog.
> 
> *config/arm/arm.c (arm_option_override): Enable iWMMXt with VFP.
>  (arm_expand_binop_builtin): Accept VOIDmode op.
> *config/arm/arm.md (*arm_movdi, *arm_movsi_insn): Remove condition !TARGET_IWMMXT.
>  (iwmmxt.md): Include location.
> 
> Thanks,
> Xinyu=
> 

+     VFP and iWMMXt however can coexist.  */
+  if (TARGET_IWMMXT && TARGET_HARD_FLOAT && !TARGET_VFP)
+    sorry ("iWMMXt and non-VFP floating point unit");
+
+  /* iWMMXt and NEON are incompatible.  */
+  if (TARGET_IWMMXT && TARGET_NEON)
+    sorry ("iWMMXt and NEON");

-  /* ??? iWMMXt insn patterns need auditing for Thumb-2.  */
+  /* iWMMXt unsupported under Thumb-2 mode.  */
   if (TARGET_THUMB2 && TARGET_IWMMXT)
     sorry ("Thumb-2 iWMMXt");

Don't use sorry() when a feature is not supported by the hardware;
sorry() is used when GCC is currently unable to support something that
it should.  Use error() in these cases.

Secondly, iWMMXt is incompatible with the entire Thumb ISA, not just the
Thumb-2 extensions to the Thumb ISA.


+;; Load the Intel Wireless Multimedia Extension patterns
+(include "iwmmxt.md")
+


No, the extension patterns need to come at the end of the main machine
description.  The list at the top of the MD file is purely for pipeline
descriptions.  Why do you think this is needed?

Other bits are ok.

R.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH, ARM, iWMMXt][1/5]: ARM code generic change
  2011-12-14 17:03     ` Richard Earnshaw
@ 2011-12-22  6:39       ` Xinyu Qi
  2011-12-29  6:25       ` Xinyu Qi
                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Xinyu Qi @ 2011-12-22  6:39 UTC (permalink / raw)
  To: Richard Earnshaw; +Cc: Ramana Radhakrishnan, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 3779 bytes --]

At 2011-12-15 00:47:48,"Richard Earnshaw" <rearnsha@arm.com> wrote: 
> On 14/07/11 08:35, Xinyu Qi wrote:
> >>> Hi,
> >>>
> >>> It is the first part of iWMMXt maintenance.
> >>>
> >>> *config/arm/arm.c (arm_option_override):
> >>>   Enable iWMMXt with VFP. iWMMXt and NEON are incompatible.
> >> iWMMXt unsupported under Thumb-2 mode.
> >>>   (arm_expand_binop_builtin): Accept immediate op (with mode VOID)
> >>> *config/arm/arm.md:
> >>>   Resettle include location of iwmmxt.md so that *arm_movdi
> >> and *arm_movsi_insn could be used when iWMMXt is enabled.
> >>
> >> With the current work in trunk to handle enabled attributes
> >> and per-alternative predicable attributes (Thanks Bernd) we
> >> should be able to get rid of *cond_iwmmxt_movsi_insn"  in
> >> iwmmxt.md file. It's not a matter for this patch but for a
> >> follow-up patch.
> >>
> >> Actually we should probably do the same for the various insns
> >> that are dotted around all over the place with final
> >> conditions that prevent matching - atleast makes the backend
> >> description slightly smaller :).
> >>
> >>>   Add pipeline description file include.
> >>
> >> It is enough to say
> >>
> >>  (<filename>): Include.
> >>
> >> in the changelog entry.
> >>
> >> The include for the pipeline description file should be with
> >> the patch that you add this in i.e. patch #5. Please add this
> >> to MD_INCLUDES in t-arm as well.
> >>
> >> Also as a general note, please provide a correct Changelog entry.
> >>
> >> This is not the format that we expect Changelog entries to be in.
> >> Please look at the coding standards on the website for this
> >> or at other patches submitted with respect to Changelog
> >> entries. Please fix this for each patch in the patch stack.
> >>
> >>
> >> cheers
> >> Ramana
> >
> > Thanks for reviewing. I have updated the patches and the Changelog.
> >
> > *config/arm/arm.c (arm_option_override): Enable iWMMXt with VFP.
> >  (arm_expand_binop_builtin): Accept VOIDmode op.
> > *config/arm/arm.md (*arm_movdi, *arm_movsi_insn): Remove
> condition !TARGET_IWMMXT.
> >  (iwmmxt.md): Include location.
> >
> > Thanks,
> > Xinyu=
> >
> 
> +     VFP and iWMMXt however can coexist.  */
> +  if (TARGET_IWMMXT && TARGET_HARD_FLOAT && !TARGET_VFP)
> +    sorry ("iWMMXt and non-VFP floating point unit");
> +
> +  /* iWMMXt and NEON are incompatible.  */
> +  if (TARGET_IWMMXT && TARGET_NEON)
> +    sorry ("iWMMXt and NEON");
> 
> -  /* ??? iWMMXt insn patterns need auditing for Thumb-2.  */
> +  /* iWMMXt unsupported under Thumb-2 mode.  */
>    if (TARGET_THUMB2 && TARGET_IWMMXT)
>      sorry ("Thumb-2 iWMMXt");
> 
> Don't use sorry() when a feature is not supported by the hardware;
> sorry() is used when GCC is currently unable to support something that
> it should.  Use error() in these cases.
> 
> Secondly, iWMMXt is incompatible with the entire Thumb ISA, not just the
> Thumb-2 extensions to the Thumb ISA.

Done.

> 
> 
> +;; Load the Intel Wireless Multimedia Extension patterns
> +(include "iwmmxt.md")
> +
> 
> 
> No, the extension patterns need to come at the end of the main machine
> description.  The list at the top of the MD file is purely for pipeline
> descriptions.  Why do you think this is needed?

This modification is needless right now since *iwmmxt_movsi_insn and *iwmmxt_arm_movdi
have been corrected in the fourth part of the patch. Revert it.
The new modified patch is attached.

	* config/arm/arm.c (arm_option_override): Enable use of iWMMXt with VFP.
	Disable use of iWMMXt with NEON. Disable use of iWMMXt under Thumb mode.
	(arm_expand_binop_builtin): Accept VOIDmode op.

Thanks,
Xinyu

> 
> Other bits are ok.
> 
> R.


[-- Attachment #2: 1_generic.diff --]
[-- Type: application/octet-stream, Size: 1760 bytes --]

Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	(revision 182518)
+++ gcc/config/arm/arm.c	(working copy)
@@ -1806,14 +1806,17 @@ arm_option_override (void)
     }
 
   /* FPA and iWMMXt are incompatible because the insn encodings overlap.
-     VFP and iWMMXt can theoretically coexist, but it's unlikely such silicon
-     will ever exist.  GCC makes no attempt to support this combination.  */
-  if (TARGET_IWMMXT && !TARGET_SOFT_FLOAT)
-    sorry ("iWMMXt and hardware floating point");
-
-  /* ??? iWMMXt insn patterns need auditing for Thumb-2.  */
-  if (TARGET_THUMB2 && TARGET_IWMMXT)
-    sorry ("Thumb-2 iWMMXt");
+     VFP and iWMMXt however can coexist.  */
+  if (TARGET_IWMMXT && TARGET_HARD_FLOAT && !TARGET_VFP)
+    error ("iWMMXt and non-VFP floating point unit are incompatible");
+
+  /* iWMMXt and NEON are incompatible.  */
+  if (TARGET_IWMMXT && TARGET_NEON)
+    error ("iWMMXt and NEON are incompatible");
+
+  /* iWMMXt unsupported under Thumb mode.  */
+  if (TARGET_THUMB && TARGET_IWMMXT)
+    error ("iWMMXt unsupported under Thumb mode");
 
   /* __fp16 support currently assumes the core has ldrh.  */
   if (!arm_arch4 && arm_fp16_format != ARM_FP16_FORMAT_NONE)
@@ -20468,7 +20471,8 @@ arm_expand_binop_builtin (enum insn_code
       || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
     target = gen_reg_rtx (tmode);
 
-  gcc_assert (GET_MODE (op0) == mode0 && GET_MODE (op1) == mode1);
+  gcc_assert ((GET_MODE (op0) == mode0 || GET_MODE (op0) == VOIDmode)
+	      && (GET_MODE (op1) == mode1 || GET_MODE (op1) == VOIDmode));
 
   if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
     op0 = copy_to_mode_reg (mode0, op0);

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH, ARM, iWMMXt][1/5]: ARM code generic change
  2011-12-14 17:03     ` Richard Earnshaw
  2011-12-22  6:39       ` Xinyu Qi
@ 2011-12-29  6:25       ` Xinyu Qi
  2012-02-03  2:03       ` Xinyu Qi
  2012-03-13  8:54       ` PING: " Xinyu Qi
  3 siblings, 0 replies; 12+ messages in thread
From: Xinyu Qi @ 2011-12-29  6:25 UTC (permalink / raw)
  To: Richard Earnshaw; +Cc: Ramana Radhakrishnan, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 4671 bytes --]

> At 2011-12-15 00:47:48,"Richard Earnshaw" <rearnsha@arm.com> wrote:
> > On 14/07/11 08:35, Xinyu Qi wrote:
> > >>> Hi,
> > >>>
> > >>> It is the first part of iWMMXt maintenance.
> > >>>
> > >>> *config/arm/arm.c (arm_option_override):
> > >>>   Enable iWMMXt with VFP. iWMMXt and NEON are incompatible.
> > >> iWMMXt unsupported under Thumb-2 mode.
> > >>>   (arm_expand_binop_builtin): Accept immediate op (with mode VOID)
> > >>> *config/arm/arm.md:
> > >>>   Resettle include location of iwmmxt.md so that *arm_movdi
> > >> and *arm_movsi_insn could be used when iWMMXt is enabled.
> > >>
> > >> With the current work in trunk to handle enabled attributes and
> > >> per-alternative predicable attributes (Thanks Bernd) we should be
> > >> able to get rid of *cond_iwmmxt_movsi_insn"  in iwmmxt.md file.
> > >> It's not a matter for this patch but for a follow-up patch.
> > >>
> > >> Actually we should probably do the same for the various insns that
> > >> are dotted around all over the place with final conditions that
> > >> prevent matching - atleast makes the backend description slightly
> > >> smaller :).
> > >>
> > >>>   Add pipeline description file include.
> > >>
> > >> It is enough to say
> > >>
> > >>  (<filename>): Include.
> > >>
> > >> in the changelog entry.
> > >>
> > >> The include for the pipeline description file should be with the
> > >> patch that you add this in i.e. patch #5. Please add this to
> > >> MD_INCLUDES in t-arm as well.
> > >>
> > >> Also as a general note, please provide a correct Changelog entry.
> > >>
> > >> This is not the format that we expect Changelog entries to be in.
> > >> Please look at the coding standards on the website for this or at
> > >> other patches submitted with respect to Changelog entries. Please
> > >> fix this for each patch in the patch stack.
> > >>
> > >>
> > >> cheers
> > >> Ramana
> > >
> > > Thanks for reviewing. I have updated the patches and the Changelog.
> > >
> > > *config/arm/arm.c (arm_option_override): Enable iWMMXt with VFP.
> > >  (arm_expand_binop_builtin): Accept VOIDmode op.
> > > *config/arm/arm.md (*arm_movdi, *arm_movsi_insn): Remove
> > condition !TARGET_IWMMXT.
> > >  (iwmmxt.md): Include location.
> > >
> > > Thanks,
> > > Xinyu=
> > >
> >
> > +     VFP and iWMMXt however can coexist.  */  if (TARGET_IWMMXT
> &&
> > + TARGET_HARD_FLOAT && !TARGET_VFP)
> > +    sorry ("iWMMXt and non-VFP floating point unit");
> > +
> > +  /* iWMMXt and NEON are incompatible.  */  if (TARGET_IWMMXT &&
> > + TARGET_NEON)
> > +    sorry ("iWMMXt and NEON");
> >
> > -  /* ??? iWMMXt insn patterns need auditing for Thumb-2.  */
> > +  /* iWMMXt unsupported under Thumb-2 mode.  */
> >    if (TARGET_THUMB2 && TARGET_IWMMXT)
> >      sorry ("Thumb-2 iWMMXt");
> >
> > Don't use sorry() when a feature is not supported by the hardware;
> > sorry() is used when GCC is currently unable to support something that
> > it should.  Use error() in these cases.
> >
> > Secondly, iWMMXt is incompatible with the entire Thumb ISA, not just
> > the
> > Thumb-2 extensions to the Thumb ISA.
> 
> Done.
> 
> >
> >
> > +;; Load the Intel Wireless Multimedia Extension patterns (include
> > +"iwmmxt.md")
> > +
> >
> >
> > No, the extension patterns need to come at the end of the main machine
> > description.  The list at the top of the MD file is purely for
> > pipeline descriptions.  Why do you think this is needed?
> 
> This modification is needless right now since *iwmmxt_movsi_insn and
> *iwmmxt_arm_movdi have been corrected in the fourth part of the patch.
> Revert it.
> The new modified patch is attached.
> 
> 	* config/arm/arm.c (arm_option_override): Enable use of iWMMXt with
> VFP.
> 	Disable use of iWMMXt with NEON. Disable use of iWMMXt under Thumb
> mode.
> 	(arm_expand_binop_builtin): Accept VOIDmode op.
> 
> Thanks,
> Xinyu
> 
> >
> > Other bits are ok.
> >
> > R.

New changlog

	* config/arm/arm.c (FL_IWMMXT2): New define.
	(arm_arch_iwmmxt2): New variable.
	(arm_option_override): Enable use of iWMMXt with VFP.
	Disable use of iWMMXt with NEON. Disable use of iWMMXt under Thumb mode.
	Set arm_arch_iwmmxt2.
	(arm_expand_binop_builtin): Accept VOIDmode op.
	* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __IWMMXT2__.
	(TARGET_IWMMXT2): New define.
	(TARGET_REALLY_IWMMXT2): Likewise.
	(arm_arch_iwmmxt2): Declare.
	* config/arm/arm-cores.def (iwmmxt2): Add FL_IWMMXT2.
	* config/arm/arm-arches.def (iwmmxt2): Likewise.
	* config/arm/arm.md (arch): Add "iwmmxt2".
	(arch_enabled): Handle "iwmmxt2".

Thanks,
Xinyu

[-- Attachment #2: 1_generic.diff --]
[-- Type: application/octet-stream, Size: 7115 bytes --]

Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	(revision 182684)
+++ gcc/config/arm/arm.c	(working copy)
@@ -674,6 +674,7 @@ static int thumb_call_reg_needed;
 #define FL_ARM_DIV    (1 << 23)	      /* Hardware divide (ARM mode).  */
 
 #define FL_IWMMXT     (1 << 29)	      /* XScale v2 or "Intel Wireless MMX technology".  */
+#define FL_IWMMXT2    (1 << 30)       /* "Intel Wireless MMX2 technology".  */
 
 /* Flags that only effect tuning, not available instructions.  */
 #define FL_TUNE		(FL_WBUF | FL_VFPV2 | FL_STRONG | FL_LDSCHED \
@@ -755,6 +756,9 @@ int arm_arch_cirrus = 0;
 /* Nonzero if this chip supports Intel Wireless MMX technology.  */
 int arm_arch_iwmmxt = 0;
 
+/* Nonzero if this chip supports Intel Wireless MMX2 technology.  */
+int arm_arch_iwmmxt2 = 0;
+
 /* Nonzero if this chip is an XScale.  */
 int arm_arch_xscale = 0;
 
@@ -1706,6 +1710,7 @@ arm_option_override (void)
   arm_tune_wbuf = (tune_flags & FL_WBUF) != 0;
   arm_tune_xscale = (tune_flags & FL_XSCALE) != 0;
   arm_arch_iwmmxt = (insn_flags & FL_IWMMXT) != 0;
+  arm_arch_iwmmxt2 = (insn_flags & FL_IWMMXT2) != 0;
   arm_arch_thumb_hwdiv = (insn_flags & FL_THUMB_DIV) != 0;
   arm_arch_arm_hwdiv = (insn_flags & FL_ARM_DIV) != 0;
   arm_tune_cortex_a9 = (arm_tune == cortexa9) != 0;
@@ -1806,14 +1811,17 @@ arm_option_override (void)
     }
 
   /* FPA and iWMMXt are incompatible because the insn encodings overlap.
-     VFP and iWMMXt can theoretically coexist, but it's unlikely such silicon
-     will ever exist.  GCC makes no attempt to support this combination.  */
-  if (TARGET_IWMMXT && !TARGET_SOFT_FLOAT)
-    sorry ("iWMMXt and hardware floating point");
-
-  /* ??? iWMMXt insn patterns need auditing for Thumb-2.  */
-  if (TARGET_THUMB2 && TARGET_IWMMXT)
-    sorry ("Thumb-2 iWMMXt");
+     VFP and iWMMXt however can coexist.  */
+  if (TARGET_IWMMXT && TARGET_HARD_FLOAT && !TARGET_VFP)
+    error ("iWMMXt and non-VFP floating point unit are incompatible");
+
+  /* iWMMXt and NEON are incompatible.  */
+  if (TARGET_IWMMXT && TARGET_NEON)
+    error ("iWMMXt and NEON are incompatible");
+
+  /* iWMMXt unsupported under Thumb mode.  */
+  if (TARGET_THUMB && TARGET_IWMMXT)
+    error ("iWMMXt unsupported under Thumb mode");
 
   /* __fp16 support currently assumes the core has ldrh.  */
   if (!arm_arch4 && arm_fp16_format != ARM_FP16_FORMAT_NONE)
@@ -20477,7 +20485,8 @@ arm_expand_binop_builtin (enum insn_code
       || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
     target = gen_reg_rtx (tmode);
 
-  gcc_assert (GET_MODE (op0) == mode0 && GET_MODE (op1) == mode1);
+  gcc_assert ((GET_MODE (op0) == mode0 || GET_MODE (op0) == VOIDmode)
+	      && (GET_MODE (op1) == mode1 || GET_MODE (op1) == VOIDmode));
 
   if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
     op0 = copy_to_mode_reg (mode0, op0);
Index: gcc/config/arm/arm.h
===================================================================
--- gcc/config/arm/arm.h	(revision 182684)
+++ gcc/config/arm/arm.h	(working copy)
@@ -97,6 +97,8 @@ extern char arm_arch_name[];
 	  builtin_define ("__XSCALE__");		\
 	if (arm_arch_iwmmxt)				\
 	  builtin_define ("__IWMMXT__");		\
+	if (arm_arch_iwmmxt2)				\
+	  builtin_define ("__IWMMXT2__");		\
 	if (TARGET_AAPCS_BASED)				\
 	  {						\
 	    if (arm_pcs_default == ARM_PCS_AAPCS_VFP)	\
@@ -212,7 +214,9 @@ extern void (*arm_lang_output_object_att
 #define TARGET_MAVERICK		(arm_fpu_desc->model == ARM_FP_MODEL_MAVERICK)
 #define TARGET_VFP		(arm_fpu_desc->model == ARM_FP_MODEL_VFP)
 #define TARGET_IWMMXT			(arm_arch_iwmmxt)
+#define TARGET_IWMMXT2			(arm_arch_iwmmxt2)
 #define TARGET_REALLY_IWMMXT		(TARGET_IWMMXT && TARGET_32BIT)
+#define TARGET_REALLY_IWMMXT2		(TARGET_IWMMXT2 && TARGET_32BIT)
 #define TARGET_IWMMXT_ABI (TARGET_32BIT && arm_abi == ARM_ABI_IWMMXT)
 #define TARGET_ARM                      (! TARGET_THUMB)
 #define TARGET_EITHER			1 /* (TARGET_ARM | TARGET_THUMB) */
@@ -428,6 +432,9 @@ extern int arm_arch_cirrus;
 /* Nonzero if this chip supports Intel XScale with Wireless MMX technology.  */
 extern int arm_arch_iwmmxt;
 
+/* Nonzero if this chip supports Intel Wireless MMX2 technology.  */
+extern int arm_arch_iwmmxt2;
+
 /* Nonzero if this chip is an XScale.  */
 extern int arm_arch_xscale;
 
Index: gcc/config/arm/arm-cores.def
===================================================================
--- gcc/config/arm/arm-cores.def	(revision 182684)
+++ gcc/config/arm/arm-cores.def	(working copy)
@@ -105,7 +105,7 @@ ARM_CORE("arm1020e",      arm1020e,	5TE,
 ARM_CORE("arm1022e",      arm1022e,	5TE,				 FL_LDSCHED, fastmul)
 ARM_CORE("xscale",        xscale,	5TE,	                         FL_LDSCHED | FL_STRONG | FL_XSCALE, xscale)
 ARM_CORE("iwmmxt",        iwmmxt,	5TE,	                         FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT, xscale)
-ARM_CORE("iwmmxt2",       iwmmxt2,	5TE,	                         FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT, xscale)
+ARM_CORE("iwmmxt2",       iwmmxt2,	5TE,	                         FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT | FL_IWMMXT2, xscale)
 ARM_CORE("fa606te",       fa606te,      5TE,                             FL_LDSCHED, 9e)
 ARM_CORE("fa626te",       fa626te,      5TE,                             FL_LDSCHED, 9e)
 ARM_CORE("fmp626",        fmp626,       5TE,                             FL_LDSCHED, 9e)
Index: gcc/config/arm/arm-arches.def
===================================================================
--- gcc/config/arm/arm-arches.def	(revision 182684)
+++ gcc/config/arm/arm-arches.def	(working copy)
@@ -57,4 +57,4 @@ ARM_ARCH("armv7-m", cortexm3,	7M,  FL_CO
 ARM_ARCH("armv7e-m", cortexm4,  7EM, FL_CO_PROC |	      FL_FOR_ARCH7EM)
 ARM_ARCH("ep9312",  ep9312,     4T,  FL_LDSCHED | FL_CIRRUS | FL_FOR_ARCH4)
 ARM_ARCH("iwmmxt",  iwmmxt,     5TE, FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT)
-ARM_ARCH("iwmmxt2", iwmmxt2,    5TE, FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT)
+ARM_ARCH("iwmmxt2", iwmmxt2,    5TE, FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT | FL_IWMMXT2)
Index: gcc/config/arm/arm.md
===================================================================
--- gcc/config/arm/arm.md	(revision 182684)
+++ gcc/config/arm/arm.md	(working copy)
@@ -207,7 +207,7 @@ (define_attr "length" ""
 ; for ARM or Thumb-2 with arm_arch6, and nov6 for ARM without
 ; arm_arch6.  This attribute is used to compute attribute "enabled",
 ; use type "any" to enable an alternative in all cases.
-(define_attr "arch" "any,a,t,32,t1,t2,v6,nov6,onlya8,nota8"
+(define_attr "arch" "any,a,t,32,t1,t2,v6,nov6,onlya8,nota8,iwmmxt2"
   (const_string "any"))
 
 (define_attr "arch_enabled" "no,yes"
@@ -248,6 +248,10 @@ (define_attr "arch_enabled" "no,yes"
 
 	 (and (eq_attr "arch" "nota8")
 	      (not (eq_attr "tune" "cortexa8")))
+         (const_string "yes")
+
+         (and (eq_attr "arch" "iwmmxt2")
+              (match_test "TARGET_REALLY_IWMMXT2"))
 	 (const_string "yes")]
 	(const_string "no")))
 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE:PING: [PATCH, ARM, iWMMXt][1/5]: ARM code generic change
  2011-12-14 17:03     ` Richard Earnshaw
  2011-12-22  6:39       ` Xinyu Qi
  2011-12-29  6:25       ` Xinyu Qi
@ 2012-02-03  2:03       ` Xinyu Qi
  2012-03-13  8:54       ` PING: " Xinyu Qi
  3 siblings, 0 replies; 12+ messages in thread
From: Xinyu Qi @ 2012-02-03  2:03 UTC (permalink / raw)
  To: Richard Earnshaw; +Cc: Ramana Radhakrishnan, gcc-patches

PING

http://gcc.gnu.org/ml/gcc-patches/2011-12/msg01787.html

At 2011-12-29 14:20:20,"Xinyu Qi" <xyqi@marvell.com> wrote:
> > At 2011-12-15 00:47:48,"Richard Earnshaw" <rearnsha@arm.com> wrote:
> > > On 14/07/11 08:35, Xinyu Qi wrote:
> > > >>> Hi,
> > > >>>
> > > >>> It is the first part of iWMMXt maintenance.
> > > >>>
> > > >>> *config/arm/arm.c (arm_option_override):
> > > >>>   Enable iWMMXt with VFP. iWMMXt and NEON are incompatible.
> > > >> iWMMXt unsupported under Thumb-2 mode.
> > > >>>   (arm_expand_binop_builtin): Accept immediate op (with mode
> > > >>> VOID)
> > > >>> *config/arm/arm.md:
> > > >>>   Resettle include location of iwmmxt.md so that *arm_movdi
> > > >> and *arm_movsi_insn could be used when iWMMXt is enabled.
> > > >>
> > > >> With the current work in trunk to handle enabled attributes and
> > > >> per-alternative predicable attributes (Thanks Bernd) we should be
> > > >> able to get rid of *cond_iwmmxt_movsi_insn"  in iwmmxt.md file.
> > > >> It's not a matter for this patch but for a follow-up patch.
> > > >>
> > > >> Actually we should probably do the same for the various insns
> > > >> that are dotted around all over the place with final conditions
> > > >> that prevent matching - atleast makes the backend description
> > > >> slightly smaller :).
> > > >>
> > > >>>   Add pipeline description file include.
> > > >>
> > > >> It is enough to say
> > > >>
> > > >>  (<filename>): Include.
> > > >>
> > > >> in the changelog entry.
> > > >>
> > > >> The include for the pipeline description file should be with the
> > > >> patch that you add this in i.e. patch #5. Please add this to
> > > >> MD_INCLUDES in t-arm as well.
> > > >>
> > > >> Also as a general note, please provide a correct Changelog entry.
> > > >>
> > > >> This is not the format that we expect Changelog entries to be in.
> > > >> Please look at the coding standards on the website for this or at
> > > >> other patches submitted with respect to Changelog entries. Please
> > > >> fix this for each patch in the patch stack.
> > > >>
> > > >>
> > > >> cheers
> > > >> Ramana
> > > >
> > > > Thanks for reviewing. I have updated the patches and the Changelog.
> > > >
> > > > *config/arm/arm.c (arm_option_override): Enable iWMMXt with VFP.
> > > >  (arm_expand_binop_builtin): Accept VOIDmode op.
> > > > *config/arm/arm.md (*arm_movdi, *arm_movsi_insn): Remove
> > > condition !TARGET_IWMMXT.
> > > >  (iwmmxt.md): Include location.
> > > >
> > > > Thanks,
> > > > Xinyu=
> > > >
> > >
> > > +     VFP and iWMMXt however can coexist.  */  if (TARGET_IWMMXT
> > &&
> > > + TARGET_HARD_FLOAT && !TARGET_VFP)
> > > +    sorry ("iWMMXt and non-VFP floating point unit");
> > > +
> > > +  /* iWMMXt and NEON are incompatible.  */  if (TARGET_IWMMXT
> &&
> > > + TARGET_NEON)
> > > +    sorry ("iWMMXt and NEON");
> > >
> > > -  /* ??? iWMMXt insn patterns need auditing for Thumb-2.  */
> > > +  /* iWMMXt unsupported under Thumb-2 mode.  */
> > >    if (TARGET_THUMB2 && TARGET_IWMMXT)
> > >      sorry ("Thumb-2 iWMMXt");
> > >
> > > Don't use sorry() when a feature is not supported by the hardware;
> > > sorry() is used when GCC is currently unable to support something
> > > that it should.  Use error() in these cases.
> > >
> > > Secondly, iWMMXt is incompatible with the entire Thumb ISA, not just
> > > the
> > > Thumb-2 extensions to the Thumb ISA.
> >
> > Done.
> >
> > >
> > >
> > > +;; Load the Intel Wireless Multimedia Extension patterns (include
> > > +"iwmmxt.md")
> > > +
> > >
> > >
> > > No, the extension patterns need to come at the end of the main
> > > machine description.  The list at the top of the MD file is purely
> > > for pipeline descriptions.  Why do you think this is needed?
> >
> > This modification is needless right now since *iwmmxt_movsi_insn and
> > *iwmmxt_arm_movdi have been corrected in the fourth part of the patch.
> > Revert it.
> > The new modified patch is attached.
> >
> > 	* config/arm/arm.c (arm_option_override): Enable use of iWMMXt with
> > VFP.
> > 	Disable use of iWMMXt with NEON. Disable use of iWMMXt under Thumb
> > mode.
> > 	(arm_expand_binop_builtin): Accept VOIDmode op.
> >
> > Thanks,
> > Xinyu
> >
> > >
> > > Other bits are ok.
> > >
> > > R.
> 
> New changlog
> 
> 	* config/arm/arm.c (FL_IWMMXT2): New define.
> 	(arm_arch_iwmmxt2): New variable.
> 	(arm_option_override): Enable use of iWMMXt with VFP.
> 	Disable use of iWMMXt with NEON. Disable use of iWMMXt under Thumb
> mode.
> 	Set arm_arch_iwmmxt2.
> 	(arm_expand_binop_builtin): Accept VOIDmode op.
> 	* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define
> __IWMMXT2__.
> 	(TARGET_IWMMXT2): New define.
> 	(TARGET_REALLY_IWMMXT2): Likewise.
> 	(arm_arch_iwmmxt2): Declare.
> 	* config/arm/arm-cores.def (iwmmxt2): Add FL_IWMMXT2.
> 	* config/arm/arm-arches.def (iwmmxt2): Likewise.
> 	* config/arm/arm.md (arch): Add "iwmmxt2".
> 	(arch_enabled): Handle "iwmmxt2".
> 
> Thanks,
> Xinyu

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: PING: [PATCH, ARM, iWMMXt][1/5]: ARM code generic change
  2011-12-14 17:03     ` Richard Earnshaw
                         ` (2 preceding siblings ...)
  2012-02-03  2:03       ` Xinyu Qi
@ 2012-03-13  8:54       ` Xinyu Qi
  3 siblings, 0 replies; 12+ messages in thread
From: Xinyu Qi @ 2012-03-13  8:54 UTC (permalink / raw)
  To: Richard Earnshaw; +Cc: Ramana Radhakrishnan, gcc-patches

PING

At 2012-02-03 10:02:28,"Xinyu Qi" <xyqi@marvell.com> wrote:
> PING
> 
> http://gcc.gnu.org/ml/gcc-patches/2011-12/msg01787.html
> 
> At 2011-12-29 14:20:20,"Xinyu Qi" <xyqi@marvell.com> wrote:
> > > At 2011-12-15 00:47:48,"Richard Earnshaw" <rearnsha@arm.com> wrote:
> > > > On 14/07/11 08:35, Xinyu Qi wrote:
> > > > >>> Hi,
> > > > >>>
> > > > >>> It is the first part of iWMMXt maintenance.
> > > > >>>
> > > > >>> *config/arm/arm.c (arm_option_override):
> > > > >>>   Enable iWMMXt with VFP. iWMMXt and NEON are incompatible.
> > > > >> iWMMXt unsupported under Thumb-2 mode.
> > > > >>>   (arm_expand_binop_builtin): Accept immediate op (with mode
> > > > >>> VOID)
> > > > >>> *config/arm/arm.md:
> > > > >>>   Resettle include location of iwmmxt.md so that *arm_movdi
> > > > >> and *arm_movsi_insn could be used when iWMMXt is enabled.
> > > > >>
> > > > >> With the current work in trunk to handle enabled attributes and
> > > > >> per-alternative predicable attributes (Thanks Bernd) we should be
> > > > >> able to get rid of *cond_iwmmxt_movsi_insn"  in iwmmxt.md file.
> > > > >> It's not a matter for this patch but for a follow-up patch.
> > > > >>
> > > > >> Actually we should probably do the same for the various insns
> > > > >> that are dotted around all over the place with final conditions
> > > > >> that prevent matching - atleast makes the backend description
> > > > >> slightly smaller :).
> > > > >>
> > > > >>>   Add pipeline description file include.
> > > > >>
> > > > >> It is enough to say
> > > > >>
> > > > >>  (<filename>): Include.
> > > > >>
> > > > >> in the changelog entry.
> > > > >>
> > > > >> The include for the pipeline description file should be with the
> > > > >> patch that you add this in i.e. patch #5. Please add this to
> > > > >> MD_INCLUDES in t-arm as well.
> > > > >>
> > > > >> Also as a general note, please provide a correct Changelog entry.
> > > > >>
> > > > >> This is not the format that we expect Changelog entries to be in.
> > > > >> Please look at the coding standards on the website for this or at
> > > > >> other patches submitted with respect to Changelog entries. Please
> > > > >> fix this for each patch in the patch stack.
> > > > >>
> > > > >>
> > > > >> cheers
> > > > >> Ramana
> > > > >
> > > > > Thanks for reviewing. I have updated the patches and the Changelog.
> > > > >
> > > > > *config/arm/arm.c (arm_option_override): Enable iWMMXt with VFP.
> > > > >  (arm_expand_binop_builtin): Accept VOIDmode op.
> > > > > *config/arm/arm.md (*arm_movdi, *arm_movsi_insn): Remove
> > > > condition !TARGET_IWMMXT.
> > > > >  (iwmmxt.md): Include location.
> > > > >
> > > > > Thanks,
> > > > > Xinyu=
> > > > >
> > > >
> > > > +     VFP and iWMMXt however can coexist.  */  if
> (TARGET_IWMMXT
> > > &&
> > > > + TARGET_HARD_FLOAT && !TARGET_VFP)
> > > > +    sorry ("iWMMXt and non-VFP floating point unit");
> > > > +
> > > > +  /* iWMMXt and NEON are incompatible.  */  if (TARGET_IWMMXT
> > &&
> > > > + TARGET_NEON)
> > > > +    sorry ("iWMMXt and NEON");
> > > >
> > > > -  /* ??? iWMMXt insn patterns need auditing for Thumb-2.  */
> > > > +  /* iWMMXt unsupported under Thumb-2 mode.  */
> > > >    if (TARGET_THUMB2 && TARGET_IWMMXT)
> > > >      sorry ("Thumb-2 iWMMXt");
> > > >
> > > > Don't use sorry() when a feature is not supported by the hardware;
> > > > sorry() is used when GCC is currently unable to support something
> > > > that it should.  Use error() in these cases.
> > > >
> > > > Secondly, iWMMXt is incompatible with the entire Thumb ISA, not just
> > > > the
> > > > Thumb-2 extensions to the Thumb ISA.
> > >
> > > Done.
> > >
> > > >
> > > >
> > > > +;; Load the Intel Wireless Multimedia Extension patterns (include
> > > > +"iwmmxt.md")
> > > > +
> > > >
> > > >
> > > > No, the extension patterns need to come at the end of the main
> > > > machine description.  The list at the top of the MD file is purely
> > > > for pipeline descriptions.  Why do you think this is needed?
> > >
> > > This modification is needless right now since *iwmmxt_movsi_insn and
> > > *iwmmxt_arm_movdi have been corrected in the fourth part of the patch.
> > > Revert it.
> > > The new modified patch is attached.
> > >
> > > 	* config/arm/arm.c (arm_option_override): Enable use of iWMMXt with
> > > VFP.
> > > 	Disable use of iWMMXt with NEON. Disable use of iWMMXt under Thumb
> > > mode.
> > > 	(arm_expand_binop_builtin): Accept VOIDmode op.
> > >
> > > Thanks,
> > > Xinyu
> > >
> > > >
> > > > Other bits are ok.
> > > >
> > > > R.
> >
> > New changlog
> >
> > 	* config/arm/arm.c (FL_IWMMXT2): New define.
> > 	(arm_arch_iwmmxt2): New variable.
> > 	(arm_option_override): Enable use of iWMMXt with VFP.
> > 	Disable use of iWMMXt with NEON. Disable use of iWMMXt under Thumb
> > mode.
> > 	Set arm_arch_iwmmxt2.
> > 	(arm_expand_binop_builtin): Accept VOIDmode op.
> > 	* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define
> > __IWMMXT2__.
> > 	(TARGET_IWMMXT2): New define.
> > 	(TARGET_REALLY_IWMMXT2): Likewise.
> > 	(arm_arch_iwmmxt2): Declare.
> > 	* config/arm/arm-cores.def (iwmmxt2): Add FL_IWMMXT2.
> > 	* config/arm/arm-arches.def (iwmmxt2): Likewise.
> > 	* config/arm/arm.md (arch): Add "iwmmxt2".
> > 	(arch_enabled): Handle "iwmmxt2".
> >
> > Thanks,
> > Xinyu

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH ARM iWMMXt 1/5] ARM code generic change
  2012-05-29  4:14 ` [PATCH ARM iWMMXt 1/5] ARM code generic change Matt Turner
@ 2012-06-06 11:53   ` Ramana Radhakrishnan
  0 siblings, 0 replies; 12+ messages in thread
From: Ramana Radhakrishnan @ 2012-06-06 11:53 UTC (permalink / raw)
  To: Matt Turner
  Cc: gcc-patches, Richard Earnshaw, Nick Clifton, Paul Brook, Xinyu Qi

On 29 May 2012 05:13, Matt Turner <mattst88@gmail.com> wrote:
> From: Xinyu Qi <xyqi@marvell.com>
>
>        gcc/
>        * config/arm/arm.c (FL_IWMMXT2): New define.
>        (arm_arch_iwmmxt2): New variable.
>        (arm_option_override): Enable use of iWMMXt with VFP.
>        Disable use of iWMMXt with NEON. Disable use of iWMMXt under
>        Thumb mode. Set arm_arch_iwmmxt2.
>        (arm_expand_binop_builtin): Accept VOIDmode op.
>        * config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __IWMMXT2__.
>        (TARGET_IWMMXT2): New define.
>        (TARGET_REALLY_IWMMXT2): Likewise.
>        (arm_arch_iwmmxt2): Declare.
>        * config/arm/arm-cores.def (iwmmxt2): Add FL_IWMMXT2.
>        * config/arm/arm-arches.def (iwmmxt2): Likewise.
>        * config/arm/arm.md (arch): Add "iwmmxt2".
>        (arch_enabled): Handle "iwmmxt2".
> ---
>  gcc/config/arm/arm-arches.def |    2 +-
>  gcc/config/arm/arm-cores.def  |    2 +-
>  gcc/config/arm/arm.c          |   25 +++++++++++++++++--------
>  gcc/config/arm/arm.h          |    7 +++++++
>  gcc/config/arm/arm.md         |    6 +++++-
>  5 files changed, 31 insertions(+), 11 deletions(-)
>
> diff --git a/gcc/config/arm/arm-arches.def b/gcc/config/arm/arm-arches.def
> index 3123426..f4dd6cc 100644
> --- a/gcc/config/arm/arm-arches.def
> +++ b/gcc/config/arm/arm-arches.def
> @@ -57,4 +57,4 @@ ARM_ARCH("armv7-m", cortexm3, 7M,  FL_CO_PROC |             FL_FOR_ARCH7M)
>  ARM_ARCH("armv7e-m", cortexm4,  7EM, FL_CO_PROC |            FL_FOR_ARCH7EM)
>  ARM_ARCH("ep9312",  ep9312,     4T,  FL_LDSCHED | FL_CIRRUS | FL_FOR_ARCH4)
>  ARM_ARCH("iwmmxt",  iwmmxt,     5TE, FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT)
> -ARM_ARCH("iwmmxt2", iwmmxt2,    5TE, FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT)
> +ARM_ARCH("iwmmxt2", iwmmxt2,    5TE, FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT | FL_IWMMXT2)
> diff --git a/gcc/config/arm/arm-cores.def b/gcc/config/arm/arm-cores.def
> index d82b10b..c82eada 100644
> --- a/gcc/config/arm/arm-cores.def
> +++ b/gcc/config/arm/arm-cores.def
> @@ -105,7 +105,7 @@ ARM_CORE("arm1020e",      arm1020e, 5TE,                             FL_LDSCHED, fastmul)
>  ARM_CORE("arm1022e",      arm1022e,    5TE,                             FL_LDSCHED, fastmul)
>  ARM_CORE("xscale",        xscale,      5TE,                             FL_LDSCHED | FL_STRONG | FL_XSCALE, xscale)
>  ARM_CORE("iwmmxt",        iwmmxt,      5TE,                             FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT, xscale)
> -ARM_CORE("iwmmxt2",       iwmmxt2,     5TE,                             FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT, xscale)
> +ARM_CORE("iwmmxt2",       iwmmxt2,     5TE,                             FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT | FL_IWMMXT2, xscale)
>  ARM_CORE("fa606te",       fa606te,      5TE,                             FL_LDSCHED, 9e)
>  ARM_CORE("fa626te",       fa626te,      5TE,                             FL_LDSCHED, 9e)
>  ARM_CORE("fmp626",        fmp626,       5TE,                             FL_LDSCHED, 9e)
> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
> index 7a98197..b0680ab 100644
> --- a/gcc/config/arm/arm.c
> +++ b/gcc/config/arm/arm.c
> @@ -685,6 +685,7 @@ static int thumb_call_reg_needed;
>  #define FL_ARM_DIV    (1 << 23)              /* Hardware divide (ARM mode).  */
>
>  #define FL_IWMMXT     (1 << 29)              /* XScale v2 or "Intel Wireless MMX technology".  */
> +#define FL_IWMMXT2    (1 << 30)       /* "Intel Wireless MMX2 technology".  */
>
>  /* Flags that only effect tuning, not available instructions.  */
>  #define FL_TUNE                (FL_WBUF | FL_VFPV2 | FL_STRONG | FL_LDSCHED \
> @@ -766,6 +767,9 @@ int arm_arch_cirrus = 0;
>  /* Nonzero if this chip supports Intel Wireless MMX technology.  */
>  int arm_arch_iwmmxt = 0;
>
> +/* Nonzero if this chip supports Intel Wireless MMX2 technology.  */
> +int arm_arch_iwmmxt2 = 0;
> +
>  /* Nonzero if this chip is an XScale.  */
>  int arm_arch_xscale = 0;
>
> @@ -1717,6 +1721,7 @@ arm_option_override (void)
>   arm_tune_wbuf = (tune_flags & FL_WBUF) != 0;
>   arm_tune_xscale = (tune_flags & FL_XSCALE) != 0;
>   arm_arch_iwmmxt = (insn_flags & FL_IWMMXT) != 0;
> +  arm_arch_iwmmxt2 = (insn_flags & FL_IWMMXT2) != 0;
>   arm_arch_thumb_hwdiv = (insn_flags & FL_THUMB_DIV) != 0;
>   arm_arch_arm_hwdiv = (insn_flags & FL_ARM_DIV) != 0;
>   arm_tune_cortex_a9 = (arm_tune == cortexa9) != 0;
> @@ -1817,14 +1822,17 @@ arm_option_override (void)
>     }
>
>   /* FPA and iWMMXt are incompatible because the insn encodings overlap.
> -     VFP and iWMMXt can theoretically coexist, but it's unlikely such silicon
> -     will ever exist.  GCC makes no attempt to support this combination.  */
> -  if (TARGET_IWMMXT && !TARGET_SOFT_FLOAT)
> -    sorry ("iWMMXt and hardware floating point");
> +     VFP and iWMMXt however can coexist.  */
> +  if (TARGET_IWMMXT && TARGET_HARD_FLOAT && !TARGET_VFP)
> +    error ("iWMMXt and non-VFP floating point unit are incompatible");
> +
> +  /* iWMMXt and NEON are incompatible.  */
> +  if (TARGET_IWMMXT && TARGET_NEON)
> +    error ("iWMMXt and NEON are incompatible");
>
> -  /* ??? iWMMXt insn patterns need auditing for Thumb-2.  */
> -  if (TARGET_THUMB2 && TARGET_IWMMXT)
> -    sorry ("Thumb-2 iWMMXt");
> +  /* iWMMXt unsupported under Thumb mode.  */
> +  if (TARGET_THUMB && TARGET_IWMMXT)
> +    error ("iWMMXt unsupported under Thumb mode");
>
>   /* __fp16 support currently assumes the core has ldrh.  */
>   if (!arm_arch4 && arm_fp16_format != ARM_FP16_FORMAT_NONE)
> @@ -20867,7 +20875,8 @@ arm_expand_binop_builtin (enum insn_code icode,
>       || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
>     target = gen_reg_rtx (tmode);
>
> -  gcc_assert (GET_MODE (op0) == mode0 && GET_MODE (op1) == mode1);
> +  gcc_assert ((GET_MODE (op0) == mode0 || GET_MODE (op0) == VOIDmode)
> +             && (GET_MODE (op1) == mode1 || GET_MODE (op1) == VOIDmode));
>
>   if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
>     op0 = copy_to_mode_reg (mode0, op0);
> diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
> index f4204e4..c51bce9 100644
> --- a/gcc/config/arm/arm.h
> +++ b/gcc/config/arm/arm.h
> @@ -97,6 +97,8 @@ extern char arm_arch_name[];
>          builtin_define ("__XSCALE__");                \
>        if (arm_arch_iwmmxt)                            \
>          builtin_define ("__IWMMXT__");                \
> +       if (arm_arch_iwmmxt2)                           \
> +         builtin_define ("__IWMMXT2__");               \
>        if (TARGET_AAPCS_BASED)                         \
>          {                                             \
>            if (arm_pcs_default == ARM_PCS_AAPCS_VFP)   \
> @@ -194,7 +196,9 @@ extern void (*arm_lang_output_object_attributes_hook)(void);
>  #define TARGET_MAVERICK                (arm_fpu_desc->model == ARM_FP_MODEL_MAVERICK)
>  #define TARGET_VFP             (arm_fpu_desc->model == ARM_FP_MODEL_VFP)
>  #define TARGET_IWMMXT                  (arm_arch_iwmmxt)
> +#define TARGET_IWMMXT2                 (arm_arch_iwmmxt2)
>  #define TARGET_REALLY_IWMMXT           (TARGET_IWMMXT && TARGET_32BIT)
> +#define TARGET_REALLY_IWMMXT2          (TARGET_IWMMXT2 && TARGET_32BIT)
>  #define TARGET_IWMMXT_ABI (TARGET_32BIT && arm_abi == ARM_ABI_IWMMXT)
>  #define TARGET_ARM                      (! TARGET_THUMB)
>  #define TARGET_EITHER                  1 /* (TARGET_ARM | TARGET_THUMB) */
> @@ -410,6 +414,9 @@ extern int arm_arch_cirrus;
>  /* Nonzero if this chip supports Intel XScale with Wireless MMX technology.  */
>  extern int arm_arch_iwmmxt;
>
> +/* Nonzero if this chip supports Intel Wireless MMX2 technology.  */
> +extern int arm_arch_iwmmxt2;
> +
>  /* Nonzero if this chip is an XScale.  */
>  extern int arm_arch_xscale;
>
> diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
> index bbf6380..ad9d948 100644
> --- a/gcc/config/arm/arm.md
> +++ b/gcc/config/arm/arm.md
> @@ -197,7 +197,7 @@
>  ; for ARM or Thumb-2 with arm_arch6, and nov6 for ARM without
>  ; arm_arch6.  This attribute is used to compute attribute "enabled",
>  ; use type "any" to enable an alternative in all cases.
> -(define_attr "arch" "any,a,t,32,t1,t2,v6,nov6,onlya8,neon_onlya8,nota8,neon_nota8"
> +(define_attr "arch" "any,a,t,32,t1,t2,v6,nov6,onlya8,neon_onlya8,nota8,neon_nota8,iwmmxt,iwmmxt2"
>   (const_string "any"))
>
>  (define_attr "arch_enabled" "no,yes"
> @@ -248,6 +248,10 @@
>         (and (eq_attr "arch" "neon_nota8")
>              (not (eq_attr "tune" "cortexa8"))
>              (match_test "TARGET_NEON"))
> +        (const_string "yes")
> +

Unnecessary new line here.

> +        (and (eq_attr "arch" "iwmmxt2")
> +             (match_test "TARGET_REALLY_IWMMXT2"))
>         (const_string "yes")]
>        (const_string "no")))


Given that we already have iwmmxt2 as a CPU it isn't really changing
behaviour. OK with that change.


regards,
Ramana

>
> --
> 1.7.3.4
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH ARM iWMMXt 1/5] ARM code generic change
  2012-05-29  4:13 [PATCH ARM iWMMXt 0/5] Improve iWMMXt support Matt Turner
@ 2012-05-29  4:14 ` Matt Turner
  2012-06-06 11:53   ` Ramana Radhakrishnan
  0 siblings, 1 reply; 12+ messages in thread
From: Matt Turner @ 2012-05-29  4:14 UTC (permalink / raw)
  To: gcc-patches
  Cc: Ramana Radhakrishnan, Richard Earnshaw, Nick Clifton, Paul Brook,
	Xinyu Qi

From: Xinyu Qi <xyqi@marvell.com>

	gcc/
	* config/arm/arm.c (FL_IWMMXT2): New define.
	(arm_arch_iwmmxt2): New variable.
	(arm_option_override): Enable use of iWMMXt with VFP.
	Disable use of iWMMXt with NEON. Disable use of iWMMXt under
	Thumb mode. Set arm_arch_iwmmxt2.
	(arm_expand_binop_builtin): Accept VOIDmode op.
	* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __IWMMXT2__.
	(TARGET_IWMMXT2): New define.
	(TARGET_REALLY_IWMMXT2): Likewise.
	(arm_arch_iwmmxt2): Declare.
	* config/arm/arm-cores.def (iwmmxt2): Add FL_IWMMXT2.
	* config/arm/arm-arches.def (iwmmxt2): Likewise.
	* config/arm/arm.md (arch): Add "iwmmxt2".
	(arch_enabled): Handle "iwmmxt2".
---
 gcc/config/arm/arm-arches.def |    2 +-
 gcc/config/arm/arm-cores.def  |    2 +-
 gcc/config/arm/arm.c          |   25 +++++++++++++++++--------
 gcc/config/arm/arm.h          |    7 +++++++
 gcc/config/arm/arm.md         |    6 +++++-
 5 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/gcc/config/arm/arm-arches.def b/gcc/config/arm/arm-arches.def
index 3123426..f4dd6cc 100644
--- a/gcc/config/arm/arm-arches.def
+++ b/gcc/config/arm/arm-arches.def
@@ -57,4 +57,4 @@ ARM_ARCH("armv7-m", cortexm3,	7M,  FL_CO_PROC |	      FL_FOR_ARCH7M)
 ARM_ARCH("armv7e-m", cortexm4,  7EM, FL_CO_PROC |	      FL_FOR_ARCH7EM)
 ARM_ARCH("ep9312",  ep9312,     4T,  FL_LDSCHED | FL_CIRRUS | FL_FOR_ARCH4)
 ARM_ARCH("iwmmxt",  iwmmxt,     5TE, FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT)
-ARM_ARCH("iwmmxt2", iwmmxt2,    5TE, FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT)
+ARM_ARCH("iwmmxt2", iwmmxt2,    5TE, FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT | FL_IWMMXT2)
diff --git a/gcc/config/arm/arm-cores.def b/gcc/config/arm/arm-cores.def
index d82b10b..c82eada 100644
--- a/gcc/config/arm/arm-cores.def
+++ b/gcc/config/arm/arm-cores.def
@@ -105,7 +105,7 @@ ARM_CORE("arm1020e",      arm1020e,	5TE,				 FL_LDSCHED, fastmul)
 ARM_CORE("arm1022e",      arm1022e,	5TE,				 FL_LDSCHED, fastmul)
 ARM_CORE("xscale",        xscale,	5TE,	                         FL_LDSCHED | FL_STRONG | FL_XSCALE, xscale)
 ARM_CORE("iwmmxt",        iwmmxt,	5TE,	                         FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT, xscale)
-ARM_CORE("iwmmxt2",       iwmmxt2,	5TE,	                         FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT, xscale)
+ARM_CORE("iwmmxt2",       iwmmxt2,	5TE,	                         FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT | FL_IWMMXT2, xscale)
 ARM_CORE("fa606te",       fa606te,      5TE,                             FL_LDSCHED, 9e)
 ARM_CORE("fa626te",       fa626te,      5TE,                             FL_LDSCHED, 9e)
 ARM_CORE("fmp626",        fmp626,       5TE,                             FL_LDSCHED, 9e)
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 7a98197..b0680ab 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -685,6 +685,7 @@ static int thumb_call_reg_needed;
 #define FL_ARM_DIV    (1 << 23)	      /* Hardware divide (ARM mode).  */
 
 #define FL_IWMMXT     (1 << 29)	      /* XScale v2 or "Intel Wireless MMX technology".  */
+#define FL_IWMMXT2    (1 << 30)       /* "Intel Wireless MMX2 technology".  */
 
 /* Flags that only effect tuning, not available instructions.  */
 #define FL_TUNE		(FL_WBUF | FL_VFPV2 | FL_STRONG | FL_LDSCHED \
@@ -766,6 +767,9 @@ int arm_arch_cirrus = 0;
 /* Nonzero if this chip supports Intel Wireless MMX technology.  */
 int arm_arch_iwmmxt = 0;
 
+/* Nonzero if this chip supports Intel Wireless MMX2 technology.  */
+int arm_arch_iwmmxt2 = 0;
+
 /* Nonzero if this chip is an XScale.  */
 int arm_arch_xscale = 0;
 
@@ -1717,6 +1721,7 @@ arm_option_override (void)
   arm_tune_wbuf = (tune_flags & FL_WBUF) != 0;
   arm_tune_xscale = (tune_flags & FL_XSCALE) != 0;
   arm_arch_iwmmxt = (insn_flags & FL_IWMMXT) != 0;
+  arm_arch_iwmmxt2 = (insn_flags & FL_IWMMXT2) != 0;
   arm_arch_thumb_hwdiv = (insn_flags & FL_THUMB_DIV) != 0;
   arm_arch_arm_hwdiv = (insn_flags & FL_ARM_DIV) != 0;
   arm_tune_cortex_a9 = (arm_tune == cortexa9) != 0;
@@ -1817,14 +1822,17 @@ arm_option_override (void)
     }
 
   /* FPA and iWMMXt are incompatible because the insn encodings overlap.
-     VFP and iWMMXt can theoretically coexist, but it's unlikely such silicon
-     will ever exist.  GCC makes no attempt to support this combination.  */
-  if (TARGET_IWMMXT && !TARGET_SOFT_FLOAT)
-    sorry ("iWMMXt and hardware floating point");
+     VFP and iWMMXt however can coexist.  */
+  if (TARGET_IWMMXT && TARGET_HARD_FLOAT && !TARGET_VFP)
+    error ("iWMMXt and non-VFP floating point unit are incompatible");
+
+  /* iWMMXt and NEON are incompatible.  */
+  if (TARGET_IWMMXT && TARGET_NEON)
+    error ("iWMMXt and NEON are incompatible");
 
-  /* ??? iWMMXt insn patterns need auditing for Thumb-2.  */
-  if (TARGET_THUMB2 && TARGET_IWMMXT)
-    sorry ("Thumb-2 iWMMXt");
+  /* iWMMXt unsupported under Thumb mode.  */
+  if (TARGET_THUMB && TARGET_IWMMXT)
+    error ("iWMMXt unsupported under Thumb mode");
 
   /* __fp16 support currently assumes the core has ldrh.  */
   if (!arm_arch4 && arm_fp16_format != ARM_FP16_FORMAT_NONE)
@@ -20867,7 +20875,8 @@ arm_expand_binop_builtin (enum insn_code icode,
       || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
     target = gen_reg_rtx (tmode);
 
-  gcc_assert (GET_MODE (op0) == mode0 && GET_MODE (op1) == mode1);
+  gcc_assert ((GET_MODE (op0) == mode0 || GET_MODE (op0) == VOIDmode)
+	      && (GET_MODE (op1) == mode1 || GET_MODE (op1) == VOIDmode));
 
   if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
     op0 = copy_to_mode_reg (mode0, op0);
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index f4204e4..c51bce9 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -97,6 +97,8 @@ extern char arm_arch_name[];
 	  builtin_define ("__XSCALE__");		\
 	if (arm_arch_iwmmxt)				\
 	  builtin_define ("__IWMMXT__");		\
+	if (arm_arch_iwmmxt2)				\
+	  builtin_define ("__IWMMXT2__");		\
 	if (TARGET_AAPCS_BASED)				\
 	  {						\
 	    if (arm_pcs_default == ARM_PCS_AAPCS_VFP)	\
@@ -194,7 +196,9 @@ extern void (*arm_lang_output_object_attributes_hook)(void);
 #define TARGET_MAVERICK		(arm_fpu_desc->model == ARM_FP_MODEL_MAVERICK)
 #define TARGET_VFP		(arm_fpu_desc->model == ARM_FP_MODEL_VFP)
 #define TARGET_IWMMXT			(arm_arch_iwmmxt)
+#define TARGET_IWMMXT2			(arm_arch_iwmmxt2)
 #define TARGET_REALLY_IWMMXT		(TARGET_IWMMXT && TARGET_32BIT)
+#define TARGET_REALLY_IWMMXT2		(TARGET_IWMMXT2 && TARGET_32BIT)
 #define TARGET_IWMMXT_ABI (TARGET_32BIT && arm_abi == ARM_ABI_IWMMXT)
 #define TARGET_ARM                      (! TARGET_THUMB)
 #define TARGET_EITHER			1 /* (TARGET_ARM | TARGET_THUMB) */
@@ -410,6 +414,9 @@ extern int arm_arch_cirrus;
 /* Nonzero if this chip supports Intel XScale with Wireless MMX technology.  */
 extern int arm_arch_iwmmxt;
 
+/* Nonzero if this chip supports Intel Wireless MMX2 technology.  */
+extern int arm_arch_iwmmxt2;
+
 /* Nonzero if this chip is an XScale.  */
 extern int arm_arch_xscale;
 
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index bbf6380..ad9d948 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -197,7 +197,7 @@
 ; for ARM or Thumb-2 with arm_arch6, and nov6 for ARM without
 ; arm_arch6.  This attribute is used to compute attribute "enabled",
 ; use type "any" to enable an alternative in all cases.
-(define_attr "arch" "any,a,t,32,t1,t2,v6,nov6,onlya8,neon_onlya8,nota8,neon_nota8"
+(define_attr "arch" "any,a,t,32,t1,t2,v6,nov6,onlya8,neon_onlya8,nota8,neon_nota8,iwmmxt,iwmmxt2"
   (const_string "any"))
 
 (define_attr "arch_enabled" "no,yes"
@@ -248,6 +248,10 @@
 	 (and (eq_attr "arch" "neon_nota8")
 	      (not (eq_attr "tune" "cortexa8"))
 	      (match_test "TARGET_NEON"))
+	 (const_string "yes")
+
+	 (and (eq_attr "arch" "iwmmxt2")
+	      (match_test "TARGET_REALLY_IWMMXT2"))
 	 (const_string "yes")]
 	(const_string "no")))
 
-- 
1.7.3.4

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-06-06 11:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-06 10:24 [PATCH, ARM, iWMMXt][1/5]: ARM code generic change Xinyu Qi
2011-07-12 22:45 ` Ramana Radhakrishnan
2011-07-14  7:38   ` Xinyu Qi
2011-08-18  2:21     ` Ramana Radhakrishnan
2011-08-18  8:24       ` Xinyu Qi
2011-12-14 17:03     ` Richard Earnshaw
2011-12-22  6:39       ` Xinyu Qi
2011-12-29  6:25       ` Xinyu Qi
2012-02-03  2:03       ` Xinyu Qi
2012-03-13  8:54       ` PING: " Xinyu Qi
2012-05-29  4:13 [PATCH ARM iWMMXt 0/5] Improve iWMMXt support Matt Turner
2012-05-29  4:14 ` [PATCH ARM iWMMXt 1/5] ARM code generic change Matt Turner
2012-06-06 11:53   ` Ramana Radhakrishnan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).