-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SystemZ][z/OS] Initial code to generate assembly files on z/OS
- This patch consists of the bare basic code needed in order to generate some assembly for the z/OS target. - Only the .text and the .bss sections are added for now. - The relevant MCSectionGOFF/Symbol interfaces have been added. This enables us to print out the GOFF machine code sections. - This patch enables us to add simple lit tests wherever possible, and contribute to the testing coverage for the z/OS target - Further improvements and additions will be made in future patches. Reviewed By: tmatheson Differential Revision: https://reviews.llvm.org/D106380
- Loading branch information
Showing
14 changed files
with
176 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
//===-- llvm/MC/MCSectionGOFF.h - GOFF Machine Code Sections ----*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
/// | ||
/// \file | ||
/// This file declares the MCSectionGOFF class, which contains all of the | ||
/// necessary machine code sections for the GOFF file format. | ||
/// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef LLVM_MC_MCSECTIONGOFF_H | ||
#define LLVM_MC_MCSECTIONGOFF_H | ||
|
||
#include "llvm/MC/MCSection.h" | ||
#include "llvm/Support/raw_ostream.h" | ||
|
||
namespace llvm { | ||
|
||
class MCExpr; | ||
|
||
class MCSectionGOFF final : public MCSection { | ||
private: | ||
friend class MCContext; | ||
MCSectionGOFF(StringRef Name, SectionKind K) | ||
: MCSection(SV_GOFF, Name, K, nullptr) {} | ||
|
||
public: | ||
void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T, | ||
raw_ostream &OS, | ||
const MCExpr *Subsection) const override { | ||
OS << "\t.section\t\"" << getName() << "\"\n"; | ||
} | ||
|
||
bool UseCodeAlign() const override { return false; } | ||
|
||
bool isVirtualSection() const override { return false; } | ||
|
||
static bool classof(const MCSection *S) { return S->getVariant() == SV_GOFF; } | ||
}; | ||
} // end namespace llvm | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//===-- llvm/MC/MCSymbolGOFF.h - GOFF Machine Code Symbols ------*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
/// | ||
/// \file | ||
/// This file contains the MCSymbolGOFF class | ||
/// | ||
//===----------------------------------------------------------------------===// | ||
#ifndef LLVM_MC_MCSYMBOLGOFF_H | ||
#define LLVM_MC_MCSYMBOLGOFF_H | ||
|
||
#include "llvm/MC/MCSymbol.h" | ||
|
||
namespace llvm { | ||
|
||
class MCSymbolGOFF : public MCSymbol { | ||
public: | ||
MCSymbolGOFF(const StringMapEntry<bool> *Name, bool IsTemporary) | ||
: MCSymbol(SymbolKindGOFF, Name, IsTemporary) {} | ||
static bool classof(const MCSymbol *S) { return S->isGOFF(); } | ||
}; | ||
} // end namespace llvm | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
; A simple, barebones test to check whether assembly can be emitted | ||
; for the z/OS target | ||
; RUN: llc < %s -mtriple=s390x-ibm-zos | FileCheck %s | ||
|
||
@a = global i32 0, align 4 | ||
|
||
define signext i32 @main() { | ||
; CHECK: .section ".text" | ||
; CHECK: main: | ||
; CHECK: .section "a" | ||
entry: | ||
ret i32 0 | ||
} |