xref: /freebsd/contrib/llvm-project/llvm/lib/Target/VE/MCTargetDesc/VETargetStreamer.cpp (revision bdd1243df58e60e85101c09001d9812a789b6bc4)
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 Andric VETargetStreamer::VETargetStreamer(MCStreamer &S) : MCTargetStreamer(S) {}
21480093f4SDimitry Andric 
anchor()22480093f4SDimitry Andric void VETargetStreamer::anchor() {}
23480093f4SDimitry Andric 
VETargetAsmStreamer(MCStreamer & S,formatted_raw_ostream & OS)24480093f4SDimitry Andric VETargetAsmStreamer::VETargetAsmStreamer(MCStreamer &S,
25480093f4SDimitry Andric                                          formatted_raw_ostream &OS)
26480093f4SDimitry Andric     : VETargetStreamer(S), OS(OS) {}
27480093f4SDimitry Andric 
emitVERegisterIgnore(unsigned reg)28480093f4SDimitry Andric void 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 Andric void 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 Andric VETargetELFStreamer::VETargetELFStreamer(MCStreamer &S) : VETargetStreamer(S) {}
41480093f4SDimitry Andric 
getStreamer()42480093f4SDimitry Andric MCELFStreamer &VETargetELFStreamer::getStreamer() {
43480093f4SDimitry Andric   return static_cast<MCELFStreamer &>(Streamer);
44480093f4SDimitry Andric }
45