288 lines · plain
1; RUN: llc -mtriple=amdgcn < %s| FileCheck -check-prefixes=GCN,SI %s2; RUN: llc -mtriple=amdgcn -mcpu=tonga -mattr=-flat-for-global < %s | FileCheck -check-prefixes=GCN,VI %s3 4; XXX: Merge this into setcc, once R600 supports 64-bit operations5 6;;;==========================================================================;;;7;; Double comparisons8;;;==========================================================================;;;9 10; GCN-LABEL: {{^}}f64_oeq:11; GCN: v_cmp_eq_f6412define amdgpu_kernel void @f64_oeq(ptr addrspace(1) %out, double %a, double %b) #0 {13entry:14 %tmp0 = fcmp oeq double %a, %b15 %tmp1 = sext i1 %tmp0 to i3216 store i32 %tmp1, ptr addrspace(1) %out17 ret void18}19 20; GCN-LABEL: {{^}}f64_ogt:21; GCN: v_cmp_gt_f6422define amdgpu_kernel void @f64_ogt(ptr addrspace(1) %out, double %a, double %b) #0 {23entry:24 %tmp0 = fcmp ogt double %a, %b25 %tmp1 = sext i1 %tmp0 to i3226 store i32 %tmp1, ptr addrspace(1) %out27 ret void28}29 30; GCN-LABEL: {{^}}f64_oge:31; GCN: v_cmp_ge_f6432define amdgpu_kernel void @f64_oge(ptr addrspace(1) %out, double %a, double %b) #0 {33entry:34 %tmp0 = fcmp oge double %a, %b35 %tmp1 = sext i1 %tmp0 to i3236 store i32 %tmp1, ptr addrspace(1) %out37 ret void38}39 40; GCN-LABEL: {{^}}f64_olt:41; GCN: v_cmp_lt_f6442define amdgpu_kernel void @f64_olt(ptr addrspace(1) %out, double %a, double %b) #0 {43entry:44 %tmp0 = fcmp olt double %a, %b45 %tmp1 = sext i1 %tmp0 to i3246 store i32 %tmp1, ptr addrspace(1) %out47 ret void48}49 50; GCN-LABEL: {{^}}f64_ole:51; GCN: v_cmp_le_f6452define amdgpu_kernel void @f64_ole(ptr addrspace(1) %out, double %a, double %b) #0 {53entry:54 %tmp0 = fcmp ole double %a, %b55 %tmp1 = sext i1 %tmp0 to i3256 store i32 %tmp1, ptr addrspace(1) %out57 ret void58}59 60; GCN-LABEL: {{^}}f64_one:61; GCN: v_cmp_lg_f64_e32 vcc62; GCN: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc63define amdgpu_kernel void @f64_one(ptr addrspace(1) %out, double %a, double %b) #0 {64entry:65 %tmp0 = fcmp one double %a, %b66 %tmp1 = sext i1 %tmp0 to i3267 store i32 %tmp1, ptr addrspace(1) %out68 ret void69}70 71; GCN-LABEL: {{^}}f64_ord:72; GCN: v_cmp_o_f6473define amdgpu_kernel void @f64_ord(ptr addrspace(1) %out, double %a, double %b) #0 {74entry:75 %tmp0 = fcmp ord double %a, %b76 %tmp1 = sext i1 %tmp0 to i3277 store i32 %tmp1, ptr addrspace(1) %out78 ret void79}80 81; GCN-LABEL: {{^}}f64_ueq:82; GCN: v_cmp_nlg_f64_e32 vcc83; GCN: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc84define amdgpu_kernel void @f64_ueq(ptr addrspace(1) %out, double %a, double %b) #0 {85entry:86 %tmp0 = fcmp ueq double %a, %b87 %tmp1 = sext i1 %tmp0 to i3288 store i32 %tmp1, ptr addrspace(1) %out89 ret void90}91 92; GCN-LABEL: {{^}}f64_ugt:93 94; GCN: v_cmp_nle_f64_e32 vcc95; GCN: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc96define amdgpu_kernel void @f64_ugt(ptr addrspace(1) %out, double %a, double %b) #0 {97entry:98 %tmp0 = fcmp ugt double %a, %b99 %tmp1 = sext i1 %tmp0 to i32100 store i32 %tmp1, ptr addrspace(1) %out101 ret void102}103 104; GCN-LABEL: {{^}}f64_uge:105; GCN: v_cmp_nlt_f64_e32 vcc106; GCN: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc107define amdgpu_kernel void @f64_uge(ptr addrspace(1) %out, double %a, double %b) #0 {108entry:109 %tmp0 = fcmp uge double %a, %b110 %tmp1 = sext i1 %tmp0 to i32111 store i32 %tmp1, ptr addrspace(1) %out112 ret void113}114 115; GCN-LABEL: {{^}}f64_ult:116; GCN: v_cmp_nge_f64_e32 vcc117; GCN: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc118define amdgpu_kernel void @f64_ult(ptr addrspace(1) %out, double %a, double %b) #0 {119entry:120 %tmp0 = fcmp ult double %a, %b121 %tmp1 = sext i1 %tmp0 to i32122 store i32 %tmp1, ptr addrspace(1) %out123 ret void124}125 126; GCN-LABEL: {{^}}f64_ule:127; GCN: v_cmp_ngt_f64_e32 vcc128; GCN: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc129define amdgpu_kernel void @f64_ule(ptr addrspace(1) %out, double %a, double %b) #0 {130entry:131 %tmp0 = fcmp ule double %a, %b132 %tmp1 = sext i1 %tmp0 to i32133 store i32 %tmp1, ptr addrspace(1) %out134 ret void135}136 137; GCN-LABEL: {{^}}f64_une:138; GCN: v_cmp_neq_f64139define amdgpu_kernel void @f64_une(ptr addrspace(1) %out, double %a, double %b) #0 {140entry:141 %tmp0 = fcmp une double %a, %b142 %tmp1 = sext i1 %tmp0 to i32143 store i32 %tmp1, ptr addrspace(1) %out144 ret void145}146 147; GCN-LABEL: {{^}}f64_uno:148; GCN: v_cmp_u_f64149define amdgpu_kernel void @f64_uno(ptr addrspace(1) %out, double %a, double %b) #0 {150entry:151 %tmp0 = fcmp uno double %a, %b152 %tmp1 = sext i1 %tmp0 to i32153 store i32 %tmp1, ptr addrspace(1) %out154 ret void155}156 157;;;==========================================================================;;;158;; 64-bit integer comparisons159;;;==========================================================================;;;160 161; GCN-LABEL: {{^}}i64_eq:162; SI: v_cmp_eq_u64163; VI: s_cmp_eq_u64164define amdgpu_kernel void @i64_eq(ptr addrspace(1) %out, i64 %a, i64 %b) #0 {165entry:166 %tmp0 = icmp eq i64 %a, %b167 %tmp1 = sext i1 %tmp0 to i32168 store i32 %tmp1, ptr addrspace(1) %out169 ret void170}171 172; GCN-LABEL: {{^}}i64_ne:173; SI: v_cmp_ne_u64174; VI: s_cmp_lg_u64175define amdgpu_kernel void @i64_ne(ptr addrspace(1) %out, i64 %a, i64 %b) #0 {176entry:177 %tmp0 = icmp ne i64 %a, %b178 %tmp1 = sext i1 %tmp0 to i32179 store i32 %tmp1, ptr addrspace(1) %out180 ret void181}182 183; GCN-LABEL: {{^}}i64_ugt:184; GCN: v_cmp_gt_u64185define amdgpu_kernel void @i64_ugt(ptr addrspace(1) %out, i64 %a, i64 %b) #0 {186entry:187 %tmp0 = icmp ugt i64 %a, %b188 %tmp1 = sext i1 %tmp0 to i32189 store i32 %tmp1, ptr addrspace(1) %out190 ret void191}192 193; GCN-LABEL: {{^}}i64_uge:194; GCN: v_cmp_ge_u64195define amdgpu_kernel void @i64_uge(ptr addrspace(1) %out, i64 %a, i64 %b) #0 {196entry:197 %tmp0 = icmp uge i64 %a, %b198 %tmp1 = sext i1 %tmp0 to i32199 store i32 %tmp1, ptr addrspace(1) %out200 ret void201}202 203; GCN-LABEL: {{^}}i64_ult:204; GCN: v_cmp_lt_u64205define amdgpu_kernel void @i64_ult(ptr addrspace(1) %out, i64 %a, i64 %b) #0 {206entry:207 %tmp0 = icmp ult i64 %a, %b208 %tmp1 = sext i1 %tmp0 to i32209 store i32 %tmp1, ptr addrspace(1) %out210 ret void211}212 213; GCN-LABEL: {{^}}i64_ule:214; GCN: v_cmp_le_u64215define amdgpu_kernel void @i64_ule(ptr addrspace(1) %out, i64 %a, i64 %b) #0 {216entry:217 %tmp0 = icmp ule i64 %a, %b218 %tmp1 = sext i1 %tmp0 to i32219 store i32 %tmp1, ptr addrspace(1) %out220 ret void221}222 223; GCN-LABEL: {{^}}i64_sgt:224; GCN: v_cmp_gt_i64225define amdgpu_kernel void @i64_sgt(ptr addrspace(1) %out, i64 %a, i64 %b) #0 {226entry:227 %tmp0 = icmp sgt i64 %a, %b228 %tmp1 = sext i1 %tmp0 to i32229 store i32 %tmp1, ptr addrspace(1) %out230 ret void231}232 233; GCN-LABEL: {{^}}i64_sge:234; GCN: v_cmp_ge_i64235define amdgpu_kernel void @i64_sge(ptr addrspace(1) %out, i64 %a, i64 %b) #0 {236entry:237 %tmp0 = icmp sge i64 %a, %b238 %tmp1 = sext i1 %tmp0 to i32239 store i32 %tmp1, ptr addrspace(1) %out240 ret void241}242 243; GCN-LABEL: {{^}}i64_slt:244; GCN: v_cmp_lt_i64245define amdgpu_kernel void @i64_slt(ptr addrspace(1) %out, i64 %a, i64 %b) #0 {246entry:247 %tmp0 = icmp slt i64 %a, %b248 %tmp1 = sext i1 %tmp0 to i32249 store i32 %tmp1, ptr addrspace(1) %out250 ret void251}252 253; GCN-LABEL: {{^}}i64_sle:254; GCN: v_cmp_le_i64255define amdgpu_kernel void @i64_sle(ptr addrspace(1) %out, i64 %a, i64 %b) #0 {256entry:257 %tmp0 = icmp sle i64 %a, %b258 %tmp1 = sext i1 %tmp0 to i32259 store i32 %tmp1, ptr addrspace(1) %out260 ret void261}262 263; GCN-LABEL: {{^}}i128_sle:264; GCN: v_cmp_le_i64265; CGV: v_cndmask266; SI: v_cmp_eq_u64267; VI: s_cmp_eq_u64268define amdgpu_kernel void @i128_sle(ptr addrspace(1) %out, i128 %a, i128 %b) #0 {269entry:270 %tmp0 = icmp sle i128 %a, %b271 %tmp1 = sext i1 %tmp0 to i32272 store i32 %tmp1, ptr addrspace(1) %out273 ret void274}275 276; GCN-LABEL: {{^}}i128_eq_const:277; SI: v_cmp_eq_u64278; VI: s_cmp_eq_u64279define amdgpu_kernel void @i128_eq_const(ptr addrspace(1) %out, i128 %a) #0 {280entry:281 %tmp0 = icmp eq i128 %a, 85070591730234615865843651857942052992282 %tmp1 = sext i1 %tmp0 to i32283 store i32 %tmp1, ptr addrspace(1) %out284 ret void285}286 287attributes #0 = { nounwind }288