1480093f4SDimitry Andric //===-- VETargetStreamer.cpp - VE Target Streamer Methods -----------------===// 2480093f4SDimitry Andric // 3480093f4SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4480093f4SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 5480093f4SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6480093f4SDimitry Andric // 7480093f4SDimitry Andric //===----------------------------------------------------------------------===// 8480093f4SDimitry Andric // 9480093f4SDimitry Andric // This file provides VE specific target streamer methods. 10480093f4SDimitry Andric // 11480093f4SDimitry Andric //===----------------------------------------------------------------------===// 12480093f4SDimitry Andric 13480093f4SDimitry Andric #include "VETargetStreamer.h" 145ffd83dbSDimitry Andric #include "VEInstPrinter.h" 15*bdd1243dSDimitry Andric #include "llvm/MC/MCRegister.h" 16480093f4SDimitry Andric 17480093f4SDimitry Andric using namespace llvm; 18480093f4SDimitry Andric 19480093f4SDimitry Andric // pin vtable to this file VETargetStreamer(MCStreamer & S)20480093f4SDimitry AndricVETargetStreamer::VETargetStreamer(MCStreamer &S) : MCTargetStreamer(S) {} 21480093f4SDimitry Andric anchor()22480093f4SDimitry Andricvoid VETargetStreamer::anchor() {} 23480093f4SDimitry Andric VETargetAsmStreamer(MCStreamer & S,formatted_raw_ostream & OS)24480093f4SDimitry AndricVETargetAsmStreamer::VETargetAsmStreamer(MCStreamer &S, 25480093f4SDimitry Andric formatted_raw_ostream &OS) 26480093f4SDimitry Andric : VETargetStreamer(S), OS(OS) {} 27480093f4SDimitry Andric emitVERegisterIgnore(unsigned reg)28480093f4SDimitry Andricvoid VETargetAsmStreamer::emitVERegisterIgnore(unsigned reg) { 29480093f4SDimitry Andric OS << "\t.register " 30480093f4SDimitry Andric << "%" << StringRef(VEInstPrinter::getRegisterName(reg)).lower() 31480093f4SDimitry Andric << ", #ignore\n"; 32480093f4SDimitry Andric } 33480093f4SDimitry Andric emitVERegisterScratch(unsigned reg)34480093f4SDimitry Andricvoid VETargetAsmStreamer::emitVERegisterScratch(unsigned reg) { 35480093f4SDimitry Andric OS << "\t.register " 36480093f4SDimitry Andric << "%" << StringRef(VEInstPrinter::getRegisterName(reg)).lower() 37480093f4SDimitry Andric << ", #scratch\n"; 38480093f4SDimitry Andric } 39480093f4SDimitry Andric VETargetELFStreamer(MCStreamer & S)40480093f4SDimitry AndricVETargetELFStreamer::VETargetELFStreamer(MCStreamer &S) : VETargetStreamer(S) {} 41480093f4SDimitry Andric getStreamer()42480093f4SDimitry AndricMCELFStreamer &VETargetELFStreamer::getStreamer() { 43480093f4SDimitry Andric return static_cast<MCELFStreamer &>(Streamer); 44480093f4SDimitry Andric } 45