• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -arch=amdgcn -mcpu=tonga %s -filetype=obj | llvm-objdump -disassemble -arch-name=amdgcn -mcpu=tonga - | FileCheck %s
2
3	.text
4
5	.amdgpu_hsa_kernel hello_world
6hello_world:
7  .amd_kernel_code_t
8  .end_amd_kernel_code_t
9
10	s_mov_b32 m0, 0x10000
11	s_load_dwordx2 s[0:1], s[4:5], 0x8
12	s_waitcnt lgkmcnt(0)
13	s_add_u32 s0, s7, s0
14	v_add_i32_e32 v1, vcc, s0, v1
15	s_movk_i32 s0, 0x483
16	v_cmp_ge_i32_e32 vcc, s0, v0
17	s_and_saveexec_b64 s[0:1], vcc
18	v_lshlrev_b32_e32 v4, 2, v0
19	s_cbranch_execz 21
20	s_mov_b64 s[2:3], exec
21	s_mov_b64 s[10:11], exec
22	v_mov_b32_e32 v3, v0
23        s_endpgm
24
25	.amdgpu_hsa_kernel hello_world2
26hello_world2:
27  .amd_kernel_code_t
28  .end_amd_kernel_code_t
29
30	s_and_saveexec_b64 s[0:1], vcc
31	s_cbranch_execz 85
32	s_load_dwordx4 s[8:11], s[4:5], 0x40
33	v_ashrrev_i32_e32 v77, 31, v76
34	v_lshlrev_b64 v[10:11], 2, v[76:77]
35	s_waitcnt lgkmcnt(0)
36	v_add_i32_e32 v10, vcc, s8, v10
37	v_mov_b32_e32 v6, s9
38	v_addc_u32_e32 v11, vcc, v6, v11, vcc
39	flat_load_dword v0, v[10:11]
40	v_lshlrev_b32_e32 v6, 5, v8
41	v_lshlrev_b32_e32 v7, 2, v7
42        s_endpgm
43
44// CHECK:  file format ELF64-amdgpu-hsacobj
45// CHECK:  Disassembly of section .text:
46// CHECK:  hello_world:
47// CHECK:  s_mov_b32 m0, 0x10000                                      // 000000000100: BEFC00FF 00010000
48// CHECK:  s_load_dwordx2 s[0:1], s[4:5], 0x8                         // 000000000108: C0060002 00000008
49// CHECK:  s_waitcnt lgkmcnt(0)                                       // 000000000110: BF8C007F
50// CHECK:  s_add_u32 s0, s7, s0                                       // 000000000114: 80000007
51// CHECK:  v_add_i32_e32 v1, vcc, s0, v1                              // 000000000118: 32020200
52// CHECK:  s_movk_i32 s0, 0x483                                       // 00000000011C: B0000483
53// CHECK:  v_cmp_ge_i32_e32 vcc, s0, v0                               // 000000000120: 7D8C0000
54// CHECK:  s_and_saveexec_b64 s[0:1], vcc                             // 000000000124: BE80206A
55// CHECK:  v_lshlrev_b32_e32 v4, 2, v0                                // 000000000128: 24080082
56// CHECK:  s_cbranch_execz 21                                         // 00000000012C: BF880015
57// CHECK:  s_mov_b64 s[2:3], exec                                     // 000000000130: BE82017E
58// CHECK:  s_mov_b64 s[10:11], exec                                   // 000000000134: BE8A017E
59// CHECK:  v_mov_b32_e32 v3, v0                                       // 000000000138: 7E060300
60// CHECK:  s_endpgm                                                   // 00000000013C: BF810000
61
62// CHECK:  hello_world2:
63// CHECK:  s_and_saveexec_b64 s[0:1], vcc                             // 000000000240: BE80206A
64// CHECK:  s_cbranch_execz 85                                         // 000000000244: BF880055
65// CHECK:  s_load_dwordx4 s[8:11], s[4:5], 0x40                       // 000000000248: C00A0202 00000040
66// CHECK:  v_ashrrev_i32_e32 v77, 31, v76                             // 000000000250: 229A989F
67// CHECK:  v_lshlrev_b64 v[10:11], 2, v[76:77]                        // 000000000254: D28F000A 00029882
68// CHECK:  s_waitcnt lgkmcnt(0)                                       // 00000000025C: BF8C007F
69// CHECK:  v_add_i32_e32 v10, vcc, s8, v10                            // 000000000260: 32141408
70// CHECK:  v_mov_b32_e32 v6, s9                                       // 000000000264: 7E0C0209
71// CHECK:  v_addc_u32_e32 v11, vcc, v6, v11, vcc                      // 000000000268: 38161706
72// CHECK:  flat_load_dword v0, v[10:11]                               // 00000000026C: DC500000 0000000A
73// CHECK:  v_lshlrev_b32_e32 v6, 5, v8                                // 000000000274: 240C1085
74// CHECK:  v_lshlrev_b32_e32 v7, 2, v7                                // 000000000278: 240E0E82
75// CHECK:  s_endpgm                                                   // 00000000027C: BF810000
76