Path: blob/main/contrib/llvm-project/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp
35294 views
//===-- PPCMCAsmInfo.cpp - PPC asm properties -----------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file contains the declarations of the MCAsmInfoDarwin properties.9//10//===----------------------------------------------------------------------===//1112#include "PPCMCAsmInfo.h"13#include "llvm/TargetParser/Triple.h"1415using namespace llvm;1617void PPCELFMCAsmInfo::anchor() { }1819PPCELFMCAsmInfo::PPCELFMCAsmInfo(bool is64Bit, const Triple& T) {20// FIXME: This is not always needed. For example, it is not needed in the21// v2 abi.22NeedsLocalForSize = true;2324if (is64Bit) {25CodePointerSize = CalleeSaveStackSlotSize = 8;26}27IsLittleEndian =28T.getArch() == Triple::ppc64le || T.getArch() == Triple::ppcle;2930// ".comm align is in bytes but .align is pow-2."31AlignmentIsInBytes = false;3233CommentString = "#";3435// Uses '.section' before '.bss' directive36UsesELFSectionDirectiveForBSS = true;3738// Debug Information39SupportsDebugInformation = true;4041DollarIsPC = true;4243// Set up DWARF directives44MinInstAlignment = 4;4546// Exceptions handling47ExceptionsType = ExceptionHandling::DwarfCFI;4849ZeroDirective = "\t.space\t";50Data64bitsDirective = is64Bit ? "\t.quad\t" : nullptr;51AssemblerDialect = 1; // New-Style mnemonics.52LCOMMDirectiveAlignmentType = LCOMM::ByteAlignment;53}5455void PPCXCOFFMCAsmInfo::anchor() {}5657PPCXCOFFMCAsmInfo::PPCXCOFFMCAsmInfo(bool Is64Bit, const Triple &T) {58if (T.getArch() == Triple::ppc64le || T.getArch() == Triple::ppcle)59report_fatal_error("XCOFF is not supported for little-endian targets");60CodePointerSize = CalleeSaveStackSlotSize = Is64Bit ? 8 : 4;6162// A size of 8 is only supported by the assembler under 64-bit.63Data64bitsDirective = Is64Bit ? "\t.vbyte\t8, " : nullptr;6465// Debug Information66SupportsDebugInformation = true;6768// Set up DWARF directives69MinInstAlignment = 4;7071// Support $ as PC in inline asm72DollarIsPC = true;73}747576