|
1 | 1 | # RUN: %python %s --target=cuda --tests=suld,sust,tex,tld4 --gen-list=%t.list > %t-cuda.ll |
2 | | -# RUN: llc -mcpu=sm_60 -mattr=+ptx43 %t-cuda.ll -verify-machineinstrs -o - | FileCheck %t-cuda.ll |
| 2 | +# RUN: llc -mcpu=sm_60 -mattr=+ptx43 %t-cuda.ll -verify-machineinstrs -o - | FileCheck %t-cuda.ll --check-prefixes=CHECK,CHECK-CUDA |
3 | 3 | # RUN: %if ptxas %{ llc -mcpu=sm_60 -mattr=+ptx43 %t-cuda.ll -verify-machineinstrs -o - | %ptxas-verify %} |
4 | 4 |
|
5 | 5 | # We only need to run this second time for texture tests, because |
6 | 6 | # there is a difference between unified and non-unified intrinsics. |
7 | 7 | # |
8 | 8 | # RUN: %python %s --target=nvcl --tests=suld,sust,tex,tld4 --gen-list-append --gen-list=%t.list > %t-nvcl.ll |
9 | | -# RUN: llc %t-nvcl.ll -verify-machineinstrs -o - | FileCheck %t-nvcl.ll |
| 9 | +# RUN: llc %t-nvcl.ll -verify-machineinstrs -o - | FileCheck %t-nvcl.ll --check-prefixes=CHECK,CHECK-NVCL |
10 | 10 | # RUN: %if ptxas %{ llc %t-nvcl.ll -verify-machineinstrs -o - | %ptxas-verify %} |
11 | 11 |
|
12 | 12 | # Verify that all instructions and intrinsics defined in TableGen |
@@ -269,7 +269,9 @@ def gen_suld_tests(target, global_surf): |
269 | 269 | ret void |
270 | 270 | } |
271 | 271 | ; CHECK-LABEL: .entry ${test_name}_global |
272 | | - ; CHECK: ${instruction} ${reg_ret}, [${global_surf}, ${reg_access}] |
| 272 | + ; CHECK-CUDA: mov.u64 [[REG${reg_id}:%.*]], ${global_surf} |
| 273 | + ; CHECK-CUDA: ${instruction} ${reg_ret}, [[[REG${reg_id}]], ${reg_access}] |
| 274 | + ; CHECK-NVCL: ${instruction} ${reg_ret}, [${global_surf}, ${reg_access}] |
273 | 275 | define void @${test_name}_global(${retty}* %ret, ${access}) { |
274 | 276 | %gs = tail call i64 @llvm.nvvm.texsurf.handle.internal.p1i64(i64 addrspace(1)* @${global_surf}) |
275 | 277 | %val = tail call ${retty} @${intrinsic}(i64 %gs, ${access}) |
@@ -312,6 +314,7 @@ def gen_suld_tests(target, global_surf): |
312 | 314 | "reg_ret": get_ptx_vec_reg(vec, dtype), |
313 | 315 | "reg_surf": get_ptx_surface(target), |
314 | 316 | "reg_access": get_ptx_surface_access(geom), |
| 317 | + "reg_id": get_table_gen_id(), |
315 | 318 | } |
316 | 319 | gen_test(template, params) |
317 | 320 | generated_items.append((params["intrinsic"], params["instruction"])) |
@@ -361,7 +364,9 @@ def gen_sust_tests(target, global_surf): |
361 | 364 | ret void |
362 | 365 | } |
363 | 366 | ; CHECK-LABEL: .entry ${test_name}_global |
364 | | - ; CHECK: ${instruction} [${global_surf}, ${reg_access}], ${reg_value} |
| 367 | + ; CHECK-CUDA: mov.u64 [[REG${reg_id}:%.*]], ${global_surf} |
| 368 | + ; CHECK-CUDA: ${instruction} [[[REG${reg_id}]], ${reg_access}], ${reg_value} |
| 369 | + ; CHECK-NVCL: ${instruction} [${global_surf}, ${reg_access}], ${reg_value} |
365 | 370 | define void @${test_name}_global(${value}, ${access}) { |
366 | 371 | %gs = tail call i64 @llvm.nvvm.texsurf.handle.internal.p1i64(i64 addrspace(1)* @${global_surf}) |
367 | 372 | tail call void @${intrinsic}(i64 %gs, ${access}, ${value}) |
@@ -415,6 +420,7 @@ def gen_sust_tests(target, global_surf): |
415 | 420 | "reg_value": get_ptx_vec_reg(vec, ctype), |
416 | 421 | "reg_surf": get_ptx_surface(target), |
417 | 422 | "reg_access": get_ptx_surface_access(geom), |
| 423 | + "reg_id": get_table_gen_id(), |
418 | 424 | } |
419 | 425 | gen_test(template, params) |
420 | 426 | generated_items.append((params["intrinsic"], params["instruction"])) |
@@ -621,7 +627,9 @@ def gen_tex_tests(target, global_tex, global_sampler): |
621 | 627 | ret void |
622 | 628 | } |
623 | 629 | ; CHECK-LABEL: .entry ${test_name}_global |
624 | | - ; CHECK: ${instruction} ${ptx_ret}, [${global_tex}, ${ptx_global_sampler} ${ptx_access}] |
| 630 | + ; CHECK-CUDA: mov.u64 [[REG${reg_id}:%.*]], ${global_tex} |
| 631 | + ; CHECK-CUDA: ${instruction} ${ptx_ret}, [[[REG${reg_id}]], ${ptx_global_sampler} ${ptx_access}] |
| 632 | + ; CHECK-NVCL: ${instruction} ${ptx_ret}, [${global_tex}, ${ptx_global_sampler} ${ptx_access}] |
625 | 633 | define void @${test_name}_global(${retty}* %ret, ${access}) { |
626 | 634 | %gt = tail call i64 @llvm.nvvm.texsurf.handle.internal.p1i64(i64 addrspace(1)* @${global_tex}) |
627 | 635 | ${get_sampler_handle} |
@@ -705,6 +713,7 @@ def gen_tex_tests(target, global_tex, global_sampler): |
705 | 713 | "ptx_tex": get_ptx_texture(target), |
706 | 714 | "ptx_access": get_ptx_texture_access(geom, ctype), |
707 | 715 | "ptx_global_sampler": get_ptx_global_sampler(target, global_sampler), |
| 716 | + "reg_id": get_table_gen_id(), |
708 | 717 | } |
709 | 718 | gen_test(template, params) |
710 | 719 | generated_items.append((params["intrinsic"], params["instruction"])) |
@@ -805,7 +814,9 @@ def gen_tld4_tests(target, global_tex, global_sampler): |
805 | 814 | ret void |
806 | 815 | } |
807 | 816 | ; CHECK-LABEL: .entry ${test_name}_global |
808 | | - ; CHECK: ${instruction} ${ptx_ret}, [${global_tex}, ${ptx_global_sampler} ${ptx_access}] |
| 817 | + ; CHECK-CUDA: mov.u64 [[REG${reg_id}:%.*]], ${global_tex} |
| 818 | + ; CHECK-CUDA: ${instruction} ${ptx_ret}, [[[REG${reg_id}]], ${ptx_global_sampler} ${ptx_access}] |
| 819 | + ; CHECK-NVCL: ${instruction} ${ptx_ret}, [${global_tex}, ${ptx_global_sampler} ${ptx_access}] |
809 | 820 | define void @${test_name}_global(${retty}* %ret, ${access}) { |
810 | 821 | %gt = tail call i64 @llvm.nvvm.texsurf.handle.internal.p1i64(i64 addrspace(1)* @${global_tex}) |
811 | 822 | ${get_sampler_handle} |
@@ -851,6 +862,7 @@ def gen_tld4_tests(target, global_tex, global_sampler): |
851 | 862 | "ptx_tex": get_ptx_texture(target), |
852 | 863 | "ptx_access": get_ptx_tld4_access(geom), |
853 | 864 | "ptx_global_sampler": get_ptx_global_sampler(target, global_sampler), |
| 865 | + "reg_id": get_table_gen_id(), |
854 | 866 | } |
855 | 867 | gen_test(template, params) |
856 | 868 | generated_items.append((params["intrinsic"], params["instruction"])) |
|
0 commit comments