int main() { vecf16_t g = __builtin_convertvector(d, vecf16_t); vecf16_t h = __builtin_convertvector(d, vecf16_t); veci16_t i = __builtin_convertvector(f, veci16_t); vecu16_t j = __builtin_convertvector(f, vecu16_t); // Float to int printf("0x%08x\n", (int) a); // CHECK: 0x0000007b printf("0x%08x\n", (unsigned int) a); // CHECK: 0x0000007b printf("0x%08x\n", i[0]); // CHECK: 0x00000001 printf("0x%08x\n", i[1]); // CHECK: 0xffffffff printf("0x%08x\n", j[0]); // CHECK: 0x00000001 printf("0x%08x\n", j[1]); // CHECK: 0xffffffff // Int to float printf("%g\n", (float) b); // CHECK: 79.0 printf("%g\n", (float) c); // CHECK: 24.0 printf("%g\n", g[0]); // CHECK: 1.0 printf("%g\n", g[1]); // CHECK: 1.0 printf("%g\n", h[0]); // CHECK: 1.0 printf("%g\n", h[1]); // CHECK: 1.0 }
vector8double int_toT_fp(vector8long x) { return __builtin_convertvector(x, vector8double); }
T int_toT(vector8long x) { return __builtin_convertvector(x, T); }
vector8float uint_tofp(vector8ushort x) { return __builtin_convertvector(x, vector8float); // CHECK-LABEL: @uint_tofp // CHECK: uitofp <8 x i16> %{{[^ ]}} to <8 x float> }
vector8long int_sext(vector8short x) { return __builtin_convertvector(x, vector8long); // CHECK-LABEL: @int_sext // CHECK: sext <8 x i16> %{{[^ ]}} to <8 x i64> }
vector8ulong fltd_toui(vector8double x) { return __builtin_convertvector(x, vector8ulong); // CHECK-LABEL: @fltd_toui // CHECK: fptoui <8 x double> %{{[^ ]}} to <8 x i64> }
vector8ulong flt_toui(vector8float x) { return __builtin_convertvector(x, vector8ulong); // CHECK-LABEL: @flt_toui // CHECK: fptoui <8 x float> %{{[^ ]}} to <8 x i64> }
vector8double flt_ext(vector8float x) { return __builtin_convertvector(x, vector8double); // CHECK-LABEL: @flt_ext // CHECK: fpext <8 x float> %{{[^ ]}} to <8 x double> }
vector8float flt_trunc(vector8double x) { return __builtin_convertvector(x, vector8float); // CHECK-LABEL: @flt_trunc // CHECK: fptrunc <8 x double> %{{[^ ]}} to <8 x float> }