From f07a6b21f6b0c2a54a94b6d98bbddc2560be0ee4 Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Fri, 13 Feb 2004 21:49:26 +0000 Subject: [PATCH] Two minor fixes. * config/arm/mmintrin.h (_mm_setwcx): Reverse arguments in call to __builtin_arm_setwcx (). * config/arm/arm.c (arm_expand_builtin): Generate operands correctly and reverse their order in call to gen_iwmmxt_tmcr (). and: * config/arm/arm.c (bdesc_2arg): Correct builtin names "wmulsh" and "wmuluh" to "wmulsm" and "wmulum", respectively. * config/arm/arm.h (enum arm_builtins): Rename enumerators to ARM_BUILTIN_WMULSM and ARM_BUILTIN_WMULUM. * config/arm/mmintrin.h (_mm_mulhi_pi16): Update intrinsic call. (_mm_mulhi_pu16): Likewise. From-SVN: r77774 --- gcc/ChangeLog | 16 ++++++++++++++++ gcc/config/arm/arm.c | 10 +++++----- gcc/config/arm/arm.h | 4 ++-- gcc/config/arm/mmintrin.h | 22 +++++++++++----------- 4 files changed, 34 insertions(+), 18 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b3800835710f..36d4f3350ff1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +2004-02-14 Ben Elliston + + * config/arm/mmintrin.h (_mm_setwcx): Reverse arguments in call to + __builtin_arm_setwcx (). + * config/arm/arm.c (arm_expand_builtin): Generate operands + correctly and reverse their order in call to gen_iwmmxt_tmcr (). + +2004-02-14 Ben Elliston + + * config/arm/arm.c (bdesc_2arg): Correct builtin names "wmulsh" + and "wmuluh" to "wmulsm" and "wmulum", respectively. + * config/arm/arm.h (enum arm_builtins): Rename enumerators to + ARM_BUILTIN_WMULSM and ARM_BUILTIN_WMULUM. + * config/arm/mmintrin.h (_mm_mulhi_pi16): Update intrinsic call. + (_mm_mulhi_pu16): Likewise. + 2004-02-13 Zack Weinberg * xcoffout.c (xcoff_assign_fundamental_type_number): Check diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 67641bf3c75e..2ec011e90321 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -11360,8 +11360,8 @@ static const struct builtin_description bdesc_2arg[] = IWMMXT_BUILTIN (ussubv4hi3, "wsubhus", WSUBUSH) IWMMXT_BUILTIN (ussubv2si3, "wsubwus", WSUBUSW) IWMMXT_BUILTIN (mulv4hi3, "wmulul", WMULUL) - IWMMXT_BUILTIN (smulv4hi3_highpart, "wmulsh", WMULSH) - IWMMXT_BUILTIN (umulv4hi3_highpart, "wmuluh", WMULUH) + IWMMXT_BUILTIN (smulv4hi3_highpart, "wmulsm", WMULSM) + IWMMXT_BUILTIN (umulv4hi3_highpart, "wmulum", WMULUM) IWMMXT_BUILTIN (eqv8qi3, "wcmpeqb", WCMPEQB) IWMMXT_BUILTIN (eqv4hi3, "wcmpeqh", WCMPEQH) IWMMXT_BUILTIN (eqv2si3, "wcmpeqw", WCMPEQW) @@ -11991,9 +11991,9 @@ arm_expand_builtin (tree exp, case ARM_BUILTIN_SETWCX: arg0 = TREE_VALUE (arglist); arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - op1 = force_reg (SImode, expand_expr (arg1, NULL_RTX, VOIDmode, 0)); - emit_insn (gen_iwmmxt_tmcr (op0, op1)); + op0 = force_reg (SImode, expand_expr (arg0, NULL_RTX, VOIDmode, 0)); + op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + emit_insn (gen_iwmmxt_tmcr (op1, op0)); return 0; case ARM_BUILTIN_GETWCX: diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 26c452690968..3f082eabef0c 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -2971,8 +2971,8 @@ enum arm_builtins ARM_BUILTIN_WMINUH, ARM_BUILTIN_WMINUB, - ARM_BUILTIN_WMULUH, - ARM_BUILTIN_WMULSH, + ARM_BUILTIN_WMULUM, + ARM_BUILTIN_WMULSM, ARM_BUILTIN_WMULUL, ARM_BUILTIN_PSADBH, diff --git a/gcc/config/arm/mmintrin.h b/gcc/config/arm/mmintrin.h index 4dc1d455ce75..131c434d37f6 100644 --- a/gcc/config/arm/mmintrin.h +++ b/gcc/config/arm/mmintrin.h @@ -419,7 +419,7 @@ _mm_madd_pu16 (__m64 __m1, __m64 __m2) static __inline __m64 _mm_mulhi_pi16 (__m64 __m1, __m64 __m2) { - return (__m64) __builtin_arm_wmulsh ((__v4hi)__m1, (__v4hi)__m2); + return (__m64) __builtin_arm_wmulsm ((__v4hi)__m1, (__v4hi)__m2); } /* Multiply four signed 16-bit values in M1 by four signed 16-bit values in @@ -427,7 +427,7 @@ _mm_mulhi_pi16 (__m64 __m1, __m64 __m2) static __inline __m64 _mm_mulhi_pu16 (__m64 __m1, __m64 __m2) { - return (__m64) __builtin_arm_wmuluh ((__v4hi)__m1, (__v4hi)__m2); + return (__m64) __builtin_arm_wmulum ((__v4hi)__m1, (__v4hi)__m2); } /* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce @@ -986,18 +986,18 @@ _mm_setzero_si64 (void) the rest are reserved. */ static __inline void -_mm_setwcx (const int __regno, const int __value) +_mm_setwcx (const int __value, const int __regno) { switch (__regno) { - case 0: __builtin_arm_setwcx (0, __value); break; - case 1: __builtin_arm_setwcx (1, __value); break; - case 2: __builtin_arm_setwcx (2, __value); break; - case 3: __builtin_arm_setwcx (3, __value); break; - case 8: __builtin_arm_setwcx (8, __value); break; - case 9: __builtin_arm_setwcx (9, __value); break; - case 10: __builtin_arm_setwcx (10, __value); break; - case 11: __builtin_arm_setwcx (11, __value); break; + case 0: __builtin_arm_setwcx (__value, 0); break; + case 1: __builtin_arm_setwcx (__value, 1); break; + case 2: __builtin_arm_setwcx (__value, 2); break; + case 3: __builtin_arm_setwcx (__value, 3); break; + case 8: __builtin_arm_setwcx (__value, 8); break; + case 9: __builtin_arm_setwcx (__value, 9); break; + case 10: __builtin_arm_setwcx (__value, 10); break; + case 11: __builtin_arm_setwcx (__value, 11); break; default: break; } } -- 2.47.2