[PATCH] Add __builtin_convertvector

Hal Finkel hfinkel at anl.gov
Tue Sep 17 15:08:39 PDT 2013


----- Original Message -----
> 
>   You're missing a testcase for template instantiation.

I added this to the bottom of the test case, is that what you mean?

+#ifdef __cplusplus
+template<typename T>
+T int_toT(vector8long x) {
+  return __builtin_convertvector(x, T);
+}
+
+extern "C" {
+  vector8double int_toT_fp(vector8long x) {
+    // CHECK-LABEL: @int_toT_fp
+    // CHECK: sitofp <8 x i64> %{{[^ ]}} to <8 x double>
+    return int_toT<vector8double>(x);
+  }
+}
+#else
+vector8double int_toT_fp(vector8long x) {
+  return __builtin_convertvector(x, vector8double);
+}
+#endif


 -Hal

> 
> http://llvm-reviews.chandlerc.com/D1677
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the cfe-commits mailing list