• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1;; Test disassembly for GRANULATED_WAVEFRONT_SGPR_COUNT in the kernel descriptor.
2
3; RUN: split-file %s %t.dir
4
5; RUN: llvm-mc %t.dir/1.s --triple=amdgcn-amd-amdhsa -mcpu=gfx908 -filetype=obj -o %t1
6; RUN: llvm-objdump --disassemble-symbols=my_kernel_1.kd %t1 | tail -n +8 \
7; RUN: | llvm-mc --triple=amdgcn-amd-amdhsa -mcpu=gfx908 -filetype=obj -o %t1-re-assemble
8; RUN: diff %t1 %t1-re-assemble
9
10; RUN: llvm-mc %t.dir/2.s --triple=amdgcn-amd-amdhsa -mcpu=gfx908 -filetype=obj -o %t2
11; RUN: llvm-objdump --disassemble-symbols=my_kernel_2.kd %t2 | tail -n +8 \
12; RUN: | llvm-mc --triple=amdgcn-amd-amdhsa -mcpu=gfx908 -filetype=obj -o %t2-re-assemble
13; RUN: diff %t2 %t2-re-assemble
14
15; RUN: llvm-mc %t.dir/3.s --triple=amdgcn-amd-amdhsa -mcpu=gfx908 -filetype=obj -o %t3
16; RUN: llvm-objdump --disassemble-symbols=my_kernel_3.kd %t3 | tail -n +8 \
17; RUN: | llvm-mc --triple=amdgcn-amd-amdhsa -mcpu=gfx908 -filetype=obj -o %t3-re-assemble
18; RUN: diff %t3 %t3-re-assemble
19
20
21;--- 1.s
22;; Only set next_free_sgpr.
23.amdhsa_kernel my_kernel_1
24  .amdhsa_next_free_vgpr 0
25  .amdhsa_next_free_sgpr 42
26  .amdhsa_reserve_flat_scratch 0
27  .amdhsa_reserve_xnack_mask 0
28  .amdhsa_reserve_vcc 0
29.end_amdhsa_kernel
30
31;--- 2.s
32;; Only set other directives.
33.amdhsa_kernel my_kernel_2
34  .amdhsa_next_free_vgpr 0
35  .amdhsa_next_free_sgpr 0
36  .amdhsa_reserve_flat_scratch 1
37  .amdhsa_reserve_xnack_mask 1
38  .amdhsa_reserve_vcc 1
39.end_amdhsa_kernel
40
41;--- 3.s
42;; Set all affecting directives.
43.amdhsa_kernel my_kernel_3
44  .amdhsa_next_free_vgpr 0
45  .amdhsa_next_free_sgpr 35
46  .amdhsa_reserve_flat_scratch 1
47  .amdhsa_reserve_xnack_mask 1
48  .amdhsa_reserve_vcc 1
49.end_amdhsa_kernel
50