re PR target/46419 (_mm_cvtpu16_ps (and hence _mm_cvtpu8_ps) returns false result)
authorUros Bizjak <uros@gcc.gnu.org>
Wed, 10 Nov 2010 23:00:01 +0000 (00:00 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Wed, 10 Nov 2010 23:00:01 +0000 (00:00 +0100)
PR middle-end/46419
* config/i386/xmmintrin.h (_mm_cvtpi16_ps): Swap __hisi and __losi.
(_mm_cvtpu16_ps): Ditto.

testsuite/ChangeLog:

PR target/46419
* gcc-target/i386/pr46419.c: New test.

From-SVN: r166569

gcc/ChangeLog
gcc/config/i386/xmmintrin.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr46419.c [new file with mode: 0644]

index bd6c0d776d02b51a1b6f6c706a7721a82f9d7a12..185cb4026fc2ca733468fda2c65a4c0eaaa85070 100644 (file)
@@ -1,3 +1,9 @@
+2010-11-10  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR middle-end/46419
+       * config/i386/xmmintrin.h (_mm_cvtpi16_ps): Swap __hisi and __losi.
+       (_mm_cvtpu16_ps): Ditto.
+
 2010-11-10  Joseph Myers  <joseph@codesourcery.com>
 
        * common.opt (flag_excess_precision_cmdline, flag_generate_lto,
@@ -34,8 +40,7 @@
        OPT_dumpdir, OPT_falign_functions_, OPT_falign_jumps_,
        OPT_falign_labels_, OPT_falign_loops_, OPT_fira_verbose_, OPT_o or
        OPT_fwhopr_.  Do not explicitly set .opt file variables for
-       OPT_aux_info or OPT_pedantic_errors.  Use dc for diagnostic
-       context.
+       OPT_aux_info or OPT_pedantic_errors.  Use dc for diagnostic context.
        (set_Wstrict_aliasing): Add gcc_options parameter.
        * opts.h (struct cl_option_handler_func): Add diagnostic_context
        parameter to handler.
        * doc/tm.texi: Regenerate.
        * opts-common.c (tm.h): Don't include.
        (target_option_translations): Remove.
-       (decode_cmdline_options_to_array): Don't handle translating
-       options.
+       (decode_cmdline_options_to_array): Don't handle translating options.
        * system.h (TARGET_OPTION_TRANSLATE_TABLE): Poison.
        * config/darwin-driver.c: Don't condition includes on
        CROSS_DIRECTORY_STRUCTURE.
        (DRIVER_SELF_SPECS): Handle options formerly in
        TARGET_OPTION_TRANSLATE_TABLE.
        * config/mep/mep.opt (mfar): New.
-       * config/picochip/picochip.h (TARGET_OPTION_TRANSLATE_TABLE):
-       Remove.
+       * config/picochip/picochip.h (TARGET_OPTION_TRANSLATE_TABLE): Remove.
        (DRIVER_SELF_SPECS): Define.  Handle options formerly in
        TARGET_OPTION_TRANSLATE_TABLE.
-       * config/rs6000/darwin.h (CC1_SPEC): Handle -faltivec and
-       -fno-altivec.
+       * config/rs6000/darwin.h (CC1_SPEC): Handle -faltivec and -fno-altivec.
        (SUBTARGET_OPTION_TRANSLATE_TABLE): Remove.
        * config/rs6000/darwin.opt (Waltivec-long-deprecated, faltivec,
        ffix-and-continue, findirect-data): New.
        initialized at ggc_collect call.
        (Troubleshooting): New section.
 
-2010-11-09   Jan Hubicka  <jh@suse.cz>
+2010-11-09  Jan Hubicka  <jh@suse.cz>
 
        PR tree-optimization/40436
        * ipa-inline.c (leaf_node_p): Implement using is_inexpensive_builtin.
        (fix_trunc<mode>si2_mem): Ditto.
        (fixuns_trunc<mode>si2_mem): Ditto.
        (round32<mode>2_fprs): New combiner insn to combine (double)(int)
-       type operations to reduce copying the values to multiple memory
-       slots.
+       type operations to reduce copying the values to multiple memory slots.
        (roundu32<mode>2_fprs): Ditto.
 
        * config/rs6000/rs6000.c (rs6000_address_for_fpconvert): Handle
 
 2010-11-09  Paul Koning  <ni1d@arrl.net>
 
-       * config/pdp11/pdp11.md (lshrsi3, lshrhi3): Use add for
-       decrement. 
+       * config/pdp11/pdp11.md (lshrsi3, lshrhi3): Use add for decrement.
 
 2010-11-09  Richard Guenther  <rguenther@suse.de>
 
 2010-11-09  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR bootstrap/46392
-       * gengtype-parse.c (type): Call get_input_file_name to get
-       file name.
+       * gengtype-parse.c (type): Call get_input_file_name to get file name.
 
 2010-11-09  Eric Botcazou  <ebotcazou@adacore.com>
 
 2010-11-09  Basile Starynkevitch  <basile@starynkevitch.net>
            Jeremie Salvucci  <jeremie.salvucci@free.fr>
 
-       * gengtype.c (get_output_file_name): Declaration moved to
-       gengtype.h.
+       * gengtype.c (get_output_file_name): Declaration moved to gengtype.h.
        (plugin_files, get_file_basename, get_file_realbasename)
        (get_file_langdir, error_at_line, gt_files, this_file)
        (system_h_file, read_input_list, create_field_all)
        * gengtype.h: (struct input_file_st, input_file): New type.
        (struct fileloc): Use it.
        (gt_files, num_gt_files, this_file, system_h_file)
-       (input_file_by_name, get_file_srcdir_relative_path): Use
-       input_file.
+       (input_file_by_name, get_file_srcdir_relative_path): Use input_file.
        (get_input_file_name): New function.
        (get_lang_bitmap, set_lang_bitmap): Moved from gengtype.c and
-        use input_file.
+       use input_file.
        (lang_dir_names, num_lang_dirs, get_output_file_with_visibility)
        (get_output_file_name): Ditto.
 
 
 2010-11-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
-       * config/i386/i386.c (ix86_function_arg_boundary): Fix warning
-       message.
+       * config/i386/i386.c (ix86_function_arg_boundary): Fix warning message.
 
 2010-11-08  Basile Starynkevitch  <basile@starynkevitch.net>
 
index 544577ecaf085e966bb054d7ef4782c24cf9e4b6..8bec37440357f15b6611b1e642eeaccc53470ca9 100644 (file)
@@ -626,13 +626,13 @@ _mm_cvtpi16_ps (__m64 __A)
   __sign = __builtin_ia32_pcmpgtw ((__v4hi)0LL, (__v4hi)__A);
 
   /* Convert the four words to doublewords.  */
-  __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, __sign);
   __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, __sign);
+  __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, __sign);
 
   /* Convert the doublewords to floating point two at a time.  */
   __zero = (__v4sf) _mm_setzero_ps ();
-  __ra = __builtin_ia32_cvtpi2ps (__zero, __hisi);
-  __rb = __builtin_ia32_cvtpi2ps (__ra, __losi);
+  __ra = __builtin_ia32_cvtpi2ps (__zero, __losi);
+  __rb = __builtin_ia32_cvtpi2ps (__ra, __hisi);
 
   return (__m128) __builtin_ia32_movlhps (__ra, __rb);
 }
@@ -645,13 +645,13 @@ _mm_cvtpu16_ps (__m64 __A)
   __v4sf __zero, __ra, __rb;
 
   /* Convert the four words to doublewords.  */
-  __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, (__v4hi)0LL);
   __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, (__v4hi)0LL);
+  __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, (__v4hi)0LL);
 
   /* Convert the doublewords to floating point two at a time.  */
   __zero = (__v4sf) _mm_setzero_ps ();
-  __ra = __builtin_ia32_cvtpi2ps (__zero, __hisi);
-  __rb = __builtin_ia32_cvtpi2ps (__ra, __losi);
+  __ra = __builtin_ia32_cvtpi2ps (__zero, __losi);
+  __rb = __builtin_ia32_cvtpi2ps (__ra, __hisi);
 
   return (__m128) __builtin_ia32_movlhps (__ra, __rb);
 }
index 52507c0747e1781414e4faaf69c3a74b5aa0cc04..ff026a35285fa7e959cbdea9eb451cfd9141425f 100644 (file)
@@ -1,3 +1,8 @@
+2010-11-10  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/46419
+       * gcc-target/i386/pr46419.c: New test.
+
 2010-11-10  Quentin Neill  <quentin.neill.gnu@gmail.com>
 
        * g++.dg/other/i386-2.C: Add -mtbm.
 
        * gfortran.dg/open_dev_null.f90: New test.
 
-2010-11-09   Jan Hubicka  <jh@suse.cz>
+2010-11-09  Jan Hubicka  <jh@suse.cz>
 
        * testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c: Update for loop
        unrolling.
 
        PR tree-optimization/46316
        * gcc.c-torture/execute/pr46316.c: New test.
-       
+
 2010-11-08  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/46344
 
        * objc.dg/property/dotsyntax-13.m: New.
        * objc.dg/property/dotsyntax-14.m: New.
-       * objc.dg/property/dotsyntax-15.m: New. 
+       * objc.dg/property/dotsyntax-15.m: New.
        * objc.dg/property/synthesize-7.m: New.
        * obj-c++.dg/property/dotsyntax-13.mm: New.
        * obj-c++.dg/property/dotsyntax-14.mm: New.
-       * obj-c++.dg/property/dotsyntax-15.mm: New.     
+       * obj-c++.dg/property/dotsyntax-15.mm: New.
        * obj-c++.dg/property/synthesize-7.mm: New.
 
 2010-11-08  Nicola Pero  <nicola.pero@meta-innovation.com>
 
        * objc.dg/property/dynamic-4.m: New.
        * objc.dg/property/dynamic-5.m: New.
-       * objc.dg/property/dynamic-6.m: New.    
+       * objc.dg/property/dynamic-6.m: New.
        * obj-c++.dg/property/dynamic-4.mm: New.
        * obj-c++.dg/property/dynamic-5.mm: New.
        * obj-c++.dg/property/dynamic-6.mm: New.
        * obj-c++.dg/property/synthesize-3.mm: New.
        * obj-c++.dg/property/synthesize-4.mm: New.
        * obj-c++.dg/property/synthesize-5.mm: New.
-       * obj-c++.dg/property/synthesize-6.mm: New.     
-       
+       * obj-c++.dg/property/synthesize-6.mm: New.
+
 2010-11-08  Nicola Pero  <nicola.pero@meta-innovation.com>
 
-       * objc.dg/property/at-property-5.m: Updated test.       
+       * objc.dg/property/at-property-5.m: Updated test.
        * objc.dg/property/at-property-16.m: New.
        * objc.dg/property/at-property-17.m: New.
        * objc.dg/property/at-property-18.m: New.
-       * objc.dg/property/at-property-19.m: New.       
+       * objc.dg/property/at-property-19.m: New.
        * objc.dg/property/dotsyntax-12.m: New.
        * objc.dg/protocol-inheritance-1.m: New.
        * objc.dg/protocol-inheritance-2.m: New.
        * obj-c++.dg/property/at-property-16.mm: New.
        * obj-c++.dg/property/at-property-17.mm: New.
        * obj-c++.dg/property/at-property-18.mm: New.
-       * obj-c++.dg/property/at-property-19.mm: New.   
+       * obj-c++.dg/property/at-property-19.mm: New.
        * obj-c++.dg/protocol-inheritance-1.mm: New.
        * obj-c++.dg/protocol-inheritance-2.mm: New.
        * obj-c++.dg/property/dotsyntax-12.mm: New.
-       
+
 2010-11-08  Jason Merrill  <jason@redhat.com>
 
        * g++.dg/expr/overflow1.C: New.
        * gcc.c-torture/compile/vector-2.c: Likewise.
        * gcc.dg/pr32912-1.c: Likewise.
        * gcc.c-torture/execute/va-arg-25.c: Move ...
-       * gcc.dg/torture/va-arg-25.c: ... here.
-       Add dg-do run.
+       * gcc.dg/torture/va-arg-25.c: ... here.  Add dg-do run.
        Add dg-options -msse, dg-require-effective-target sse_runtime for
        for i?86-*-*, x86_64-*-*.
        * gcc.c-torture/execute/vector-1.c: Likewise.
 
        * gcc.dg/torture/pr45982.c: Add -std=c99
        * gcc.dg/torture/pr45623.c: Ditto.
-       
+
 2010-11-08  Steve Ellcey  <sje@cup.hp.com>
 
        * gcc/testsuite/g++.dg/abi/covariant1.C: Fix scan-assembler.
 
 2010-11-08  Kai Tietz  <kai.tietz@onevision.com>
 
-        PR target/28627
-        * g++.dg/ext/dllimport7.C: Adjust second error check and
-        allow test for x86_64 mingw, too.
+       PR target/28627
+       * g++.dg/ext/dllimport7.C: Adjust second error check and
+       allow test for x86_64 mingw, too.
 
 2010-11-08  Janus Weil  <janus@gcc.gnu.org>
 
        PR rtl-optimization/45352
        gcc.dg/pr45352.c, gcc.dg/pr45352-1.c, gcc.dg/pr45352-2.c: New tests.
        gcc.target/i386/pr45352.c, gcc.target/i386/pr45352-1.c,
-       gcc.target/i386/pr45352-2.c: New tests. 
+       gcc.target/i386/pr45352-2.c: New tests.
 
 2010-11-06  Iain Sandoe  <iains@gcc.gnu.org>
 
        PR libobjc/36610
-       * objc.dg/torture/forward-1.m: Re-enable for gnu-runtime, XFAIL the run for
-       all but m32 x86.
-       
+       * objc.dg/torture/forward-1.m: Re-enable for gnu-runtime,
+       XFAIL the run for all but m32 x86.
+
 2010-11-07  Andreas Schwab  <schwab@linux-m68k.org>
 
        * g++.dg/debug/dwarf2/nested-2.C: Adjust pattern to also match "|"
        * obj-c++.dg/template-8.mm: Likewise.
        * obj-c++.dg/encode-3.mm: Use abort (), cast char types.
        * obj-c++.dg/demangle-2.mm: Add +initialize:, XFAIL NeXT m64.
-       * obj-c++.dg/property/at-property-2.mm: Comment out a case that ICEs and
-       put a FIXME for this.
+       * obj-c++.dg/property/at-property-2.mm: Comment out a case that ICEs
+       and put a FIXME for this.
        * obj-c++.dg/property/property-2.mm: Remove.
        * obj-c++.dg/property/property-3.mm: Remove.
 
 
 2010-11-02  Iain Sandoe  <iains@gcc.gnu.org>
 
-       * g++.dg/debug/dwarf2/pubnames-1.C: Amend to check for only one instance
-       of debug_pubnames on darwin.
+       * g++.dg/debug/dwarf2/pubnames-1.C: Amend to check for only one
+       instance of debug_pubnames on darwin.
 
 2010-11-01  Jason Merrill  <jason@redhat.com>
            Benjamin Kosnik  <bkoz@redhat.com>
diff --git a/gcc/testsuite/gcc.target/i386/pr46419.c b/gcc/testsuite/gcc.target/i386/pr46419.c
new file mode 100644 (file)
index 0000000..3b72228
--- /dev/null
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
+
+#include "sse-check.h"
+
+#include <xmmintrin.h>
+
+void __attribute__((noinline))
+sse_test (void)
+{
+  char image[4];
+  __m128 image4;
+  float out[4] __attribute__ ((aligned (16)));
+  int i;
+
+  for (i = 0; i < 4; i++)
+    image[i] = i + 1;
+
+  image4 =
+    _mm_cvtpi8_ps (_mm_setr_pi8
+                  (image[0], image[1], image[2], image[3], 0, 0, 0, 0));
+  _mm_store_ps (out, image4);
+  _mm_empty ();
+
+  for (i = 0; i < 4; i++)
+    if (out[i] != (float) (i + 1))
+      abort ();
+
+  image4 =
+    _mm_cvtpu8_ps (_mm_setr_pi8
+                  (image[0], image[1], image[2], image[3], 0, 0, 0, 0));
+  _mm_store_ps (out, image4);
+  _mm_empty ();
+
+  for (i = 0; i < 4; i++)
+    if (out[i] != (float) (i + 1))
+      abort ();
+}