File: arm64_vcvtfp.c

package info (click to toggle)
llvm-toolchain-3.5 1%3A3.5-10
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 282,028 kB
  • ctags: 310,872
  • sloc: cpp: 1,883,926; ansic: 310,731; objc: 86,612; python: 79,565; asm: 65,844; sh: 9,829; makefile: 6,057; perl: 5,589; ml: 5,254; pascal: 3,285; lisp: 1,640; xml: 686; cs: 239; csh: 117
file content (48 lines) | stat: -rw-r--r-- 1,585 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// RUN: %clang_cc1 -O1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -S -o - -emit-llvm %s | FileCheck %s

#include <arm_neon.h>

float64x2_t test_vcvt_f64_f32(float32x2_t x) {
  // CHECK-LABEL: test_vcvt_f64_f32
  return vcvt_f64_f32(x);
  // CHECK: fpext <2 x float> {{%.*}} to <2 x double>
  // CHECK-NEXT: ret
}

float64x2_t test_vcvt_high_f64_f32(float32x4_t x) {
  // CHECK-LABEL: test_vcvt_high_f64_f32
  return vcvt_high_f64_f32(x);
  // CHECK: [[HIGH:%.*]] = shufflevector <4 x float> {{%.*}}, <4 x float> undef, <2 x i32> <i32 2, i32 3>
  // CHECK-NEXT: fpext <2 x float> [[HIGH]] to <2 x double>
  // CHECK-NEXT: ret
}

float32x2_t test_vcvt_f32_f64(float64x2_t v) {
  // CHECK: test_vcvt_f32_f64
  return vcvt_f32_f64(v);
  // CHECK: fptrunc <2 x double> {{%.*}} to <2 x float>
  // CHECK-NEXT: ret
}

float32x4_t test_vcvt_high_f32_f64(float32x2_t x, float64x2_t v) {
  // CHECK: test_vcvt_high_f32_f64
  return vcvt_high_f32_f64(x, v);
  // CHECK: [[TRUNC:%.*]] = fptrunc <2 x double> {{.*}} to <2 x float>
  // CHECK-NEXT: shufflevector <2 x float> {{.*}}, <2 x float> [[TRUNC]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
  // CHECK-NEXT: ret
}

float32x2_t test_vcvtx_f32_f64(float64x2_t v) {
  // CHECK: test_vcvtx_f32_f64
  return vcvtx_f32_f64(v);
  // CHECK: llvm.aarch64.neon.fcvtxn.v2f32.v2f64
  // CHECK-NEXT: ret
}

float32x4_t test_vcvtx_high_f32_f64(float32x2_t x, float64x2_t v) {
  // CHECK: test_vcvtx_high_f32_f64
  return vcvtx_high_f32_f64(x, v);
  // CHECK: llvm.aarch64.neon.fcvtxn.v2f32.v2f64
  // CHECK: shufflevector
  // CHECK: ret
}