llvm/test/MC/AMDGPU/sym_option.s
Artem Tamazov d8dc65b207 [AMDGPU][llvm-mc] Predefined symbols to access register counts (.kernel.{v|s}gpr_count)
The feature allows for conditional assembly, filling the entries
of .amd_kernel_code_t etc.

Symbols are defined with value 0 at the beginning of each kernel scope.
After each register usage, the respective symbol is set to:
	value = max( value, ( register index + 1 ) )
Thus, at the end of scope the value represents a count of used registers.

Kernel scopes begin at .amdgpu_hsa_kernel directive, end at the
next .amdgpu_hsa_kernel (or EOF, whichever comes first). There is also
dummy scope that lies from the beginning of source file til the
first .amdgpu_hsa_kernel.

Test added.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290608 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-27 16:00:11 +00:00

47 lines
1.5 KiB
ArmAsm

// RUN: llvm-mc -arch=amdgcn -mcpu=SI %s | FileCheck %s --check-prefix=SI
// RUN: llvm-mc -arch=amdgcn -mcpu=bonaire %s | FileCheck %s --check-prefix=BONAIRE
// RUN: llvm-mc -arch=amdgcn -mcpu=hawaii %s | FileCheck %s --check-prefix=HAWAII
// RUN: llvm-mc -arch=amdgcn -mcpu=kabini %s | FileCheck %s --check-prefix=KABINI
// RUN: llvm-mc -arch=amdgcn -mcpu=iceland %s | FileCheck %s --check-prefix=ICELAND
// RUN: llvm-mc -arch=amdgcn -mcpu=carrizo %s | FileCheck %s --check-prefix=CARRIZO
// RUN: llvm-mc -arch=amdgcn -mcpu=tonga %s | FileCheck %s --check-prefix=TONGA
// RUN: llvm-mc -arch=amdgcn -mcpu=fiji %s | FileCheck %s --check-prefix=FIJI
// RUN: llvm-mc -arch=amdgcn -mcpu=gfx804 %s | FileCheck %s --check-prefix=GFX804
// RUN: llvm-mc -arch=amdgcn -mcpu=stoney %s | FileCheck %s --check-prefix=STONEY
.byte .option.machine_version_major
// SI: .byte 0
// BONAIRE: .byte 7
// HAWAII: .byte 7
// KABINI: .byte 7
// ICELAND: .byte 8
// CARRIZO: .byte 8
// TONGA: .byte 8
// FIJI: .byte 8
// GFX804: .byte 8
// STONEY: .byte 8
.byte .option.machine_version_minor
// SI: .byte 0
// BONAIRE: .byte 0
// HAWAII: .byte 0
// KABINI: .byte 0
// ICELAND: .byte 0
// CARRIZO: .byte 0
// TONGA: .byte 0
// FIJI: .byte 0
// GFX804: .byte 0
// STONEY: .byte 1
.byte .option.machine_version_stepping
// SI: .byte 0
// BONAIRE: .byte 0
// HAWAII: .byte 1
// KABINI: .byte 2
// ICELAND: .byte 0
// CARRIZO: .byte 1
// TONGA: .byte 2
// FIJI: .byte 3
// GFX804: .byte 4
// STONEY: .byte 0