blob: 2a42826df60df8a77d83bd45db72a1202445e95e [file] [log] [blame]
John Portoaff4ccf2015-06-10 16:35:06 -07001//===- subzero/src/IceAssemblerARM32.h - Assembler for ARM32 ----*- C++ -*-===//
Jan Voungb36ad9b2015-04-21 17:01:49 -07002//
3// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
4// for details. All rights reserved. Use of this source code is governed by a
5// BSD-style license that can be found in the LICENSE file.
6//
7// Modified by the Subzero authors.
8//
9//===----------------------------------------------------------------------===//
10//
11// The Subzero Code Generator
12//
13// This file is distributed under the University of Illinois Open Source
14// License. See LICENSE.TXT for details.
15//
16//===----------------------------------------------------------------------===//
Andrew Scull9612d322015-07-06 14:53:25 -070017///
18/// \file
19/// This file implements the Assembler class for ARM32.
20///
Jan Voungb36ad9b2015-04-21 17:01:49 -070021//===----------------------------------------------------------------------===//
22
John Portoaff4ccf2015-06-10 16:35:06 -070023#ifndef SUBZERO_SRC_ICEASSEMBLERARM32_H
24#define SUBZERO_SRC_ICEASSEMBLERARM32_H
Jan Voungb36ad9b2015-04-21 17:01:49 -070025
John Portoaff4ccf2015-06-10 16:35:06 -070026#include "IceAssembler.h"
Jan Voungb36ad9b2015-04-21 17:01:49 -070027#include "IceDefs.h"
28#include "IceFixups.h"
29
Jan Voungb36ad9b2015-04-21 17:01:49 -070030namespace Ice {
Jan Voung90ccc3f2015-04-30 14:15:10 -070031namespace ARM32 {
Jan Voungb36ad9b2015-04-21 17:01:49 -070032
33class AssemblerARM32 : public Assembler {
34 AssemblerARM32(const AssemblerARM32 &) = delete;
35 AssemblerARM32 &operator=(const AssemblerARM32 &) = delete;
36
37public:
John Porto2da710c2015-06-29 07:57:02 -070038 explicit AssemblerARM32(bool use_far_branches = false)
39 : Assembler(Asm_ARM32) {
Jan Voungb36ad9b2015-04-21 17:01:49 -070040 // This mode is only needed and implemented for MIPS and ARM.
41 assert(!use_far_branches);
42 (void)use_far_branches;
43 }
44 ~AssemblerARM32() override = default;
45
Jan Voungb2d50842015-05-12 09:53:50 -070046 void alignFunction() override { llvm_unreachable("Not yet implemented."); }
Jan Voungb36ad9b2015-04-21 17:01:49 -070047
48 SizeT getBundleAlignLog2Bytes() const override { return 4; }
49
Andrew Scull86df4e92015-07-30 13:54:44 -070050 const char *getAlignDirective() const override { return ".p2alignl"; }
Jan Voungb2d50842015-05-12 09:53:50 -070051
Jan Voungb36ad9b2015-04-21 17:01:49 -070052 llvm::ArrayRef<uint8_t> getNonExecBundlePadding() const override {
Jan Voungb2d50842015-05-12 09:53:50 -070053 // Use a particular UDF encoding -- TRAPNaCl in LLVM: 0xE7FEDEF0
54 // http://llvm.org/viewvc/llvm-project?view=revision&revision=173943
55 static const uint8_t Padding[] = {0xE7, 0xFE, 0xDE, 0xF0};
56 return llvm::ArrayRef<uint8_t>(Padding, 4);
Jan Voungb36ad9b2015-04-21 17:01:49 -070057 }
58
59 void padWithNop(intptr_t Padding) override {
60 (void)Padding;
Jan Voungb2d50842015-05-12 09:53:50 -070061 llvm_unreachable("Not yet implemented.");
Jan Voungb36ad9b2015-04-21 17:01:49 -070062 }
63
Jan Voungc2ec5812015-08-05 09:35:18 -070064 Ice::Label *getCfgNodeLabel(SizeT NodeNumber) override {
Andrew Scull86df4e92015-07-30 13:54:44 -070065 (void)NodeNumber;
66 llvm_unreachable("Not yet implemented.");
67 }
68
John Portoaff4ccf2015-06-10 16:35:06 -070069 void bindCfgNodeLabel(SizeT NodeNumber) override {
Jan Voungb36ad9b2015-04-21 17:01:49 -070070 (void)NodeNumber;
Jan Voungb2d50842015-05-12 09:53:50 -070071 llvm_unreachable("Not yet implemented.");
Jan Voungb36ad9b2015-04-21 17:01:49 -070072 }
73
74 bool fixupIsPCRel(FixupKind Kind) const override {
75 (void)Kind;
Jan Voungb2d50842015-05-12 09:53:50 -070076 llvm_unreachable("Not yet implemented.");
Jan Voungb36ad9b2015-04-21 17:01:49 -070077 }
John Porto2da710c2015-06-29 07:57:02 -070078
79 static bool classof(const Assembler *Asm) {
80 return Asm->getKind() == Asm_ARM32;
81 }
Jan Voungb36ad9b2015-04-21 17:01:49 -070082};
83
Jan Voung90ccc3f2015-04-30 14:15:10 -070084} // end of namespace ARM32
Jan Voungb36ad9b2015-04-21 17:01:49 -070085} // end of namespace Ice
86
John Portoaff4ccf2015-06-10 16:35:06 -070087#endif // SUBZERO_SRC_ICEASSEMBLERARM32_H