xref: /freebsd/contrib/llvm-project/llvm/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp (revision 700637cbb5e582861067a11aaca4d053546871d2)
1 //===-- PowerPCTargetInfo.cpp - PowerPC Target Implementation -------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "TargetInfo/PowerPCTargetInfo.h"
10 #include "llvm/MC/TargetRegistry.h"
11 #include "llvm/Support/Compiler.h"
12 using namespace llvm;
13 
getThePPC32Target()14 Target &llvm::getThePPC32Target() {
15   static Target ThePPC32Target;
16   return ThePPC32Target;
17 }
getThePPC32LETarget()18 Target &llvm::getThePPC32LETarget() {
19   static Target ThePPC32LETarget;
20   return ThePPC32LETarget;
21 }
getThePPC64Target()22 Target &llvm::getThePPC64Target() {
23   static Target ThePPC64Target;
24   return ThePPC64Target;
25 }
getThePPC64LETarget()26 Target &llvm::getThePPC64LETarget() {
27   static Target ThePPC64LETarget;
28   return ThePPC64LETarget;
29 }
30 
31 extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void
LLVMInitializePowerPCTargetInfo()32 LLVMInitializePowerPCTargetInfo() {
33   RegisterTarget<Triple::ppc, /*HasJIT=*/true> W(getThePPC32Target(), "ppc32",
34                                                  "PowerPC 32", "PPC");
35 
36   RegisterTarget<Triple::ppcle, /*HasJIT=*/true> X(
37       getThePPC32LETarget(), "ppc32le", "PowerPC 32 LE", "PPC");
38 
39   RegisterTarget<Triple::ppc64, /*HasJIT=*/true> Y(getThePPC64Target(), "ppc64",
40                                                    "PowerPC 64", "PPC");
41 
42   RegisterTarget<Triple::ppc64le, /*HasJIT=*/true> Z(
43       getThePPC64LETarget(), "ppc64le", "PowerPC 64 LE", "PPC");
44 }
45