Patchwork arm: add _mm_empty to mmintrin.h for source compatibility

login
register
mail settings
Submitter Matt Turner
Date Feb. 25, 2012, 3:53 a.m.
Message ID <1330142015-26244-2-git-send-email-mattst88@gmail.com>
Download mbox | patch
Permalink /patch/143027/
State New
Headers show

Comments

Matt Turner - Feb. 25, 2012, 3:53 a.m.
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(-)
Ramana Radhakrishnan - Feb. 29, 2012, 12:13 a.m.
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
>
Matt Turner - May 28, 2012, 9:56 p.m.
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. :)

Patch

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