summaryrefslogtreecommitdiff
path: root/gcc/config/i386/smmintrin.h
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-20 20:57:56 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-20 20:57:56 +0000
commitc9b3a2b94bc62096bed59cceeb5b09021f030410 (patch)
tree3fdebaa5aeacce0c4fd97369c27c1bb07d91c5d5 /gcc/config/i386/smmintrin.h
parent2d1f5289b503a82bc23e56f88e9652972f68bd4a (diff)
downloadgcc-c9b3a2b94bc62096bed59cceeb5b09021f030410.tar.gz
Cast to unsigned short/char first for _mm_extract_epi16/_mm_extract_epi8.
gcc/ 2010-08-20 H.J. Lu <hongjiu.lu@intel.com> PR target/45336 * config/i386/emmintrin.h (_mm_extract_epi16): Cast to unsigned short first. * config/i386/smmintrin.h (_mm_extract_epi8): Cast to unsigned char first. gcc/testsuite/ 2010-08-20 H.J. Lu <hongjiu.lu@intel.com> PR target/45336 * gcc.target/i386/pr45336-1.c: New. * gcc.target/i386/pr45336-2.c: Likewise. * gcc.target/i386/pr45336-3.c: Likewise. * gcc.target/i386/pr45336-4.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163421 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386/smmintrin.h')
-rw-r--r--gcc/config/i386/smmintrin.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/config/i386/smmintrin.h b/gcc/config/i386/smmintrin.h
index 170fae589b9..357b527367c 100644
--- a/gcc/config/i386/smmintrin.h
+++ b/gcc/config/i386/smmintrin.h
@@ -439,7 +439,7 @@ _mm_insert_epi64 (__m128i __D, long long __S, const int __N)
extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_extract_epi8 (__m128i __X, const int __N)
{
- return __builtin_ia32_vec_ext_v16qi ((__v16qi)__X, __N);
+ return (unsigned char) __builtin_ia32_vec_ext_v16qi ((__v16qi)__X, __N);
}
extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
@@ -457,7 +457,7 @@ _mm_extract_epi64 (__m128i __X, const int __N)
#endif
#else
#define _mm_extract_epi8(X, N) \
- ((int) __builtin_ia32_vec_ext_v16qi ((__v16qi)(__m128i)(X), (int)(N)))
+ ((int) (unsigned char) __builtin_ia32_vec_ext_v16qi ((__v16qi)(__m128i)(X), (int)(N)))
#define _mm_extract_epi32(X, N) \
((int) __builtin_ia32_vec_ext_v4si ((__v4si)(__m128i)(X), (int)(N)))