blob: a0322041ba60d0ea418acc5db78a7702fd1a1a85 [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//===----------------------------------------------------------------------===//
17//
18// This file implements the Assembler class for ARM32.
19//
20//===----------------------------------------------------------------------===//
21
John Portoaff4ccf2015-06-10 16:35:06 -070022#ifndef SUBZERO_SRC_ICEASSEMBLERARM32_H
23#define SUBZERO_SRC_ICEASSEMBLERARM32_H
Jan Voungb36ad9b2015-04-21 17:01:49 -070024
John Portoaff4ccf2015-06-10 16:35:06 -070025#include "IceAssembler.h"
Jan Voungb36ad9b2015-04-21 17:01:49 -070026#include "IceDefs.h"
27#include "IceFixups.h"
28
Jan Voungb36ad9b2015-04-21 17:01:49 -070029namespace Ice {
Jan Voung90ccc3f2015-04-30 14:15:10 -070030namespace ARM32 {
Jan Voungb36ad9b2015-04-21 17:01:49 -070031
32class AssemblerARM32 : public Assembler {
33 AssemblerARM32(const AssemblerARM32 &) = delete;
34 AssemblerARM32 &operator=(const AssemblerARM32 &) = delete;
35
36public:
37 explicit AssemblerARM32(bool use_far_branches = false) : Assembler() {
38 // This mode is only needed and implemented for MIPS and ARM.
39 assert(!use_far_branches);
40 (void)use_far_branches;
41 }
42 ~AssemblerARM32() override = default;
43
Jan Voungb2d50842015-05-12 09:53:50 -070044 void alignFunction() override { llvm_unreachable("Not yet implemented."); }
Jan Voungb36ad9b2015-04-21 17:01:49 -070045
46 SizeT getBundleAlignLog2Bytes() const override { return 4; }
47
Jan Voungb2d50842015-05-12 09:53:50 -070048 const char *getNonExecPadDirective() const override { return ".p2alignl"; }
49
Jan Voungb36ad9b2015-04-21 17:01:49 -070050 llvm::ArrayRef<uint8_t> getNonExecBundlePadding() const override {
Jan Voungb2d50842015-05-12 09:53:50 -070051 // Use a particular UDF encoding -- TRAPNaCl in LLVM: 0xE7FEDEF0
52 // http://llvm.org/viewvc/llvm-project?view=revision&revision=173943
53 static const uint8_t Padding[] = {0xE7, 0xFE, 0xDE, 0xF0};
54 return llvm::ArrayRef<uint8_t>(Padding, 4);
Jan Voungb36ad9b2015-04-21 17:01:49 -070055 }
56
57 void padWithNop(intptr_t Padding) override {
58 (void)Padding;
Jan Voungb2d50842015-05-12 09:53:50 -070059 llvm_unreachable("Not yet implemented.");
Jan Voungb36ad9b2015-04-21 17:01:49 -070060 }
61
John Portoaff4ccf2015-06-10 16:35:06 -070062 void bindCfgNodeLabel(SizeT NodeNumber) override {
Jan Voungb36ad9b2015-04-21 17:01:49 -070063 (void)NodeNumber;
Jan Voungb2d50842015-05-12 09:53:50 -070064 llvm_unreachable("Not yet implemented.");
Jan Voungb36ad9b2015-04-21 17:01:49 -070065 }
66
67 bool fixupIsPCRel(FixupKind Kind) const override {
68 (void)Kind;
Jan Voungb2d50842015-05-12 09:53:50 -070069 llvm_unreachable("Not yet implemented.");
Jan Voungb36ad9b2015-04-21 17:01:49 -070070 }
71};
72
Jan Voung90ccc3f2015-04-30 14:15:10 -070073} // end of namespace ARM32
Jan Voungb36ad9b2015-04-21 17:01:49 -070074} // end of namespace Ice
75
John Portoaff4ccf2015-06-10 16:35:06 -070076#endif // SUBZERO_SRC_ICEASSEMBLERARM32_H