elf-lds.s
2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// RUN: llvm-mc -filetype=obj -triple amdgcn-- -mcpu gfx900 %s -o - | llvm-readobj -t -r | FileCheck %s
.text
.globl test_kernel
.p2align 8
.type test_kernel,@function
test_kernel:
s_mov_b32 s0, lds0@abs32@lo
v_lshl_add_u32 v3, v0, 2, s0
ds_read2_b32 v[1:2], v3 offset1:1
s_mov_b32 s0, lds4@abs32@lo
v_lshl_add_u32 v3, v0, 2, s0
ds_write_b32 v3, v1
s_endpgm
.Lfunc_end:
.size test_kernel, .Lfunc_end-test_kernel
.globl lds0
.amdgpu_lds lds0, 192, 16
.globl lds1
.amdgpu_lds lds1,387,8
; Weird whitespace cases
.globl lds2
.amdgpu_lds lds2, 12
; No alignment or .globl directive, not mentioned anywhere
.amdgpu_lds lds3, 16
; No alignment or .globl directive, size 0, but mentioned in .text
.amdgpu_lds lds4, 0
// CHECK: Relocations [
// CHECK: Section (3) .rel.text {
// CHECK-NEXT: 0x4 R_AMDGPU_ABS32 lds0 0x0
// CHECK-NEXT: 0x1C R_AMDGPU_ABS32 lds4 0x0
// CHECK-NEXT: }
// CHECK: ]
// CHECK: Symbol {
// CHECK: Name: lds0 (54)
// CHECK-NEXT: Value: 0x10
// CHECK-NEXT: Size: 192
// CHECK-NEXT: Binding: Global (0x1)
// CHECK-NEXT: Type: Object (0x1)
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: Processor Specific (0xFF00)
// CHECK-NEXT: }
// CHECK: Symbol {
// CHECK: Name: lds1 (49)
// CHECK-NEXT: Value: 0x8
// CHECK-NEXT: Size: 387
// CHECK-NEXT: Binding: Global (0x1)
// CHECK-NEXT: Type: Object (0x1)
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: Processor Specific (0xFF00)
// CHECK-NEXT: }
// CHECK: Symbol {
// CHECK: Name: lds2 (44)
// CHECK-NEXT: Value: 0x4
// CHECK-NEXT: Size: 12
// CHECK-NEXT: Binding: Global (0x1)
// CHECK-NEXT: Type: Object (0x1)
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: Processor Specific (0xFF00)
// CHECK-NEXT: }
// CHECK-NOT: Name: lds3
// CHECK: Symbol {
// CHECK: Name: lds4 (39)
// CHECK-NEXT: Value: 0x4
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global (0x1)
// CHECK-NEXT: Type: Object (0x1)
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: Processor Specific (0xFF00)
// CHECK-NEXT: }