Debian Codegraph @

llvm/test/CodeGen/SPIRV/hlsl-intrinsics/fmad.ll

raw
1 ; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-vulkan %s -o - | FileCheck %s
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan %s -o - -filetype=obj | spirv-val %}
3
4 ; CHECK: OpExtInstImport "GLSL.std.450"
5
6 define noundef half @fmad_half(half noundef %a, half noundef %b, half noundef %c) #0 {
7 entry:
8 ; CHECK: %[[#]] = OpExtInst %[[#]] %[[#]] Fma %[[#]] %[[#]] %[[#]]
9 %hlsl.fmad = call half @llvm.fmuladd.f16(half %a, half %b, half %c)
10 ret half %hlsl.fmad
11 }
12
13 define noundef float @fmad_float(float noundef %a, float noundef %b, float noundef %c) #0 {
14 entry:
15 ; CHECK: %[[#]] = OpExtInst %[[#]] %[[#]] Fma %[[#]] %[[#]] %[[#]]
16 %hlsl.fmad = call float @llvm.fmuladd.f32(float %a, float %b, float %c)
17 ret float %hlsl.fmad
18 }
19
20 define noundef double @fmad_double(double noundef %a, double noundef %b, double noundef %c) {
21 entry:
22 ; CHECK: %[[#]] = OpExtInst %[[#]] %[[#]] Fma %[[#]] %[[#]] %[[#]]
23 %hlsl.fmad = call double @llvm.fmuladd.f64(double %a, double %b, double %c)
24 ret double %hlsl.fmad
25 }
26
27 declare half @llvm.fmuladd.f16(half, half, half)
28 declare float @llvm.fmuladd.f32(float, float, float)
29 declare double @llvm.fmuladd.f64(double, double, double)