1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/test/MC/AMDGPU/elf-lds-error.s
Nicolai Haehnle a42afe2f42 AMDGPU/MC: Add .amdgpu_lds directive
Summary:
The directive defines a symbol as an group/local memory (LDS) symbol.
LDS symbols behave similar to common symbols for the purposes of ELF,
using the processor-specific SHN_AMDGPU_LDS as section index.

It is the linker and/or runtime loader's job to "instantiate" LDS symbols
and resolve relocations that reference them.

It is not possible to initialize LDS memory (not even zero-initialize
as for .bss).

We want to be able to link together objects -- starting with relocatable
objects, but possible expanding to shared objects in the future -- that
access LDS memory in a flexible way.

LDS memory is in an address space that is entirely separate from the
address space that contains the program image (code and normal data),
so having program segments for it doesn't really make sense.

Furthermore, we want to be able to compile multiple kernels in a
compilation unit which have disjoint use of LDS memory. In that case,
we may want to place LDS symbols differently for different kernels
to save memory (LDS memory is very limited and physically private to
each kernel invocation), so we can't simply place LDS symbols in a
.lds section.

Hence this solution where LDS symbols always stay undefined.

Change-Id: I08cbc37a7c0c32f53f7b6123aa0afc91dbc1748f

Reviewers: arsenm, rampitec, t-tye, b-sumner, jsjodin

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, rupprecht, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61493

llvm-svn: 364296
2019-06-25 11:51:35 +00:00

20 lines
665 B
ArmAsm

// RUN: not llvm-mc -triple amdgcn-- -mcpu gfx900 %s -o - 2>&1 | FileCheck %s
// CHECK: :[[@LINE+1]]:27: error: size is too large
.amdgpu_lds huge, 200000
// CHECK: :[[@LINE+1]]:30: error: size must be non-negative
.amdgpu_lds negsize, -4
// CHECK: :[[@LINE+1]]:36: error: alignment must be a power of two
.amdgpu_lds zero_align, 5, 0
// CHECK: :[[@LINE+1]]:39: error: alignment must be a power of two
.amdgpu_lds non_pot_align, 0, 12
// CHECK: :[[@LINE+1]]:36: error: alignment is too large
.amdgpu_lds huge_align, 0, 1099511627776
// CHECK: :[[@LINE+1]]:9: error: unknown directive
.amdgpu_ldsnowhitespace, 8