| 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 |
; CHECK: OpMemoryModel Logical GLSL450 |
| 6 |
|
| 7 |
define noundef half @test_fmax_half(half noundef %a, half noundef %b) { |
| 8 |
entry: |
| 9 |
; CHECK: %[[#]] = OpExtInst %[[#]] %[[#]] NMin %[[#]] %[[#]] |
| 10 |
%0 = call half @llvm.minnum.f16(half %a, half %b) |
| 11 |
ret half %0 |
| 12 |
} |
| 13 |
|
| 14 |
define noundef float @test_fmax_float(float noundef %a, float noundef %b) { |
| 15 |
entry: |
| 16 |
; CHECK: %[[#]] = OpExtInst %[[#]] %[[#]] NMin %[[#]] %[[#]] |
| 17 |
%0 = call float @llvm.minnum.f32(float %a, float %b) |
| 18 |
ret float %0 |
| 19 |
} |
| 20 |
|
| 21 |
define noundef double @test_fmax_double(double noundef %a, double noundef %b) { |
| 22 |
entry: |
| 23 |
; CHECK: %[[#]] = OpExtInst %[[#]] %[[#]] NMin %[[#]] %[[#]] |
| 24 |
%0 = call double @llvm.minnum.f64(double %a, double %b) |
| 25 |
ret double %0 |
| 26 |
} |
| 27 |
|
| 28 |
declare half @llvm.minnum.f16(half, half) |
| 29 |
declare float @llvm.minnum.f32(float, float) |
| 30 |
declare double @llvm.minnum.f64(double, double) |