1; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s 2 3; These tests check that floating point comparisons which are used by select 4; to store integer true (-1) and false (0) values are lowered to one of the 5; SET*DX10 instructions. 6 7; CHECK: @fcmp_une_select_fptosi 8; CHECK: SETNE_DX10 T{{[0-9]+\.[XYZW]}}, T{{[0-9]+\.[XYZW]}}, literal.x, 1084227584(5.000000e+00) 9define void @fcmp_une_select_fptosi(i32 addrspace(1)* %out, float %in) { 10entry: 11 %0 = fcmp une float %in, 5.0 12 %1 = select i1 %0, float 1.000000e+00, float 0.000000e+00 13 %2 = fsub float -0.000000e+00, %1 14 %3 = fptosi float %2 to i32 15 store i32 %3, i32 addrspace(1)* %out 16 ret void 17} 18 19; CHECK: @fcmp_une_select_i32 20; CHECK: SETNE_DX10 T{{[0-9]+\.[XYZW]}}, T{{[0-9]+\.[XYZW]}}, literal.x, 1084227584(5.000000e+00) 21define void @fcmp_une_select_i32(i32 addrspace(1)* %out, float %in) { 22entry: 23 %0 = fcmp une float %in, 5.0 24 %1 = select i1 %0, i32 -1, i32 0 25 store i32 %1, i32 addrspace(1)* %out 26 ret void 27} 28 29; CHECK: @fcmp_ueq_select_fptosi 30; CHECK: SETE_DX10 T{{[0-9]+\.[XYZW]}}, T{{[0-9]+\.[XYZW]}}, literal.x, 1084227584(5.000000e+00) 31define void @fcmp_ueq_select_fptosi(i32 addrspace(1)* %out, float %in) { 32entry: 33 %0 = fcmp ueq float %in, 5.0 34 %1 = select i1 %0, float 1.000000e+00, float 0.000000e+00 35 %2 = fsub float -0.000000e+00, %1 36 %3 = fptosi float %2 to i32 37 store i32 %3, i32 addrspace(1)* %out 38 ret void 39} 40 41; CHECK: @fcmp_ueq_select_i32 42; CHECK: SETE_DX10 T{{[0-9]+\.[XYZW]}}, T{{[0-9]+\.[XYZW]}}, literal.x, 1084227584(5.000000e+00) 43define void @fcmp_ueq_select_i32(i32 addrspace(1)* %out, float %in) { 44entry: 45 %0 = fcmp ueq float %in, 5.0 46 %1 = select i1 %0, i32 -1, i32 0 47 store i32 %1, i32 addrspace(1)* %out 48 ret void 49} 50 51; CHECK: @fcmp_ugt_select_fptosi 52; CHECK: SETGT_DX10 T{{[0-9]+\.[XYZW]}}, T{{[0-9]+\.[XYZW]}}, literal.x, 1084227584(5.000000e+00) 53define void @fcmp_ugt_select_fptosi(i32 addrspace(1)* %out, float %in) { 54entry: 55 %0 = fcmp ugt float %in, 5.0 56 %1 = select i1 %0, float 1.000000e+00, float 0.000000e+00 57 %2 = fsub float -0.000000e+00, %1 58 %3 = fptosi float %2 to i32 59 store i32 %3, i32 addrspace(1)* %out 60 ret void 61} 62 63; CHECK: @fcmp_ugt_select_i32 64; CHECK: SETGT_DX10 T{{[0-9]+\.[XYZW]}}, T{{[0-9]+\.[XYZW]}}, literal.x, 1084227584(5.000000e+00) 65define void @fcmp_ugt_select_i32(i32 addrspace(1)* %out, float %in) { 66entry: 67 %0 = fcmp ugt float %in, 5.0 68 %1 = select i1 %0, i32 -1, i32 0 69 store i32 %1, i32 addrspace(1)* %out 70 ret void 71} 72 73; CHECK: @fcmp_uge_select_fptosi 74; CHECK: SETGE_DX10 T{{[0-9]+\.[XYZW]}}, T{{[0-9]+\.[XYZW]}}, literal.x, 1084227584(5.000000e+00) 75define void @fcmp_uge_select_fptosi(i32 addrspace(1)* %out, float %in) { 76entry: 77 %0 = fcmp uge float %in, 5.0 78 %1 = select i1 %0, float 1.000000e+00, float 0.000000e+00 79 %2 = fsub float -0.000000e+00, %1 80 %3 = fptosi float %2 to i32 81 store i32 %3, i32 addrspace(1)* %out 82 ret void 83} 84 85; CHECK: @fcmp_uge_select_i32 86; CHECK: SETGE_DX10 T{{[0-9]+\.[XYZW]}}, T{{[0-9]+\.[XYZW]}}, literal.x, 1084227584(5.000000e+00) 87define void @fcmp_uge_select_i32(i32 addrspace(1)* %out, float %in) { 88entry: 89 %0 = fcmp uge float %in, 5.0 90 %1 = select i1 %0, i32 -1, i32 0 91 store i32 %1, i32 addrspace(1)* %out 92 ret void 93} 94 95; CHECK: @fcmp_ule_select_fptosi 96; CHECK: SETGE_DX10 T{{[0-9]+\.[XYZW]}}, literal.x, T{{[0-9]+\.[XYZW]}}, 1084227584(5.000000e+00) 97define void @fcmp_ule_select_fptosi(i32 addrspace(1)* %out, float %in) { 98entry: 99 %0 = fcmp ule float %in, 5.0 100 %1 = select i1 %0, float 1.000000e+00, float 0.000000e+00 101 %2 = fsub float -0.000000e+00, %1 102 %3 = fptosi float %2 to i32 103 store i32 %3, i32 addrspace(1)* %out 104 ret void 105} 106 107; CHECK: @fcmp_ule_select_i32 108; CHECK: SETGE_DX10 T{{[0-9]+\.[XYZW]}}, literal.x, T{{[0-9]+\.[XYZW]}}, 1084227584(5.000000e+00) 109define void @fcmp_ule_select_i32(i32 addrspace(1)* %out, float %in) { 110entry: 111 %0 = fcmp ule float %in, 5.0 112 %1 = select i1 %0, i32 -1, i32 0 113 store i32 %1, i32 addrspace(1)* %out 114 ret void 115} 116 117; CHECK: @fcmp_ult_select_fptosi 118; CHECK: SETGT_DX10 T{{[0-9]+\.[XYZW]}}, literal.x, T{{[0-9]+\.[XYZW]}}, 1084227584(5.000000e+00) 119define void @fcmp_ult_select_fptosi(i32 addrspace(1)* %out, float %in) { 120entry: 121 %0 = fcmp ult float %in, 5.0 122 %1 = select i1 %0, float 1.000000e+00, float 0.000000e+00 123 %2 = fsub float -0.000000e+00, %1 124 %3 = fptosi float %2 to i32 125 store i32 %3, i32 addrspace(1)* %out 126 ret void 127} 128 129; CHECK: @fcmp_ult_select_i32 130; CHECK: SETGT_DX10 T{{[0-9]+\.[XYZW]}}, literal.x, T{{[0-9]+\.[XYZW]}}, 1084227584(5.000000e+00) 131define void @fcmp_ult_select_i32(i32 addrspace(1)* %out, float %in) { 132entry: 133 %0 = fcmp ult float %in, 5.0 134 %1 = select i1 %0, i32 -1, i32 0 135 store i32 %1, i32 addrspace(1)* %out 136 ret void 137} 138