1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfh,+v -target-abi=ilp32d \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfh,+v -target-abi=lp64d \
5 ; RUN: -verify-machineinstrs < %s | FileCheck %s
7 declare <2 x half> @llvm.experimental.constrained.sqrt.v2f16(<2 x half>, metadata, metadata)
9 define <2 x half> @vfsqrt_v2f16(<2 x half> %v) strictfp {
10 ; CHECK-LABEL: vfsqrt_v2f16:
12 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
13 ; CHECK-NEXT: vfsqrt.v v8, v8
15 %r = call <2 x half> @llvm.experimental.constrained.sqrt.v2f16(<2 x half> %v, metadata !"round.dynamic", metadata !"fpexcept.strict")
19 declare <4 x half> @llvm.experimental.constrained.sqrt.v4f16(<4 x half>, metadata, metadata)
21 define <4 x half> @vfsqrt_v4f16(<4 x half> %v) strictfp {
22 ; CHECK-LABEL: vfsqrt_v4f16:
24 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
25 ; CHECK-NEXT: vfsqrt.v v8, v8
27 %r = call <4 x half> @llvm.experimental.constrained.sqrt.v4f16(<4 x half> %v, metadata !"round.dynamic", metadata !"fpexcept.strict")
31 declare <8 x half> @llvm.experimental.constrained.sqrt.v8f16(<8 x half>, metadata, metadata)
33 define <8 x half> @vfsqrt_v8f16(<8 x half> %v) strictfp {
34 ; CHECK-LABEL: vfsqrt_v8f16:
36 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
37 ; CHECK-NEXT: vfsqrt.v v8, v8
39 %r = call <8 x half> @llvm.experimental.constrained.sqrt.v8f16(<8 x half> %v, metadata !"round.dynamic", metadata !"fpexcept.strict")
43 declare <16 x half> @llvm.experimental.constrained.sqrt.v16f16(<16 x half>, metadata, metadata)
45 define <16 x half> @vfsqrt_v16f16(<16 x half> %v) strictfp {
46 ; CHECK-LABEL: vfsqrt_v16f16:
48 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
49 ; CHECK-NEXT: vfsqrt.v v8, v8
51 %r = call <16 x half> @llvm.experimental.constrained.sqrt.v16f16(<16 x half> %v, metadata !"round.dynamic", metadata !"fpexcept.strict")
55 declare <32 x half> @llvm.experimental.constrained.sqrt.v32f16(<32 x half>, metadata, metadata)
57 define <32 x half> @vfsqrt_v32f16(<32 x half> %v) strictfp {
58 ; CHECK-LABEL: vfsqrt_v32f16:
60 ; CHECK-NEXT: li a0, 32
61 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
62 ; CHECK-NEXT: vfsqrt.v v8, v8
64 %r = call <32 x half> @llvm.experimental.constrained.sqrt.v32f16(<32 x half> %v, metadata !"round.dynamic", metadata !"fpexcept.strict")
68 declare <2 x float> @llvm.experimental.constrained.sqrt.v2f32(<2 x float>, metadata, metadata)
70 define <2 x float> @vfsqrt_v2f32(<2 x float> %v) strictfp {
71 ; CHECK-LABEL: vfsqrt_v2f32:
73 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
74 ; CHECK-NEXT: vfsqrt.v v8, v8
76 %r = call <2 x float> @llvm.experimental.constrained.sqrt.v2f32(<2 x float> %v, metadata !"round.dynamic", metadata !"fpexcept.strict")
80 declare <4 x float> @llvm.experimental.constrained.sqrt.v4f32(<4 x float>, metadata, metadata)
82 define <4 x float> @vfsqrt_v4f32(<4 x float> %v) strictfp {
83 ; CHECK-LABEL: vfsqrt_v4f32:
85 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
86 ; CHECK-NEXT: vfsqrt.v v8, v8
88 %r = call <4 x float> @llvm.experimental.constrained.sqrt.v4f32(<4 x float> %v, metadata !"round.dynamic", metadata !"fpexcept.strict")
92 declare <8 x float> @llvm.experimental.constrained.sqrt.v8f32(<8 x float>, metadata, metadata)
94 define <8 x float> @vfsqrt_v8f32(<8 x float> %v) strictfp {
95 ; CHECK-LABEL: vfsqrt_v8f32:
97 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
98 ; CHECK-NEXT: vfsqrt.v v8, v8
100 %r = call <8 x float> @llvm.experimental.constrained.sqrt.v8f32(<8 x float> %v, metadata !"round.dynamic", metadata !"fpexcept.strict")
104 declare <16 x float> @llvm.experimental.constrained.sqrt.v16f32(<16 x float>, metadata, metadata)
106 define <16 x float> @vfsqrt_v16f32(<16 x float> %v) strictfp {
107 ; CHECK-LABEL: vfsqrt_v16f32:
109 ; CHECK-NEXT: vsetivli zero, 16, e32, m4, ta, ma
110 ; CHECK-NEXT: vfsqrt.v v8, v8
112 %r = call <16 x float> @llvm.experimental.constrained.sqrt.v16f32(<16 x float> %v, metadata !"round.dynamic", metadata !"fpexcept.strict")
116 declare <2 x double> @llvm.experimental.constrained.sqrt.v2f64(<2 x double>, metadata, metadata)
118 define <2 x double> @vfsqrt_v2f64(<2 x double> %v) strictfp {
119 ; CHECK-LABEL: vfsqrt_v2f64:
121 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
122 ; CHECK-NEXT: vfsqrt.v v8, v8
124 %r = call <2 x double> @llvm.experimental.constrained.sqrt.v2f64(<2 x double> %v, metadata !"round.dynamic", metadata !"fpexcept.strict")
128 declare <4 x double> @llvm.experimental.constrained.sqrt.v4f64(<4 x double>, metadata, metadata)
130 define <4 x double> @vfsqrt_v4f64(<4 x double> %v) strictfp {
131 ; CHECK-LABEL: vfsqrt_v4f64:
133 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
134 ; CHECK-NEXT: vfsqrt.v v8, v8
136 %r = call <4 x double> @llvm.experimental.constrained.sqrt.v4f64(<4 x double> %v, metadata !"round.dynamic", metadata !"fpexcept.strict")
140 declare <8 x double> @llvm.experimental.constrained.sqrt.v8f64(<8 x double>, metadata, metadata)
142 define <8 x double> @vfsqrt_v8f64(<8 x double> %v) strictfp {
143 ; CHECK-LABEL: vfsqrt_v8f64:
145 ; CHECK-NEXT: vsetivli zero, 8, e64, m4, ta, ma
146 ; CHECK-NEXT: vfsqrt.v v8, v8
148 %r = call <8 x double> @llvm.experimental.constrained.sqrt.v8f64(<8 x double> %v, metadata !"round.dynamic", metadata !"fpexcept.strict")