]> granicus.if.org Git - clang/commitdiff
[X86] Make __builtin_ia32_vec_ext_v2si require ICE for its index argument. Add warnin...
authorCraig Topper <craig.topper@intel.com>
Tue, 5 Jun 2018 21:54:35 +0000 (21:54 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 5 Jun 2018 21:54:35 +0000 (21:54 +0000)
These should take a constant value for an index and that constant should be a valid element number.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334051 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/BuiltinsX86.def
lib/Sema/SemaChecking.cpp

index 6f7ecaf28cc34c93feb9e3fd5289a882613dd49d..0657354bd53ec3ff172b9178942c12e65040d7b3 100644 (file)
@@ -142,7 +142,7 @@ TARGET_BUILTIN(__builtin_ia32_movntq, "vV1LLi*V1LLi", "n", "mmx")
 TARGET_BUILTIN(__builtin_ia32_vec_init_v2si, "V2iii", "nc", "mmx")
 TARGET_BUILTIN(__builtin_ia32_vec_init_v4hi, "V4sssss", "nc", "mmx")
 TARGET_BUILTIN(__builtin_ia32_vec_init_v8qi, "V8ccccccccc", "nc", "mmx")
-TARGET_BUILTIN(__builtin_ia32_vec_ext_v2si, "iV2ii", "nc", "mmx")
+TARGET_BUILTIN(__builtin_ia32_vec_ext_v2si, "iV2iIi", "nc", "mmx")
 
 // MMX2 (MMX+SSE) intrinsics
 TARGET_BUILTIN(__builtin_ia32_cvtpi2ps, "V4fV4fV2i", "nc", "mmx,sse")
index 7b9975e6abf92ba2b0270cbdec9cd07cf74fd9ef..643c103c8a3da18c5723cc75b31bb8bea9412765 100644 (file)
@@ -2555,7 +2555,14 @@ bool Sema::CheckX86BuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
   case X86::BI_mm_prefetch:
     i = 1; l = 0; u = 7;
     break;
+  case X86::BI__builtin_ia32_vec_ext_v2si:
+    i = 1; l = 0; u = 1;
+    break;
+  case X86::BI__builtin_ia32_vec_ext_v4hi:
+    i = 1; l = 0; u = 3;
+    break;
   case X86::BI__builtin_ia32_sha1rnds4:
+  case X86::BI__builtin_ia32_vec_set_v4hi:
     i = 2; l = 0; u = 3;
     break;
   case X86::BI__builtin_ia32_vpermil2pd: