1//===-- VETargetStreamer.cpp - VE Target Streamer Methods -----------------===//
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 provides VE specific target streamer methods.
10//
11//===----------------------------------------------------------------------===//
12
13#include "VETargetStreamer.h"
14#include "VEInstPrinter.h"
15#include "llvm/MC/MCRegister.h"
16
17using namespace llvm;
18
19// pin vtable to this file
20VETargetStreamer::VETargetStreamer(MCStreamer &S) : MCTargetStreamer(S) {}
21
22void VETargetStreamer::anchor() {}
23
24VETargetAsmStreamer::VETargetAsmStreamer(MCStreamer &S,
25 formatted_raw_ostream &OS)
26 : VETargetStreamer(S), OS(OS) {}
27
28void VETargetAsmStreamer::emitVERegisterIgnore(unsigned reg) {
29 OS << "\t.register "
30 << "%" << StringRef(VEInstPrinter::getRegisterName(Reg: reg)).lower()
31 << ", #ignore\n";
32}
33
34void VETargetAsmStreamer::emitVERegisterScratch(unsigned reg) {
35 OS << "\t.register "
36 << "%" << StringRef(VEInstPrinter::getRegisterName(Reg: reg)).lower()
37 << ", #scratch\n";
38}
39
40VETargetELFStreamer::VETargetELFStreamer(MCStreamer &S) : VETargetStreamer(S) {}
41
42MCELFStreamer &VETargetELFStreamer::getStreamer() {
43 return static_cast<MCELFStreamer &>(Streamer);
44}
45