<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [KNL] _MM_HINT_T0 should be a value from 1 to 2"
   href="https://bugs.llvm.org/show_bug.cgi?id=32411">32411</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[KNL] _MM_HINT_T0 should be a value from 1 to 2
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Headers
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ilia.taraban@intel.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>==============test.c=================
#include <immintrin.h>
__m512i a;
float arr[1000];

int main()
{
    _mm512_prefetch_i32gather_ps(a, (char*)&arr+128, 1, _MM_HINT_T0);
    return 0;
}

======================================

<span class="quote">>>>clang -v</span >
clang version 5.0.0 (trunk 298699)
...

<span class="quote">>>>clang   -O0  -march=knl  test.c</span >
intrin_gather_scatter.c:7:5: error: argument should be a value from 1 to 2
    _mm512_prefetch_i32gather_ps(a, (char*)&arr+128, 1, _MM_HINT_T0);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../lib/clang/5.0.0/include/avx512pfintrin.h:50:3: note: expanded from macro
'_mm512_prefetch_i32gather_ps'
  __builtin_ia32_gatherpfdps((__mmask16) -1, \
  ^
1 error generated.


======================================
In xmmintrin.h there are such rows like:
#define _MM_HINT_T0 3
#define _MM_HINT_T1 2
#define _MM_HINT_T2 1
#define _MM_HINT_NTA 0

Which I think is contrary to the documentation(_MM_HINT_T0 is 1, _MM_HINT_T1 is
2, _MM_HINT_T2 is 3
<a href="https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_prefetch_i32gather_ps&expand=4087">https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_prefetch_i32gather_ps&expand=4087</a>
and
<a href="https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_prefetch_i32extscatter_ps&expand=4087,4083,4083">https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_prefetch_i32extscatter_ps&expand=4087,4083,4083</a>)
These values was made by lattner in -r 112283.
r112283 | lattner | 2010-08-28 00:10:06 +0400 (Sat, 28 Aug 2010) | 2 lines
Changed paths:
   M /cfe/trunk/lib/Headers/xmmintrin.h

fix incorrect MM_HINT_ definitions, PR8011

<span class="quote">>>>svn diff -c 112283</span >
Index: xmmintrin.h
======================================
--- xmmintrin.h (revision 112282)
+++ xmmintrin.h (revision 112283)
@@ -632,9 +632,9 @@
   _mm_store_ps(p, a);
}

-#define _MM_HINT_T0 1
+#define _MM_HINT_T0 3
#define _MM_HINT_T1 2
-#define _MM_HINT_T2 3
+#define _MM_HINT_T2 1
#define _MM_HINT_NTA 0


------------------------
Intel Software Engineer
Ilia Taraban</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>