1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc -mtriple=riscv32 -mattr=+d,+zvfh,+v,+zvfbfmin -target-abi=ilp32d \ 3; RUN: -verify-machineinstrs < %s | FileCheck %s 4; RUN: llc -mtriple=riscv64 -mattr=+d,+zvfh,+v,+zvfbfmin -target-abi=lp64d \ 5; RUN: -verify-machineinstrs < %s | FileCheck %s 6 7declare <2 x float> @llvm.experimental.constrained.fpext.v2f32.v2f16(<2 x half>, metadata) 8define <2 x float> @vfpext_v2f16_v2f32(<2 x half> %va) strictfp { 9; CHECK-LABEL: vfpext_v2f16_v2f32: 10; CHECK: # %bb.0: 11; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma 12; CHECK-NEXT: vfwcvt.f.f.v v9, v8 13; CHECK-NEXT: vmv1r.v v8, v9 14; CHECK-NEXT: ret 15 %evec = call <2 x float> @llvm.experimental.constrained.fpext.v2f32.v2f16(<2 x half> %va, metadata !"fpexcept.strict") 16 ret <2 x float> %evec 17} 18 19declare <2 x double> @llvm.experimental.constrained.fpext.v2f64.v2f16(<2 x half>, metadata) 20define <2 x double> @vfpext_v2f16_v2f64(<2 x half> %va) strictfp { 21; CHECK-LABEL: vfpext_v2f16_v2f64: 22; CHECK: # %bb.0: 23; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma 24; CHECK-NEXT: vfwcvt.f.f.v v9, v8 25; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma 26; CHECK-NEXT: vfwcvt.f.f.v v8, v9 27; CHECK-NEXT: ret 28 %evec = call <2 x double> @llvm.experimental.constrained.fpext.v2f64.v2f16(<2 x half> %va, metadata !"fpexcept.strict") 29 ret <2 x double> %evec 30} 31 32declare <4 x float> @llvm.experimental.constrained.fpext.v4f32.v4f16(<4 x half>, metadata) 33define <4 x float> @vfpext_v4f16_v4f32(<4 x half> %va) strictfp { 34; CHECK-LABEL: vfpext_v4f16_v4f32: 35; CHECK: # %bb.0: 36; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma 37; CHECK-NEXT: vfwcvt.f.f.v v9, v8 38; CHECK-NEXT: vmv1r.v v8, v9 39; CHECK-NEXT: ret 40 %evec = call <4 x float> @llvm.experimental.constrained.fpext.v4f32.v4f16(<4 x half> %va, metadata !"fpexcept.strict") 41 ret <4 x float> %evec 42} 43 44declare <4 x double> @llvm.experimental.constrained.fpext.v4f64.v4f16(<4 x half>, metadata) 45define <4 x double> @vfpext_v4f16_v4f64(<4 x half> %va) strictfp { 46; CHECK-LABEL: vfpext_v4f16_v4f64: 47; CHECK: # %bb.0: 48; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma 49; CHECK-NEXT: vfwcvt.f.f.v v10, v8 50; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma 51; CHECK-NEXT: vfwcvt.f.f.v v8, v10 52; CHECK-NEXT: ret 53 %evec = call <4 x double> @llvm.experimental.constrained.fpext.v4f64.v4f16(<4 x half> %va, metadata !"fpexcept.strict") 54 ret <4 x double> %evec 55} 56 57declare <8 x float> @llvm.experimental.constrained.fpext.v8f32.v8f16(<8 x half>, metadata) 58define <8 x float> @vfpext_v8f16_v8f32(<8 x half> %va) strictfp { 59; CHECK-LABEL: vfpext_v8f16_v8f32: 60; CHECK: # %bb.0: 61; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma 62; CHECK-NEXT: vfwcvt.f.f.v v10, v8 63; CHECK-NEXT: vmv2r.v v8, v10 64; CHECK-NEXT: ret 65 %evec = call <8 x float> @llvm.experimental.constrained.fpext.v8f32.v8f16(<8 x half> %va, metadata !"fpexcept.strict") 66 ret <8 x float> %evec 67} 68 69declare <8 x double> @llvm.experimental.constrained.fpext.v8f64.v8f16(<8 x half>, metadata) 70define <8 x double> @vfpext_v8f16_v8f64(<8 x half> %va) strictfp { 71; CHECK-LABEL: vfpext_v8f16_v8f64: 72; CHECK: # %bb.0: 73; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma 74; CHECK-NEXT: vfwcvt.f.f.v v12, v8 75; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma 76; CHECK-NEXT: vfwcvt.f.f.v v8, v12 77; CHECK-NEXT: ret 78 %evec = call <8 x double> @llvm.experimental.constrained.fpext.v8f64.v8f16(<8 x half> %va, metadata !"fpexcept.strict") 79 ret <8 x double> %evec 80} 81 82declare <2 x double> @llvm.experimental.constrained.fpext.v2f64.v2f32(<2 x float>, metadata) 83define <2 x double> @vfpext_v2f32_v2f64(<2 x float> %va) strictfp { 84; CHECK-LABEL: vfpext_v2f32_v2f64: 85; CHECK: # %bb.0: 86; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma 87; CHECK-NEXT: vfwcvt.f.f.v v9, v8 88; CHECK-NEXT: vmv1r.v v8, v9 89; CHECK-NEXT: ret 90 %evec = call <2 x double> @llvm.experimental.constrained.fpext.v2f64.v2f32(<2 x float> %va, metadata !"fpexcept.strict") 91 ret <2 x double> %evec 92} 93 94declare <4 x double> @llvm.experimental.constrained.fpext.v4f64.v4f32(<4 x float>, metadata) 95define <4 x double> @vfpext_v4f32_v4f64(<4 x float> %va) strictfp { 96; CHECK-LABEL: vfpext_v4f32_v4f64: 97; CHECK: # %bb.0: 98; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma 99; CHECK-NEXT: vfwcvt.f.f.v v10, v8 100; CHECK-NEXT: vmv2r.v v8, v10 101; CHECK-NEXT: ret 102 %evec = call <4 x double> @llvm.experimental.constrained.fpext.v4f64.v4f32(<4 x float> %va, metadata !"fpexcept.strict") 103 ret <4 x double> %evec 104} 105 106declare <8 x double> @llvm.experimental.constrained.fpext.v8f64.v8f32(<8 x float>, metadata) 107define <8 x double> @vfpext_v8f32_v8f64(<8 x float> %va) strictfp { 108; CHECK-LABEL: vfpext_v8f32_v8f64: 109; CHECK: # %bb.0: 110; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma 111; CHECK-NEXT: vfwcvt.f.f.v v12, v8 112; CHECK-NEXT: vmv4r.v v8, v12 113; CHECK-NEXT: ret 114 %evec = call <8 x double> @llvm.experimental.constrained.fpext.v8f64.v8f32(<8 x float> %va, metadata !"fpexcept.strict") 115 ret <8 x double> %evec 116} 117 118declare <2 x float> @llvm.experimental.constrained.fpext.v2f32.v2bf16(<2 x bfloat>, metadata) 119define <2 x float> @vfpext_v2bf16_v2f32(<2 x bfloat> %va) strictfp { 120; CHECK-LABEL: vfpext_v2bf16_v2f32: 121; CHECK: # %bb.0: 122; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma 123; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8 124; CHECK-NEXT: vmv1r.v v8, v9 125; CHECK-NEXT: ret 126 %evec = call <2 x float> @llvm.experimental.constrained.fpext.v2f32.v2bf16(<2 x bfloat> %va, metadata !"fpexcept.strict") 127 ret <2 x float> %evec 128} 129 130declare <2 x double> @llvm.experimental.constrained.fpext.v2f64.v2bf16(<2 x bfloat>, metadata) 131define <2 x double> @vfpext_v2bf16_v2f64(<2 x bfloat> %va) strictfp { 132; CHECK-LABEL: vfpext_v2bf16_v2f64: 133; CHECK: # %bb.0: 134; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma 135; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8 136; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma 137; CHECK-NEXT: vfwcvt.f.f.v v8, v9 138; CHECK-NEXT: ret 139 %evec = call <2 x double> @llvm.experimental.constrained.fpext.v2f64.v2bf16(<2 x bfloat> %va, metadata !"fpexcept.strict") 140 ret <2 x double> %evec 141} 142 143declare <4 x float> @llvm.experimental.constrained.fpext.v4f32.v4bf16(<4 x bfloat>, metadata) 144define <4 x float> @vfpext_v4bf16_v4f32(<4 x bfloat> %va) strictfp { 145; CHECK-LABEL: vfpext_v4bf16_v4f32: 146; CHECK: # %bb.0: 147; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma 148; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8 149; CHECK-NEXT: vmv1r.v v8, v9 150; CHECK-NEXT: ret 151 %evec = call <4 x float> @llvm.experimental.constrained.fpext.v4f32.v4bf16(<4 x bfloat> %va, metadata !"fpexcept.strict") 152 ret <4 x float> %evec 153} 154 155declare <4 x double> @llvm.experimental.constrained.fpext.v4f64.v4bf16(<4 x bfloat>, metadata) 156define <4 x double> @vfpext_v4bf16_v4f64(<4 x bfloat> %va) strictfp { 157; CHECK-LABEL: vfpext_v4bf16_v4f64: 158; CHECK: # %bb.0: 159; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma 160; CHECK-NEXT: vfwcvtbf16.f.f.v v10, v8 161; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma 162; CHECK-NEXT: vfwcvt.f.f.v v8, v10 163; CHECK-NEXT: ret 164 %evec = call <4 x double> @llvm.experimental.constrained.fpext.v4f64.v4bf16(<4 x bfloat> %va, metadata !"fpexcept.strict") 165 ret <4 x double> %evec 166} 167 168declare <8 x float> @llvm.experimental.constrained.fpext.v8f32.v8bf16(<8 x bfloat>, metadata) 169define <8 x float> @vfpext_v8bf16_v8f32(<8 x bfloat> %va) strictfp { 170; CHECK-LABEL: vfpext_v8bf16_v8f32: 171; CHECK: # %bb.0: 172; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma 173; CHECK-NEXT: vfwcvtbf16.f.f.v v10, v8 174; CHECK-NEXT: vmv2r.v v8, v10 175; CHECK-NEXT: ret 176 %evec = call <8 x float> @llvm.experimental.constrained.fpext.v8f32.v8bf16(<8 x bfloat> %va, metadata !"fpexcept.strict") 177 ret <8 x float> %evec 178} 179 180declare <8 x double> @llvm.experimental.constrained.fpext.v8f64.v8bf16(<8 x bfloat>, metadata) 181define <8 x double> @vfpext_v8bf16_v8f64(<8 x bfloat> %va) strictfp { 182; CHECK-LABEL: vfpext_v8bf16_v8f64: 183; CHECK: # %bb.0: 184; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma 185; CHECK-NEXT: vfwcvtbf16.f.f.v v12, v8 186; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma 187; CHECK-NEXT: vfwcvt.f.f.v v8, v12 188; CHECK-NEXT: ret 189 %evec = call <8 x double> @llvm.experimental.constrained.fpext.v8f64.v8bf16(<8 x bfloat> %va, metadata !"fpexcept.strict") 190 ret <8 x double> %evec 191} 192