1 ; RUN: llc < %s -march=nvptx64 | FileCheck %s --check-prefixes=CHECK
2 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_80 | FileCheck %s --check-prefixes=CHECK
3 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 | %ptxas-verify %}
4 ; RUN: %if ptxas-11.0 %{ llc < %s -march=nvptx64 -mcpu=sm_80 | %ptxas-verify -arch=sm_80 %}
8 ; CHECK-LABEL: minimum_half
9 define half @minimum_half(half %a) #0 {
12 %p = fcmp ult half %a, 0.0
13 %x = select i1 %p, half %a, half 0.0
17 ; CHECK-LABEL: minimum_float
18 define float @minimum_float(float %a) #0 {
21 %p = fcmp ult float %a, 0.0
22 %x = select i1 %p, float %a, float 0.0
26 ; CHECK-LABEL: minimum_double
27 define double @minimum_double(double %a) #0 {
30 %p = fcmp ult double %a, 0.0
31 %x = select i1 %p, double %a, double 0.0
35 ; CHECK-LABEL: minimum_v2half
36 define <2 x half> @minimum_v2half(<2 x half> %a) #0 {
40 %p = fcmp ult <2 x half> %a, zeroinitializer
41 %x = select <2 x i1> %p, <2 x half> %a, <2 x half> zeroinitializer
47 ; CHECK-LABEL: maximum_half
48 define half @maximum_half(half %a) #0 {
51 %p = fcmp ugt half %a, 0.0
52 %x = select i1 %p, half %a, half 0.0
56 ; CHECK-LABEL: maximum_float
57 define float @maximum_float(float %a) #0 {
60 %p = fcmp ugt float %a, 0.0
61 %x = select i1 %p, float %a, float 0.0
65 ; CHECK-LABEL: maximum_double
66 define double @maximum_double(double %a) #0 {
69 %p = fcmp ugt double %a, 0.0
70 %x = select i1 %p, double %a, double 0.0
74 ; CHECK-LABEL: maximum_v2half
75 define <2 x half> @maximum_v2half(<2 x half> %a) #0 {
79 %p = fcmp ugt <2 x half> %a, zeroinitializer
80 %x = select <2 x i1> %p, <2 x half> %a, <2 x half> zeroinitializer