diff mbox

arm: Fix iwmmxt shift and logical intrinsics (PR 35294).

Message ID 1330142015-26244-1-git-send-email-mattst88@gmail.com
State New
Headers show

Commit Message

Matt Turner Feb. 25, 2012, 3:53 a.m. UTC
PR 36798 and 36966 are duplicates.

2012-02-24  Matt Turner  <mattst88@gmail.com>

	PR target/35294
	* config/arm/arm.c (arm_expand_builtin): Wire up missing
	intrinsics.
---
 gcc/config/arm/arm.c |   62 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 61 insertions(+), 1 deletions(-)

Comments

Matt Turner May 28, 2012, 9:57 p.m. UTC | #1
On Fri, Feb 24, 2012 at 10:53 PM, Matt Turner <mattst88@gmail.com> wrote:
> PR 36798 and 36966 are duplicates.
>
> 2012-02-24  Matt Turner  <mattst88@gmail.com>
>
>        PR target/35294
>        * config/arm/arm.c (arm_expand_builtin): Wire up missing
>        intrinsics.
> ---
>  gcc/config/arm/arm.c |   62 +++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 61 insertions(+), 1 deletions(-)

Drop this patch. Marvell has a five patch series that fixes this and
more. Maybe this patch would be suitable for the 4.6 and 4.7 branches,
since Marvell's adds some features?
Ramana Radhakrishnan June 6, 2012, 10:22 a.m. UTC | #2
On 28 May 2012 22:57, Matt Turner <mattst88@gmail.com> wrote:
> On Fri, Feb 24, 2012 at 10:53 PM, Matt Turner <mattst88@gmail.com> wrote:
>> PR 36798 and 36966 are duplicates.
>>
>> 2012-02-24  Matt Turner  <mattst88@gmail.com>
>>
>>        PR target/35294
>>        * config/arm/arm.c (arm_expand_builtin): Wire up missing
>>        intrinsics.
>> ---
>>  gcc/config/arm/arm.c |   62 +++++++++++++++++++++++++++++++++++++++++++++++++-
>>  1 files changed, 61 insertions(+), 1 deletions(-)
>
> Drop this patch. Marvell has a five patch series that fixes this and
> more. Maybe this patch would be suitable for the 4.6 and 4.7 branches,
> since Marvell's adds some features?

So you want  to drop this patch for trunk in favour of the Marvell
patches and use this only for the 4.6 and 4.7 branches ? Instead,
could the bug fix be teased out of the appropriate Marvell patch and
that submitted as a separate patch which can then be applied to trunk
and the release branches. ?

regards,
Ramana
diff mbox

Patch

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 7f0dc6b..f5935d6 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -20502,7 +20502,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);
@@ -21181,6 +21182,65 @@  arm_expand_builtin (tree exp,
       emit_insn (pat);
       return target;
 
+    case ARM_BUILTIN_WSLLH:
+    case ARM_BUILTIN_WSLLHI:
+    case ARM_BUILTIN_WSLLW:
+    case ARM_BUILTIN_WSLLWI:
+    case ARM_BUILTIN_WSLLD:
+    case ARM_BUILTIN_WSLLDI:
+    case ARM_BUILTIN_WSRAH:
+    case ARM_BUILTIN_WSRAHI:
+    case ARM_BUILTIN_WSRAW:
+    case ARM_BUILTIN_WSRAWI:
+    case ARM_BUILTIN_WSRAD:
+    case ARM_BUILTIN_WSRADI:
+    case ARM_BUILTIN_WSRLH:
+    case ARM_BUILTIN_WSRLHI:
+    case ARM_BUILTIN_WSRLW:
+    case ARM_BUILTIN_WSRLWI:
+    case ARM_BUILTIN_WSRLD:
+    case ARM_BUILTIN_WSRLDI:
+    case ARM_BUILTIN_WRORH:
+    case ARM_BUILTIN_WRORHI:
+    case ARM_BUILTIN_WRORW:
+    case ARM_BUILTIN_WRORWI:
+    case ARM_BUILTIN_WRORD:
+    case ARM_BUILTIN_WRORDI:
+    case ARM_BUILTIN_WAND:
+    case ARM_BUILTIN_WANDN:
+    case ARM_BUILTIN_WOR:
+    case ARM_BUILTIN_WXOR:
+      icode = (fcode == ARM_BUILTIN_WSLLH ? CODE_FOR_ashlv4hi3_di
+	       : fcode == ARM_BUILTIN_WSLLHI ? CODE_FOR_ashlv4hi3_iwmmxt
+	       : fcode == ARM_BUILTIN_WSLLW  ? CODE_FOR_ashlv2si3_di
+	       : fcode == ARM_BUILTIN_WSLLWI ? CODE_FOR_ashlv2si3_iwmmxt
+	       : fcode == ARM_BUILTIN_WSLLD  ? CODE_FOR_ashldi3_di
+	       : fcode == ARM_BUILTIN_WSLLDI ? CODE_FOR_ashldi3_iwmmxt
+	       : fcode == ARM_BUILTIN_WSRAH  ? CODE_FOR_ashrv4hi3_di
+	       : fcode == ARM_BUILTIN_WSRAHI ? CODE_FOR_ashrv4hi3_iwmmxt
+	       : fcode == ARM_BUILTIN_WSRAW  ? CODE_FOR_ashrv2si3_di
+	       : fcode == ARM_BUILTIN_WSRAWI ? CODE_FOR_ashrv2si3_iwmmxt
+	       : fcode == ARM_BUILTIN_WSRAD  ? CODE_FOR_ashrdi3_di
+	       : fcode == ARM_BUILTIN_WSRADI ? CODE_FOR_ashrdi3_iwmmxt
+	       : fcode == ARM_BUILTIN_WSRLH  ? CODE_FOR_lshrv4hi3_di
+	       : fcode == ARM_BUILTIN_WSRLHI ? CODE_FOR_lshrv4hi3_iwmmxt
+	       : fcode == ARM_BUILTIN_WSRLW  ? CODE_FOR_lshrv2si3_di
+	       : fcode == ARM_BUILTIN_WSRLWI ? CODE_FOR_lshrv2si3_iwmmxt
+	       : fcode == ARM_BUILTIN_WSRLD  ? CODE_FOR_lshrdi3_di
+	       : fcode == ARM_BUILTIN_WSRLDI ? CODE_FOR_lshrdi3_iwmmxt
+	       : fcode == ARM_BUILTIN_WRORH  ? CODE_FOR_rorv4hi3_di
+	       : fcode == ARM_BUILTIN_WRORHI ? CODE_FOR_rorv4hi3
+	       : fcode == ARM_BUILTIN_WRORW  ? CODE_FOR_rorv2si3_di
+	       : fcode == ARM_BUILTIN_WRORWI ? CODE_FOR_rorv2si3
+	       : fcode == ARM_BUILTIN_WRORD  ? CODE_FOR_rordi3_di
+	       : fcode == ARM_BUILTIN_WRORDI ? CODE_FOR_rordi3
+	       : fcode == ARM_BUILTIN_WAND   ? CODE_FOR_iwmmxt_anddi3
+	       : fcode == ARM_BUILTIN_WANDN  ? CODE_FOR_iwmmxt_nanddi3
+	       : fcode == ARM_BUILTIN_WOR    ? CODE_FOR_iwmmxt_iordi3
+	       : fcode == ARM_BUILTIN_WXOR   ? CODE_FOR_iwmmxt_xordi3
+	       : CODE_FOR_rordi3);
+      return arm_expand_binop_builtin (icode, exp, target);
+
     case ARM_BUILTIN_WZERO:
       target = gen_reg_rtx (DImode);
       emit_insn (gen_iwmmxt_clrdi (target));