1 //===---- PPCTargetParser - Parser for target features ----------*- C++ -*-===// 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 // This file implements a target parser to recognise hardware features 10 // for PPC CPUs. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef LLVM_TARGETPARSER_PPCTARGETPARSER_H 15 #define LLVM_TARGETPARSER_PPCTARGETPARSER_H 16 17 #include "llvm/ADT/StringRef.h" 18 #include "llvm/TargetParser/Triple.h" 19 20 namespace llvm { 21 namespace PPC { 22 bool isValidCPU(StringRef CPU); 23 void fillValidCPUList(SmallVectorImpl<StringRef> &Values); 24 void fillValidTuneCPUList(SmallVectorImpl<StringRef> &Values); 25 26 // Get target CPU name. 27 // If CPUName is empty or generic, return the default CPU name. 28 // If CPUName is not empty or generic, return the normalized CPU name. 29 StringRef getNormalizedPPCTargetCPU(const Triple &T, StringRef CPUName = ""); 30 31 // Get the tune CPU name. 32 StringRef getNormalizedPPCTuneCPU(const Triple &T, StringRef CPUName = ""); 33 34 // For PPC, there are some cpu names for same CPU, like pwr10 and power10, 35 // normalize them. 36 StringRef normalizeCPUName(StringRef CPUName); 37 } // namespace PPC 38 } // namespace llvm 39 40 #endif 41