blob: d903b00e3938f97e3f3611436546dffa718d702f [file] [log] [blame]
Changpeng Fang278a5b32016-03-10 16:47:15 +00001; RUN: llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs < %s | FileCheck %s
2; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=kaveri -verify-machineinstrs < %s | FileCheck %s
3; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=fiji -verify-machineinstrs < %s | FileCheck %s
4
5; FUNC-LABEL: {{^}}s_getreg_test:
6; CHECK: s_getreg_b32 s{{[0-9]+}}, 0xb206
7define void @s_getreg_test(i32 addrspace(1)* %out) { ; simm16=45574 for lds size.
8 %lds_size_64dwords = call i32 @llvm.amdgcn.s.getreg(i32 45574) #0
9 %lds_size_bytes = shl i32 %lds_size_64dwords, 8
10 store i32 %lds_size_bytes, i32 addrspace(1)* %out
11 ret void
12}
13
14declare i32 @llvm.amdgcn.s.getreg(i32) #0
15
16attributes #0 = { nounwind readonly}