On Wed, Dec 18, 2013 at 2:23 PM, Kirill Yukhin <kirill.yuk...@gmail.com> wrote:
> Hello,
> On 02 Dec 16:18, Kirill Yukhin wrote:
>> Hello,
>> > Is it ok now?
>> Ping?
> Ping.
>
> Rebased patch attached.

Whoa.

--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md

No, not in this patch.

+/* { dg-do run } */
+/* { dg-options "-O2 -mavx512cd -DHAVE_512 -DAVX512CD" } */
+/* { dg-require-effective-target avx512cd } */
+
+#include "avx512f-helper.h"

Please put the definitions in the source itself, not in command line.

+  if ((ecx & bit_OSXSAVE) == (bit_OSXSAVE))
+    {
+      if (__get_cpuid_max (0, NULL) < 7)
+    return 0;
+
+      __cpuid_count (7, 0, eax, ebx, ecx, edx);
+
+      if ((avx512f_os_support ()) && ((ebx & (bit_AVX512ER)) ==
(bit_AVX512ER)))

No need for parenthesis around bit_* constants. They alredy have
needed parenthesis in cpuid.h.

+++ b/gcc/testsuite/gcc.target/i386/avx512f-vgetmantps-2.c
@@ -0,0 +1,110 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -mavx512f -DAVX512F" } */
+/* { dg-require-effective-target avx512f } */
+
+#include "avx512f-helper.h"
+
+#define SIZE (AVX512F_LEN / 32)
+#include "avx512f-mask-type.h"
+#include <math.h>
+
+#ifndef GET_NORM_MANT
+#define GET_NORM_MANT
+float
+get_norm_mant (float source, int signctrl, int interv)
+{
+  int dest, src, sign, exp, fraction;
+  src = *(int *) &source;

Strict aliasing violation.

+  dest = (sign << 31) | (exp << 23) | fraction;
+  return *(float *) &dest;

also here. I wonder, why you didn't get:

warning: dereferencing type-punned pointer will break strict-aliasing
rules [-Wstrict-aliasing]
   src = *(int *) &source;
warning: dereferencing type-punned pointer will break strict-aliasing
rules [-Wstrict-aliasing]
   return *(float *) &dest;

Can you please review testcases for aliasing violations (you can check
the new tests with -Wstrict-aliasing warning enabled)

The patch is otherwise OK for mainline, on the (obvious) condition
that other patches get approved and committed first.

Thanks,
Uros.

Reply via email to