brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.4 KiB · f31585c Raw
79 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 52; RUN: opt -S -dxil-intrinsic-expansion -scalarizer -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s3 4declare half @llvm.dx.radians.f16(half)5declare float @llvm.dx.radians.f32(float)6 7declare <4 x half> @llvm.dx.radians.v4f16(<4 x half>)8declare <4 x float> @llvm.dx.radians.v4f32(<4 x float>)9 10define noundef half @radians_half(half noundef %a) {11; CHECK-LABEL: define noundef half @radians_half(12; CHECK-SAME: half noundef [[A:%.*]]) {13; CHECK-NEXT:  [[ENTRY:.*:]]14; CHECK-NEXT:    [[TMP0:%.*]] = fmul half [[A]], 0xH247815; CHECK-NEXT:    ret half [[TMP0]]16;17entry:18  %elt.radians = call half @llvm.dx.radians.f16(half %a)19  ret half %elt.radians20}21 22define noundef float @radians_float(float noundef %a) {23; CHECK-LABEL: define noundef float @radians_float(24; CHECK-SAME: float noundef [[A:%.*]]) {25; CHECK-NEXT:  [[ENTRY:.*:]]26; CHECK-NEXT:    [[TMP0:%.*]] = fmul float [[A]], 0x3F91DF46A000000027; CHECK-NEXT:    ret float [[TMP0]]28;29entry:30  %elt.radians = call float @llvm.dx.radians.f32(float %a)31  ret float %elt.radians32}33 34define noundef <4 x half> @radians_half_vector(<4 x half> noundef %a) {35; CHECK-LABEL: define noundef <4 x half> @radians_half_vector(36; CHECK-SAME: <4 x half> noundef [[A:%.*]]) {37; CHECK-NEXT:  [[ENTRY:.*:]]38; CHECK: [[ee0:%.*]] = extractelement <4 x half> [[A]], i64 039; CHECK: [[ie0:%.*]] = fmul half [[ee0]], 0xH247840; CHECK: [[ee1:%.*]] = extractelement <4 x half> [[A]], i64 141; CHECK: [[ie1:%.*]] = fmul half [[ee1]], 0xH247842; CHECK: [[ee2:%.*]] = extractelement <4 x half> [[A]], i64 243; CHECK: [[ie2:%.*]] = fmul half [[ee2]], 0xH247844; CHECK: [[ee3:%.*]] = extractelement <4 x half> [[A]], i64 345; CHECK: [[ie3:%.*]] = fmul half [[ee3]], 0xH247846; CHECK: [[TMP0:%.*]] = insertelement <4 x half> poison, half [[ie0]], i64 047; CHECK: [[TMP1:%.*]] = insertelement <4 x half> [[TMP0]], half [[ie1]], i64 148; CHECK: [[TMP2:%.*]] = insertelement <4 x half> [[TMP1]], half [[ie2]], i64 249; CHECK: [[TMP3:%.*]] = insertelement <4 x half> [[TMP2]], half [[ie3]], i64 350; CHECK: ret <4 x half> [[TMP3]]51;52entry:53  %elt.radians = call <4 x half> @llvm.dx.radians.v4f16(<4 x half> %a)54  ret <4 x half> %elt.radians55}56 57define noundef <4 x float> @radians_float_vector(<4 x float> noundef %a) {58; CHECK-LABEL: define noundef <4 x float> @radians_float_vector(59; CHECK-SAME: <4 x float> noundef [[A:%.*]]) {60; CHECK-NEXT:  [[ENTRY:.*:]]61; CHECK: [[ee0:%.*]] = extractelement <4 x float> [[A]], i64 062; CHECK: [[ie0:%.*]] = fmul float [[ee0]], 0x3F91DF46A000000063; CHECK: [[ee1:%.*]] = extractelement <4 x float> [[A]], i64 164; CHECK: [[ie1:%.*]] = fmul float [[ee1]], 0x3F91DF46A000000065; CHECK: [[ee2:%.*]] = extractelement <4 x float> [[A]], i64 266; CHECK: [[ie2:%.*]] = fmul float [[ee2]], 0x3F91DF46A000000067; CHECK: [[ee3:%.*]] = extractelement <4 x float> [[A]], i64 368; CHECK: [[ie3:%.*]] = fmul float [[ee3]], 0x3F91DF46A000000069; CHECK: [[TMP0:%.*]] = insertelement <4 x float> poison, float [[ie0]], i64 070; CHECK: [[TMP1:%.*]] = insertelement <4 x float> [[TMP0]], float [[ie1]], i64 171; CHECK: [[TMP2:%.*]] = insertelement <4 x float> [[TMP1]], float [[ie2]], i64 272; CHECK: [[TMP3:%.*]] = insertelement <4 x float> [[TMP2]], float [[ie3]], i64 373; CHECK: ret <4 x float> [[TMP3]]74;75entry:76  %elt.radians = call <4 x float> @llvm.dx.radians.v4f32(<4 x float> %a)77  ret <4 x float> %elt.radians78}79