* [PATCH] arm: Fix iwmmxt shift and logical intrinsics (PR 35294).
@ 2012-02-25 3:54 Matt Turner
2012-02-25 5:29 ` [PATCH] arm: add _mm_empty to mmintrin.h for source compatibility Matt Turner
2012-05-28 21:58 ` [PATCH] arm: Fix iwmmxt shift and logical intrinsics (PR 35294) Matt Turner
0 siblings, 2 replies; 7+ messages in thread
From: Matt Turner @ 2012-02-25 3:54 UTC (permalink / raw)
To: gcc-patches
Cc: Nick Clifton, Richard Earnshaw, Paul Brook, Ramana Radhakrishnan,
Matt Turner
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(-)
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));
--
1.7.3.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] arm: add _mm_empty to mmintrin.h for source compatibility
2012-02-25 3:54 [PATCH] arm: Fix iwmmxt shift and logical intrinsics (PR 35294) Matt Turner
@ 2012-02-25 5:29 ` Matt Turner
2012-02-29 1:58 ` Ramana Radhakrishnan
2012-05-28 21:58 ` [PATCH] arm: Fix iwmmxt shift and logical intrinsics (PR 35294) Matt Turner
1 sibling, 1 reply; 7+ messages in thread
From: Matt Turner @ 2012-02-25 5:29 UTC (permalink / raw)
To: gcc-patches
Cc: Nick Clifton, Richard Earnshaw, Paul Brook, Ramana Radhakrishnan,
Matt Turner
The x86/amd64 mmintrin.h provides the _mm_empty intrinsic for the 'emms'
MMX instruction. Although ARM does not need such an instruction, we
should provide an empty _mm_empty function nonetheless for source
compatibility.
2012-02-24 Matt Turner <mattst88@gmail.com>
* config/arm/mmintrin.h (_mm_empty): New.
---
gcc/config/arm/mmintrin.h | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/gcc/config/arm/mmintrin.h b/gcc/config/arm/mmintrin.h
index 2cc500d..ea73bf1 100644
--- a/gcc/config/arm/mmintrin.h
+++ b/gcc/config/arm/mmintrin.h
@@ -32,6 +32,12 @@ typedef int __v2si __attribute__ ((vector_size (8)));
typedef short __v4hi __attribute__ ((vector_size (8)));
typedef char __v8qi __attribute__ ((vector_size (8)));
+/* Provided for source compatibility with MMX. */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_empty (void)
+{
+}
+
/* "Convert" __m64 and __int64 into each other. */
static __inline __m64
_mm_cvtsi64_m64 (__int64 __i)
@@ -1248,6 +1254,7 @@ _m_from_int (int __a)
#define _m_psadzbw _mm_sadz_pu8
#define _m_psadzwd _mm_sadz_pu16
#define _m_paligniq _mm_align_si64
+#define _m_empty _mm_empty
#define _m_cvt_si2pi _mm_cvtsi64_m64
#define _m_cvt_pi2si _mm_cvtm64_si64
--
1.7.3.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] arm: add _mm_empty to mmintrin.h for source compatibility
2012-02-25 5:29 ` [PATCH] arm: add _mm_empty to mmintrin.h for source compatibility Matt Turner
@ 2012-02-29 1:58 ` Ramana Radhakrishnan
2012-05-28 21:57 ` Matt Turner
0 siblings, 1 reply; 7+ messages in thread
From: Ramana Radhakrishnan @ 2012-02-29 1:58 UTC (permalink / raw)
To: Matt Turner
Cc: gcc-patches, Nick Clifton, Richard Earnshaw, Paul Brook,
Ramana Radhakrishnan
On Fri, Feb 24, 2012 at 10:53:35PM -0500, Matt Turner wrote:
> The x86/amd64 mmintrin.h provides the _mm_empty intrinsic for the 'emms'
> MMX instruction. Although ARM does not need such an instruction, we
> should provide an empty _mm_empty function nonetheless for source
> compatibility.
OK for 4.8 and after your copyright assignment has been
sorted.
Ramana
>
> 2012-02-24 Matt Turner <mattst88@gmail.com>
>
> * config/arm/mmintrin.h (_mm_empty): New.
> ---
> gcc/config/arm/mmintrin.h | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/gcc/config/arm/mmintrin.h b/gcc/config/arm/mmintrin.h
> index 2cc500d..ea73bf1 100644
> --- a/gcc/config/arm/mmintrin.h
> +++ b/gcc/config/arm/mmintrin.h
> @@ -32,6 +32,12 @@ typedef int __v2si __attribute__ ((vector_size (8)));
> typedef short __v4hi __attribute__ ((vector_size (8)));
> typedef char __v8qi __attribute__ ((vector_size (8)));
>
> +/* Provided for source compatibility with MMX. */
> +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
> +_mm_empty (void)
> +{
> +}
> +
> /* "Convert" __m64 and __int64 into each other. */
> static __inline __m64
> _mm_cvtsi64_m64 (__int64 __i)
> @@ -1248,6 +1254,7 @@ _m_from_int (int __a)
> #define _m_psadzbw _mm_sadz_pu8
> #define _m_psadzwd _mm_sadz_pu16
> #define _m_paligniq _mm_align_si64
> +#define _m_empty _mm_empty
> #define _m_cvt_si2pi _mm_cvtsi64_m64
> #define _m_cvt_pi2si _mm_cvtm64_si64
>
> --
> 1.7.3.4
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] arm: add _mm_empty to mmintrin.h for source compatibility
2012-02-29 1:58 ` Ramana Radhakrishnan
@ 2012-05-28 21:57 ` Matt Turner
2012-06-06 9:42 ` Ramana Radhakrishnan
0 siblings, 1 reply; 7+ messages in thread
From: Matt Turner @ 2012-05-28 21:57 UTC (permalink / raw)
To: Ramana Radhakrishnan
Cc: gcc-patches, Nick Clifton, Richard Earnshaw, Paul Brook,
Ramana Radhakrishnan
On Tue, Feb 28, 2012 at 7:13 PM, Ramana Radhakrishnan
<ramana.radhakrishnan@linaro.org> wrote:
> On Fri, Feb 24, 2012 at 10:53:35PM -0500, Matt Turner wrote:
>> The x86/amd64 mmintrin.h provides the _mm_empty intrinsic for the 'emms'
>> MMX instruction. Although ARM does not need such an instruction, we
>> should provide an empty _mm_empty function nonetheless for source
>> compatibility.
>
> OK for 4.8 and after your copyright assignment has been
> sorted.
>
> Ramana
>
>>
>> 2012-02-24 Matt Turner <mattst88@gmail.com>
>>
>> * config/arm/mmintrin.h (_mm_empty): New.
>> ---
>> gcc/config/arm/mmintrin.h | 7 +++++++
>> 1 files changed, 7 insertions(+), 0 deletions(-)
>>
>> diff --git a/gcc/config/arm/mmintrin.h b/gcc/config/arm/mmintrin.h
>> index 2cc500d..ea73bf1 100644
>> --- a/gcc/config/arm/mmintrin.h
>> +++ b/gcc/config/arm/mmintrin.h
>> @@ -32,6 +32,12 @@ typedef int __v2si __attribute__ ((vector_size (8)));
>> typedef short __v4hi __attribute__ ((vector_size (8)));
>> typedef char __v8qi __attribute__ ((vector_size (8)));
>>
>> +/* Provided for source compatibility with MMX. */
>> +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
>> +_mm_empty (void)
>> +{
>> +}
>> +
>> /* "Convert" __m64 and __int64 into each other. */
>> static __inline __m64
>> _mm_cvtsi64_m64 (__int64 __i)
>> @@ -1248,6 +1254,7 @@ _m_from_int (int __a)
>> #define _m_psadzbw _mm_sadz_pu8
>> #define _m_psadzwd _mm_sadz_pu16
>> #define _m_paligniq _mm_align_si64
>> +#define _m_empty _mm_empty
>> #define _m_cvt_si2pi _mm_cvtsi64_m64
>> #define _m_cvt_pi2si _mm_cvtm64_si64
>>
>> --
>> 1.7.3.4
>>
Copyright assignment is sorted. Please commit. :)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] arm: Fix iwmmxt shift and logical intrinsics (PR 35294).
2012-02-25 3:54 [PATCH] arm: Fix iwmmxt shift and logical intrinsics (PR 35294) Matt Turner
2012-02-25 5:29 ` [PATCH] arm: add _mm_empty to mmintrin.h for source compatibility Matt Turner
@ 2012-05-28 21:58 ` Matt Turner
2012-06-06 11:09 ` Ramana Radhakrishnan
1 sibling, 1 reply; 7+ messages in thread
From: Matt Turner @ 2012-05-28 21:58 UTC (permalink / raw)
To: gcc-patches
Cc: Nick Clifton, Richard Earnshaw, Paul Brook, Ramana Radhakrishnan,
Matt Turner
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?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] arm: add _mm_empty to mmintrin.h for source compatibility
2012-05-28 21:57 ` Matt Turner
@ 2012-06-06 9:42 ` Ramana Radhakrishnan
0 siblings, 0 replies; 7+ messages in thread
From: Ramana Radhakrishnan @ 2012-06-06 9:42 UTC (permalink / raw)
To: Matt Turner; +Cc: gcc-patches, Nick Clifton, Richard Earnshaw, Paul Brook
On 28 May 2012 22:56, Matt Turner <mattst88@gmail.com> wrote:
> On Tue, Feb 28, 2012 at 7:13 PM, Ramana Radhakrishnan
> <ramana.radhakrishnan@linaro.org> wrote:
>> On Fri, Feb 24, 2012 at 10:53:35PM -0500, Matt Turner wrote:
>>> The x86/amd64 mmintrin.h provides the _mm_empty intrinsic for the 'emms'
>>> MMX instruction. Although ARM does not need such an instruction, we
>>> should provide an empty _mm_empty function nonetheless for source
>>> compatibility.
>>
>> OK for 4.8 and after your copyright assignment has been
>> sorted.
>>
>> Ramana
>>
>>>
>>> 2012-02-24 Matt Turner <mattst88@gmail.com>
>>>
>>> * config/arm/mmintrin.h (_mm_empty): New.
>>> ---
>>> gcc/config/arm/mmintrin.h | 7 +++++++
>>> 1 files changed, 7 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/gcc/config/arm/mmintrin.h b/gcc/config/arm/mmintrin.h
>>> index 2cc500d..ea73bf1 100644
>>> --- a/gcc/config/arm/mmintrin.h
>>> +++ b/gcc/config/arm/mmintrin.h
>>> @@ -32,6 +32,12 @@ typedef int __v2si __attribute__ ((vector_size (8)));
>>> typedef short __v4hi __attribute__ ((vector_size (8)));
>>> typedef char __v8qi __attribute__ ((vector_size (8)));
>>>
>>> +/* Provided for source compatibility with MMX. */
>>> +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
>>> +_mm_empty (void)
>>> +{
>>> +}
>>> +
>>> /* "Convert" __m64 and __int64 into each other. */
>>> static __inline __m64
>>> _mm_cvtsi64_m64 (__int64 __i)
>>> @@ -1248,6 +1254,7 @@ _m_from_int (int __a)
>>> #define _m_psadzbw _mm_sadz_pu8
>>> #define _m_psadzwd _mm_sadz_pu16
>>> #define _m_paligniq _mm_align_si64
>>> +#define _m_empty _mm_empty
>>> #define _m_cvt_si2pi _mm_cvtsi64_m64
>>> #define _m_cvt_pi2si _mm_cvtm64_si64
>>>
>>> --
>>> 1.7.3.4
>>>
>
> Copyright assignment is sorted. Please commit. :)
Done now. Only change was to put _m_empty in alphabetical order and
this is what I committed.
Thanks,
Ramana
Index: gcc/config/arm/mmintrin.h
===================================================================
--- gcc/config/arm/mmintrin.h (revision 188258)
+++ gcc/config/arm/mmintrin.h (revision 188259)
@@ -32,6 +32,12 @@
typedef short __v4hi __attribute__ ((vector_size (8)));
typedef char __v8qi __attribute__ ((vector_size (8)));
+/* Provided for source compatibility with MMX. */
+extern __inline void __attribute__((__gnu_inline__,
__always_inline__, __artificial__))
+_mm_empty (void)
+{
+}
+
/* "Convert" __m64 and __int64 into each other. */
static __inline __m64
_mm_cvtsi64_m64 (__int64 __i)
@@ -1115,6 +1121,7 @@
return (__m64)__a;
}
+#define _m_empty _mm_empty
#define _m_packsswb _mm_packs_pi16
#define _m_packssdw _mm_packs_pi32
#define _m_packuswb _mm_packs_pu16
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] arm: Fix iwmmxt shift and logical intrinsics (PR 35294).
2012-05-28 21:58 ` [PATCH] arm: Fix iwmmxt shift and logical intrinsics (PR 35294) Matt Turner
@ 2012-06-06 11:09 ` Ramana Radhakrishnan
0 siblings, 0 replies; 7+ messages in thread
From: Ramana Radhakrishnan @ 2012-06-06 11:09 UTC (permalink / raw)
To: Matt Turner; +Cc: gcc-patches, Nick Clifton, Richard Earnshaw, Paul Brook
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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-06-06 10:23 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-25 3:54 [PATCH] arm: Fix iwmmxt shift and logical intrinsics (PR 35294) Matt Turner
2012-02-25 5:29 ` [PATCH] arm: add _mm_empty to mmintrin.h for source compatibility Matt Turner
2012-02-29 1:58 ` Ramana Radhakrishnan
2012-05-28 21:57 ` Matt Turner
2012-06-06 9:42 ` Ramana Radhakrishnan
2012-05-28 21:58 ` [PATCH] arm: Fix iwmmxt shift and logical intrinsics (PR 35294) Matt Turner
2012-06-06 11:09 ` 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).