File: fp16-vector-cvt.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (59 lines) | stat: -rw-r--r-- 1,782 bytes parent folder | download | duplicates (15)
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
49
50
51
52
53
54
55
56
57
58
59
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple armv8a-none-none-eabihf -mattr=fullfp16 < %s | FileCheck %s

define <4 x half> @fptrunc_vector_f32_f16(<4 x float> %a) {
; CHECK-LABEL: fptrunc_vector_f32_f16:
; CHECK:       @ %bb.0: @ %bb
; CHECK-NEXT:    vcvt.f16.f32 d0, q0
; CHECK-NEXT:    bx lr
bb:
  %z = fptrunc <4 x float> %a to <4 x half>
  ret <4 x half> %z
}

define <4 x half> @fptrunc_vector_f64_f16(<4 x double> %a) {
; CHECK-LABEL: fptrunc_vector_f64_f16:
; CHECK:       @ %bb.0: @ %bb
; CHECK-NEXT:    vcvtb.f16.f64 s0, d0
; CHECK-NEXT:    vcvtb.f16.f64 s8, d1
; CHECK-NEXT:    vmov r1, s0
; CHECK-NEXT:    vcvtb.f16.f64 s2, d2
; CHECK-NEXT:    vmov r0, s8
; CHECK-NEXT:    vmov.16 d0[0], r1
; CHECK-NEXT:    vmov.16 d0[1], r0
; CHECK-NEXT:    vmov r0, s2
; CHECK-NEXT:    vcvtb.f16.f64 s2, d3
; CHECK-NEXT:    vmov.16 d0[2], r0
; CHECK-NEXT:    vmov r0, s2
; CHECK-NEXT:    vmov.16 d0[3], r0
; CHECK-NEXT:    bx lr
bb:
  %z = fptrunc <4 x double> %a to <4 x half>
  ret <4 x half> %z
}

define <4 x float> @fpext_vector_f16_f32(<4 x half> %a) {
; CHECK-LABEL: fpext_vector_f16_f32:
; CHECK:       @ %bb.0: @ %bb
; CHECK-NEXT:    vcvt.f32.f16 q0, d0
; CHECK-NEXT:    bx lr
bb:
  %z = fpext <4 x half> %a to <4 x float>
  ret <4 x float> %z
}

define <4 x double> @fpext_vector_f16_f64(<4 x half> %a) {
; CHECK-LABEL: fpext_vector_f16_f64:
; CHECK:       @ %bb.0: @ %bb
; CHECK-NEXT:    vmovx.f16 s4, s0
; CHECK-NEXT:    vmovx.f16 s2, s1
; CHECK-NEXT:    vcvtb.f64.f16 d17, s4
; CHECK-NEXT:    vcvtb.f64.f16 d3, s2
; CHECK-NEXT:    vcvtb.f64.f16 d16, s0
; CHECK-NEXT:    vcvtb.f64.f16 d2, s1
; CHECK-NEXT:    vorr q0, q8, q8
; CHECK-NEXT:    bx lr
bb:
  %z = fpext <4 x half> %a to <4 x double>
  ret <4 x double> %z
}