1 // RUN
: llvm-mc
-triple amdgcn-amd-amdhsa
-mcpu
=gfx1200
< %s | FileCheck
--check-prefix
=ASM
%s
2 // RUN
: llvm-mc
-triple amdgcn-amd-amdhsa
-mcpu
=gfx1200
-filetype
=obj
< %s
> %t
3 // RUN
: llvm-objdump
-s
-j
.rodata %t | FileCheck --check-prefix=OBJDUMP %s
5 // When going from asm
-> asm
, the expressions should remain the same
(i.e.
, symbolic
).
6 // When going from asm
-> obj
, the expressions should get resolved
(through fixups
),
8 // OBJDUMP
: Contents of section
.rodata
10 // OBJDUMP-NEXT
: 0000 2b000000
2c000000
00000000 00000000
11 // OBJDUMP-NEXT
: 0010 00000000 00000000 00000000 00000000
12 // OBJDUMP-NEXT
: 0020 00000000 00000000 00000000 00000000
13 // OBJDUMP-NEXT
: 0030 05f02fe4
811f007f
000c0000
00000000
15 // OBJDUMP-NEXT
: 0040 2a000000
2b000000
00000000 00000000
16 // OBJDUMP-NEXT
: 0050 00000000 00000000 00000000 00000000
17 // OBJDUMP-NEXT
: 0060 00000000 00000000 00000000 00000000
18 // OBJDUMP-NEXT
: 0070 05f02fe4
811f007f
000c0000
00000000
23 .amdhsa_code_object_version 4
24 // ASM
: .amdhsa_code_object_version 4
27 .type expr_defined_later,@function
32 .type expr_defined,@function
40 .amdhsa_kernel expr_defined_later
41 .amdhsa_group_segment_fixed_size defined_value+2
42 .amdhsa_private_segment_fixed_size defined_value+3
43 .amdhsa_system_vgpr_workitem_id defined_2_bits
44 .amdhsa_float_round_mode_32 defined_2_bits
45 .amdhsa_float_round_mode_16_64 defined_2_bits
46 .amdhsa_float_denorm_mode_32 defined_2_bits
47 .amdhsa_float_denorm_mode_16_64 defined_2_bits
48 .amdhsa_system_sgpr_workgroup_id_x defined_boolean
49 .amdhsa_system_sgpr_workgroup_id_y defined_boolean
50 .amdhsa_system_sgpr_workgroup_id_z defined_boolean
51 .amdhsa_system_sgpr_workgroup_info defined_boolean
52 .amdhsa_fp16_overflow defined_boolean
53 .amdhsa_workgroup_processor_mode defined_boolean
54 .amdhsa_memory_ordered defined_boolean
55 .amdhsa_forward_progress defined_boolean
56 .amdhsa_exception_fp_ieee_invalid_op defined_boolean
57 .amdhsa_exception_fp_denorm_src defined_boolean
58 .amdhsa_exception_fp_ieee_div_zero defined_boolean
59 .amdhsa_exception_fp_ieee_overflow defined_boolean
60 .amdhsa_exception_fp_ieee_underflow defined_boolean
61 .amdhsa_exception_fp_ieee_inexact defined_boolean
62 .amdhsa_exception_int_div_zero defined_boolean
63 .amdhsa_round_robin_scheduling defined_boolean
64 .amdhsa_enable_private_segment defined_boolean
65 .amdhsa_uses_dynamic_stack defined_boolean
66 .amdhsa_next_free_vgpr defined_value+4
67 .amdhsa_next_free_sgpr defined_value+5
68 .amdhsa_reserve_vcc defined_boolean
71 .set defined_value, 41
72 .set defined_2_bits, 3
73 .set defined_boolean, 1
76 .amdhsa_kernel expr_defined
77 .amdhsa_group_segment_fixed_size defined_value+1
78 .amdhsa_private_segment_fixed_size defined_value+2
79 .amdhsa_system_vgpr_workitem_id defined_2_bits
80 .amdhsa_float_round_mode_32 defined_2_bits
81 .amdhsa_float_round_mode_16_64 defined_2_bits
82 .amdhsa_float_denorm_mode_32 defined_2_bits
83 .amdhsa_float_denorm_mode_16_64 defined_2_bits
84 .amdhsa_system_sgpr_workgroup_id_x defined_boolean
85 .amdhsa_system_sgpr_workgroup_id_y defined_boolean
86 .amdhsa_system_sgpr_workgroup_id_z defined_boolean
87 .amdhsa_system_sgpr_workgroup_info defined_boolean
88 .amdhsa_fp16_overflow defined_boolean
89 .amdhsa_workgroup_processor_mode defined_boolean
90 .amdhsa_memory_ordered defined_boolean
91 .amdhsa_forward_progress defined_boolean
92 .amdhsa_exception_fp_ieee_invalid_op defined_boolean
93 .amdhsa_exception_fp_denorm_src defined_boolean
94 .amdhsa_exception_fp_ieee_div_zero defined_boolean
95 .amdhsa_exception_fp_ieee_overflow defined_boolean
96 .amdhsa_exception_fp_ieee_underflow defined_boolean
97 .amdhsa_exception_fp_ieee_inexact defined_boolean
98 .amdhsa_exception_int_div_zero defined_boolean
99 .amdhsa_round_robin_scheduling defined_boolean
100 .amdhsa_enable_private_segment defined_boolean
101 .amdhsa_uses_dynamic_stack defined_boolean
102 .amdhsa_next_free_vgpr defined_value+3
103 .amdhsa_next_free_sgpr defined_value+4
104 .amdhsa_reserve_vcc defined_boolean
107 // ASM
: .amdhsa_kernel expr_defined_later
108 // ASM-NEXT
: .amdhsa_group_segment_fixed_size defined_value+2
109 // ASM-NEXT
: .amdhsa_private_segment_fixed_size defined_value+3
110 // ASM-NEXT
: .amdhsa_kernarg_size 0
111 // ASM-NEXT
: .amdhsa_user_sgpr_count 0
112 // ASM-NEXT
: .amdhsa_user_sgpr_dispatch_ptr 0
113 // ASM-NEXT
: .amdhsa_user_sgpr_queue_ptr 0
114 // ASM-NEXT
: .amdhsa_user_sgpr_kernarg_segment_ptr 0
115 // ASM-NEXT
: .amdhsa_user_sgpr_dispatch_id 0
116 // ASM-NEXT
: .amdhsa_user_sgpr_private_segment_size 0
117 // ASM-NEXT
: .amdhsa_wavefront_size32 1
118 // ASM-NEXT
: .amdhsa_enable_private_segment ((((((((((((((((((((((((((128|(defined_2_bits<<11))&(~128))|(defined_boolean<<7))&(~256))|(defined_boolean<<8))&(~512))|(defined_boolean<<9))&(~1024))|(defined_boolean<<10))&(~16777216))|(defined_boolean<<24))&(~33554432))|(defined_boolean<<25))&(~67108864))|(defined_boolean<<26))&(~134217728))|(defined_boolean<<27))&(~268435456))|(defined_boolean<<28))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~1))|defined_boolean)&(~62))&1
119 // ASM-NEXT
: .amdhsa_system_sgpr_workgroup_id_x (((((((((((((((((((((((((((128|(defined_2_bits<<11))&(~128))|(defined_boolean<<7))&(~256))|(defined_boolean<<8))&(~512))|(defined_boolean<<9))&(~1024))|(defined_boolean<<10))&(~16777216))|(defined_boolean<<24))&(~33554432))|(defined_boolean<<25))&(~67108864))|(defined_boolean<<26))&(~134217728))|(defined_boolean<<27))&(~268435456))|(defined_boolean<<28))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~1))|defined_boolean)&(~62))&128)>>7
120 // ASM-NEXT
: .amdhsa_system_sgpr_workgroup_id_y (((((((((((((((((((((((((((128|(defined_2_bits<<11))&(~128))|(defined_boolean<<7))&(~256))|(defined_boolean<<8))&(~512))|(defined_boolean<<9))&(~1024))|(defined_boolean<<10))&(~16777216))|(defined_boolean<<24))&(~33554432))|(defined_boolean<<25))&(~67108864))|(defined_boolean<<26))&(~134217728))|(defined_boolean<<27))&(~268435456))|(defined_boolean<<28))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~1))|defined_boolean)&(~62))&256)>>8
121 // ASM-NEXT
: .amdhsa_system_sgpr_workgroup_id_z (((((((((((((((((((((((((((128|(defined_2_bits<<11))&(~128))|(defined_boolean<<7))&(~256))|(defined_boolean<<8))&(~512))|(defined_boolean<<9))&(~1024))|(defined_boolean<<10))&(~16777216))|(defined_boolean<<24))&(~33554432))|(defined_boolean<<25))&(~67108864))|(defined_boolean<<26))&(~134217728))|(defined_boolean<<27))&(~268435456))|(defined_boolean<<28))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~1))|defined_boolean)&(~62))&512)>>9
122 // ASM-NEXT
: .amdhsa_system_sgpr_workgroup_info (((((((((((((((((((((((((((128|(defined_2_bits<<11))&(~128))|(defined_boolean<<7))&(~256))|(defined_boolean<<8))&(~512))|(defined_boolean<<9))&(~1024))|(defined_boolean<<10))&(~16777216))|(defined_boolean<<24))&(~33554432))|(defined_boolean<<25))&(~67108864))|(defined_boolean<<26))&(~134217728))|(defined_boolean<<27))&(~268435456))|(defined_boolean<<28))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~1))|defined_boolean)&(~62))&1024)>>10
123 // ASM-NEXT
: .amdhsa_system_vgpr_workitem_id (((((((((((((((((((((((((((128|(defined_2_bits<<11))&(~128))|(defined_boolean<<7))&(~256))|(defined_boolean<<8))&(~512))|(defined_boolean<<9))&(~1024))|(defined_boolean<<10))&(~16777216))|(defined_boolean<<24))&(~33554432))|(defined_boolean<<25))&(~67108864))|(defined_boolean<<26))&(~134217728))|(defined_boolean<<27))&(~268435456))|(defined_boolean<<28))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~1))|defined_boolean)&(~62))&6144)>>11
124 // ASM-NEXT
: .amdhsa_next_free_vgpr defined_value+4
125 // ASM-NEXT
: .amdhsa_next_free_sgpr defined_value+5
126 // ASM-NEXT
: .amdhsa_reserve_vcc defined_boolean
127 // ASM-NEXT
: .amdhsa_float_round_mode_32 (((((((((((((((((((((1611399168|(defined_2_bits<<12))&(~49152))|(defined_2_bits<<14))&(~196608))|(defined_2_bits<<16))&(~786432))|(defined_2_bits<<18))&(~67108864))|(defined_boolean<<26))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~2147483648))|(defined_boolean<<31))&(~2097152))|(defined_boolean<<21))&(~63))|(((alignto(max(defined_value+4, 1), 8))/8)-1))&(~960))&12288)>>12
128 // ASM-NEXT
: .amdhsa_float_round_mode_16_64 (((((((((((((((((((((1611399168|(defined_2_bits<<12))&(~49152))|(defined_2_bits<<14))&(~196608))|(defined_2_bits<<16))&(~786432))|(defined_2_bits<<18))&(~67108864))|(defined_boolean<<26))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~2147483648))|(defined_boolean<<31))&(~2097152))|(defined_boolean<<21))&(~63))|(((alignto(max(defined_value+4, 1), 8))/8)-1))&(~960))&49152)>>14
129 // ASM-NEXT
: .amdhsa_float_denorm_mode_32 (((((((((((((((((((((1611399168|(defined_2_bits<<12))&(~49152))|(defined_2_bits<<14))&(~196608))|(defined_2_bits<<16))&(~786432))|(defined_2_bits<<18))&(~67108864))|(defined_boolean<<26))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~2147483648))|(defined_boolean<<31))&(~2097152))|(defined_boolean<<21))&(~63))|(((alignto(max(defined_value+4, 1), 8))/8)-1))&(~960))&196608)>>16
130 // ASM-NEXT
: .amdhsa_float_denorm_mode_16_64 (((((((((((((((((((((1611399168|(defined_2_bits<<12))&(~49152))|(defined_2_bits<<14))&(~196608))|(defined_2_bits<<16))&(~786432))|(defined_2_bits<<18))&(~67108864))|(defined_boolean<<26))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~2147483648))|(defined_boolean<<31))&(~2097152))|(defined_boolean<<21))&(~63))|(((alignto(max(defined_value+4, 1), 8))/8)-1))&(~960))&786432)>>18
131 // ASM-NEXT
: .amdhsa_fp16_overflow (((((((((((((((((((((1611399168|(defined_2_bits<<12))&(~49152))|(defined_2_bits<<14))&(~196608))|(defined_2_bits<<16))&(~786432))|(defined_2_bits<<18))&(~67108864))|(defined_boolean<<26))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~2147483648))|(defined_boolean<<31))&(~2097152))|(defined_boolean<<21))&(~63))|(((alignto(max(defined_value+4, 1), 8))/8)-1))&(~960))&67108864)>>26
132 // ASM-NEXT
: .amdhsa_workgroup_processor_mode (((((((((((((((((((((1611399168|(defined_2_bits<<12))&(~49152))|(defined_2_bits<<14))&(~196608))|(defined_2_bits<<16))&(~786432))|(defined_2_bits<<18))&(~67108864))|(defined_boolean<<26))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~2147483648))|(defined_boolean<<31))&(~2097152))|(defined_boolean<<21))&(~63))|(((alignto(max(defined_value+4, 1), 8))/8)-1))&(~960))&536870912)>>29
133 // ASM-NEXT
: .amdhsa_memory_ordered (((((((((((((((((((((1611399168|(defined_2_bits<<12))&(~49152))|(defined_2_bits<<14))&(~196608))|(defined_2_bits<<16))&(~786432))|(defined_2_bits<<18))&(~67108864))|(defined_boolean<<26))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~2147483648))|(defined_boolean<<31))&(~2097152))|(defined_boolean<<21))&(~63))|(((alignto(max(defined_value+4, 1), 8))/8)-1))&(~960))&1073741824)>>30
134 // ASM-NEXT
: .amdhsa_forward_progress (((((((((((((((((((((1611399168|(defined_2_bits<<12))&(~49152))|(defined_2_bits<<14))&(~196608))|(defined_2_bits<<16))&(~786432))|(defined_2_bits<<18))&(~67108864))|(defined_boolean<<26))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~2147483648))|(defined_boolean<<31))&(~2097152))|(defined_boolean<<21))&(~63))|(((alignto(max(defined_value+4, 1), 8))/8)-1))&(~960))&2147483648)>>31
135 // ASM-NEXT
: .amdhsa_round_robin_scheduling (((((((((((((((((((((1611399168|(defined_2_bits<<12))&(~49152))|(defined_2_bits<<14))&(~196608))|(defined_2_bits<<16))&(~786432))|(defined_2_bits<<18))&(~67108864))|(defined_boolean<<26))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~2147483648))|(defined_boolean<<31))&(~2097152))|(defined_boolean<<21))&(~63))|(((alignto(max(defined_value+4, 1), 8))/8)-1))&(~960))&2097152)>>21
136 // ASM-NEXT
: .amdhsa_exception_fp_ieee_invalid_op (((((((((((((((((((((((((((128|(defined_2_bits<<11))&(~128))|(defined_boolean<<7))&(~256))|(defined_boolean<<8))&(~512))|(defined_boolean<<9))&(~1024))|(defined_boolean<<10))&(~16777216))|(defined_boolean<<24))&(~33554432))|(defined_boolean<<25))&(~67108864))|(defined_boolean<<26))&(~134217728))|(defined_boolean<<27))&(~268435456))|(defined_boolean<<28))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~1))|defined_boolean)&(~62))&16777216)>>24
137 // ASM-NEXT
: .amdhsa_exception_fp_denorm_src (((((((((((((((((((((((((((128|(defined_2_bits<<11))&(~128))|(defined_boolean<<7))&(~256))|(defined_boolean<<8))&(~512))|(defined_boolean<<9))&(~1024))|(defined_boolean<<10))&(~16777216))|(defined_boolean<<24))&(~33554432))|(defined_boolean<<25))&(~67108864))|(defined_boolean<<26))&(~134217728))|(defined_boolean<<27))&(~268435456))|(defined_boolean<<28))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~1))|defined_boolean)&(~62))&33554432)>>25
138 // ASM-NEXT
: .amdhsa_exception_fp_ieee_div_zero (((((((((((((((((((((((((((128|(defined_2_bits<<11))&(~128))|(defined_boolean<<7))&(~256))|(defined_boolean<<8))&(~512))|(defined_boolean<<9))&(~1024))|(defined_boolean<<10))&(~16777216))|(defined_boolean<<24))&(~33554432))|(defined_boolean<<25))&(~67108864))|(defined_boolean<<26))&(~134217728))|(defined_boolean<<27))&(~268435456))|(defined_boolean<<28))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~1))|defined_boolean)&(~62))&67108864)>>26
139 // ASM-NEXT
: .amdhsa_exception_fp_ieee_overflow (((((((((((((((((((((((((((128|(defined_2_bits<<11))&(~128))|(defined_boolean<<7))&(~256))|(defined_boolean<<8))&(~512))|(defined_boolean<<9))&(~1024))|(defined_boolean<<10))&(~16777216))|(defined_boolean<<24))&(~33554432))|(defined_boolean<<25))&(~67108864))|(defined_boolean<<26))&(~134217728))|(defined_boolean<<27))&(~268435456))|(defined_boolean<<28))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~1))|defined_boolean)&(~62))&134217728)>>27
140 // ASM-NEXT
: .amdhsa_exception_fp_ieee_underflow (((((((((((((((((((((((((((128|(defined_2_bits<<11))&(~128))|(defined_boolean<<7))&(~256))|(defined_boolean<<8))&(~512))|(defined_boolean<<9))&(~1024))|(defined_boolean<<10))&(~16777216))|(defined_boolean<<24))&(~33554432))|(defined_boolean<<25))&(~67108864))|(defined_boolean<<26))&(~134217728))|(defined_boolean<<27))&(~268435456))|(defined_boolean<<28))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~1))|defined_boolean)&(~62))&268435456)>>28
141 // ASM-NEXT
: .amdhsa_exception_fp_ieee_inexact (((((((((((((((((((((((((((128|(defined_2_bits<<11))&(~128))|(defined_boolean<<7))&(~256))|(defined_boolean<<8))&(~512))|(defined_boolean<<9))&(~1024))|(defined_boolean<<10))&(~16777216))|(defined_boolean<<24))&(~33554432))|(defined_boolean<<25))&(~67108864))|(defined_boolean<<26))&(~134217728))|(defined_boolean<<27))&(~268435456))|(defined_boolean<<28))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~1))|defined_boolean)&(~62))&536870912)>>29
142 // ASM-NEXT
: .amdhsa_exception_int_div_zero (((((((((((((((((((((((((((128|(defined_2_bits<<11))&(~128))|(defined_boolean<<7))&(~256))|(defined_boolean<<8))&(~512))|(defined_boolean<<9))&(~1024))|(defined_boolean<<10))&(~16777216))|(defined_boolean<<24))&(~33554432))|(defined_boolean<<25))&(~67108864))|(defined_boolean<<26))&(~134217728))|(defined_boolean<<27))&(~268435456))|(defined_boolean<<28))&(~536870912))|(defined_boolean<<29))&(~1073741824))|(defined_boolean<<30))&(~1))|defined_boolean)&(~62))&1073741824)>>30
143 // ASM-NEXT
: .end_amdhsa_kernel
145 // ASM
: .set defined_value, 41
146 // ASM-NEXT
: .no_dead_strip defined_value
147 // ASM-NEXT
: .set defined_2_bits, 3
148 // ASM-NEXT
: .no_dead_strip defined_2_bits
149 // ASM-NEXT
: .set defined_boolean, 1
150 // ASM-NEXT
: .no_dead_strip defined_boolean
152 // ASM
: .amdhsa_kernel expr_defined
153 // ASM-NEXT
: .amdhsa_group_segment_fixed_size 42
154 // ASM-NEXT
: .amdhsa_private_segment_fixed_size 43
155 // ASM-NEXT
: .amdhsa_kernarg_size 0
156 // ASM-NEXT
: .amdhsa_user_sgpr_count 0
157 // ASM-NEXT
: .amdhsa_user_sgpr_dispatch_ptr 0
158 // ASM-NEXT
: .amdhsa_user_sgpr_queue_ptr 0
159 // ASM-NEXT
: .amdhsa_user_sgpr_kernarg_segment_ptr 0
160 // ASM-NEXT
: .amdhsa_user_sgpr_dispatch_id 0
161 // ASM-NEXT
: .amdhsa_user_sgpr_private_segment_size 0
162 // ASM-NEXT
: .amdhsa_wavefront_size32 1
163 // ASM-NEXT
: .amdhsa_enable_private_segment 1
164 // ASM-NEXT
: .amdhsa_system_sgpr_workgroup_id_x 1
165 // ASM-NEXT
: .amdhsa_system_sgpr_workgroup_id_y 1
166 // ASM-NEXT
: .amdhsa_system_sgpr_workgroup_id_z 1
167 // ASM-NEXT
: .amdhsa_system_sgpr_workgroup_info 1
168 // ASM-NEXT
: .amdhsa_system_vgpr_workitem_id 3
169 // ASM-NEXT
: .amdhsa_next_free_vgpr 44
170 // ASM-NEXT
: .amdhsa_next_free_sgpr 45
171 // ASM-NEXT
: .amdhsa_reserve_vcc 1
172 // ASM-NEXT
: .amdhsa_float_round_mode_32 3
173 // ASM-NEXT
: .amdhsa_float_round_mode_16_64 3
174 // ASM-NEXT
: .amdhsa_float_denorm_mode_32 3
175 // ASM-NEXT
: .amdhsa_float_denorm_mode_16_64 3
176 // ASM-NEXT
: .amdhsa_fp16_overflow 1
177 // ASM-NEXT
: .amdhsa_workgroup_processor_mode 1
178 // ASM-NEXT
: .amdhsa_memory_ordered 1
179 // ASM-NEXT
: .amdhsa_forward_progress 1
180 // ASM-NEXT
: .amdhsa_round_robin_scheduling 1
181 // ASM-NEXT
: .amdhsa_exception_fp_ieee_invalid_op 1
182 // ASM-NEXT
: .amdhsa_exception_fp_denorm_src 1
183 // ASM-NEXT
: .amdhsa_exception_fp_ieee_div_zero 1
184 // ASM-NEXT
: .amdhsa_exception_fp_ieee_overflow 1
185 // ASM-NEXT
: .amdhsa_exception_fp_ieee_underflow 1
186 // ASM-NEXT
: .amdhsa_exception_fp_ieee_inexact 1
187 // ASM-NEXT
: .amdhsa_exception_int_div_zero 1
188 // ASM-NEXT
: .end_amdhsa_kernel