llvm.org GIT mirror llvm / 41ca691
[Triple] Add AMDPAL operating system type Summary: This operating system type represents the AMDGPU PAL runtime, and will be required by the AMDGPU backend in order to generate correct code for this runtime. Currently it generates the same code as not specifying an OS at all. That will change in future commits. Patch from Tim Corringham. Subscribers: arsenm, nhaehnle Differential Revision: https://reviews.llvm.org/D37380 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314500 91177308-0d34-0410-b5e6-96231b3b80d8 Tim Renouf 1 year, 11 months ago
5 changed file(s) with 24 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
178178 WatchOS, // Apple watchOS
179179 Mesa3D,
180180 Contiki,
181 LastOSType = Contiki
181 AMDPAL, // AMD PAL Runtime
182 LastOSType = AMDPAL
182183 };
183184 enum EnvironmentType {
184185 UnknownEnvironment,
206206 case WatchOS: return "watchos";
207207 case Mesa3D: return "mesa3d";
208208 case Contiki: return "contiki";
209 case AMDPAL: return "amdpal";
209210 }
210211
211212 llvm_unreachable("Invalid OSType");
498499 .StartsWith("watchos", Triple::WatchOS)
499500 .StartsWith("mesa3d", Triple::Mesa3D)
500501 .StartsWith("contiki", Triple::Contiki)
502 .StartsWith("amdpal", Triple::AMDPAL)
501503 .Default(Triple::UnknownOS);
502504 }
503505
213213 TargetTriple.getEnvironmentName() == "amdgizcl";
214214 }
215215
216 bool isAmdPalOS() const {
217 return TargetTriple.getOS() == Triple::AMDPAL;
218 }
219
216220 Generation getGeneration() const {
217221 return Gen;
218222 }
0 ; RUN: llc < %s -mtriple=amdgcn--amdpal -mcpu=tahiti | FileCheck --check-prefix=PAL %s
1
2 ; PAL: .AMDGPU.config
3
4 define amdgpu_kernel void @simple(i32 addrspace(1)* %out) {
5 entry:
6 store i32 0, i32 addrspace(1)* %out
7 ret void
8 }
9
270270 EXPECT_EQ(Triple::AMD, T.getVendor());
271271 EXPECT_EQ(Triple::AMDHSA, T.getOS());
272272 EXPECT_EQ(Triple::OpenCL, T.getEnvironment());
273
274 T = Triple("amdgcn-amd-amdpal");
275 EXPECT_EQ(Triple::amdgcn, T.getArch());
276 EXPECT_EQ(Triple::AMD, T.getVendor());
277 EXPECT_EQ(Triple::AMDPAL, T.getOS());
278 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
273279
274280 T = Triple("riscv32-unknown-unknown");
275281 EXPECT_EQ(Triple::riscv32, T.getArch());