John Porto | aff4ccf | 2015-06-10 16:35:06 -0700 | [diff] [blame] | 1 | //===- subzero/src/IceAssemblerARM32.h - Assembler for ARM32 ----*- C++ -*-===// |
Jan Voung | b36ad9b | 2015-04-21 17:01:49 -0700 | [diff] [blame] | 2 | // |
| 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 Porto | aff4ccf | 2015-06-10 16:35:06 -0700 | [diff] [blame] | 22 | #ifndef SUBZERO_SRC_ICEASSEMBLERARM32_H |
| 23 | #define SUBZERO_SRC_ICEASSEMBLERARM32_H |
Jan Voung | b36ad9b | 2015-04-21 17:01:49 -0700 | [diff] [blame] | 24 | |
John Porto | aff4ccf | 2015-06-10 16:35:06 -0700 | [diff] [blame] | 25 | #include "IceAssembler.h" |
Jan Voung | b36ad9b | 2015-04-21 17:01:49 -0700 | [diff] [blame] | 26 | #include "IceDefs.h" |
| 27 | #include "IceFixups.h" |
| 28 | |
Jan Voung | b36ad9b | 2015-04-21 17:01:49 -0700 | [diff] [blame] | 29 | namespace Ice { |
Jan Voung | 90ccc3f | 2015-04-30 14:15:10 -0700 | [diff] [blame] | 30 | namespace ARM32 { |
Jan Voung | b36ad9b | 2015-04-21 17:01:49 -0700 | [diff] [blame] | 31 | |
| 32 | class AssemblerARM32 : public Assembler { |
| 33 | AssemblerARM32(const AssemblerARM32 &) = delete; |
| 34 | AssemblerARM32 &operator=(const AssemblerARM32 &) = delete; |
| 35 | |
| 36 | public: |
| 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 Voung | b2d5084 | 2015-05-12 09:53:50 -0700 | [diff] [blame] | 44 | void alignFunction() override { llvm_unreachable("Not yet implemented."); } |
Jan Voung | b36ad9b | 2015-04-21 17:01:49 -0700 | [diff] [blame] | 45 | |
| 46 | SizeT getBundleAlignLog2Bytes() const override { return 4; } |
| 47 | |
Jan Voung | b2d5084 | 2015-05-12 09:53:50 -0700 | [diff] [blame] | 48 | const char *getNonExecPadDirective() const override { return ".p2alignl"; } |
| 49 | |
Jan Voung | b36ad9b | 2015-04-21 17:01:49 -0700 | [diff] [blame] | 50 | llvm::ArrayRef<uint8_t> getNonExecBundlePadding() const override { |
Jan Voung | b2d5084 | 2015-05-12 09:53:50 -0700 | [diff] [blame] | 51 | // 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 Voung | b36ad9b | 2015-04-21 17:01:49 -0700 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | void padWithNop(intptr_t Padding) override { |
| 58 | (void)Padding; |
Jan Voung | b2d5084 | 2015-05-12 09:53:50 -0700 | [diff] [blame] | 59 | llvm_unreachable("Not yet implemented."); |
Jan Voung | b36ad9b | 2015-04-21 17:01:49 -0700 | [diff] [blame] | 60 | } |
| 61 | |
John Porto | aff4ccf | 2015-06-10 16:35:06 -0700 | [diff] [blame] | 62 | void bindCfgNodeLabel(SizeT NodeNumber) override { |
Jan Voung | b36ad9b | 2015-04-21 17:01:49 -0700 | [diff] [blame] | 63 | (void)NodeNumber; |
Jan Voung | b2d5084 | 2015-05-12 09:53:50 -0700 | [diff] [blame] | 64 | llvm_unreachable("Not yet implemented."); |
Jan Voung | b36ad9b | 2015-04-21 17:01:49 -0700 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | bool fixupIsPCRel(FixupKind Kind) const override { |
| 68 | (void)Kind; |
Jan Voung | b2d5084 | 2015-05-12 09:53:50 -0700 | [diff] [blame] | 69 | llvm_unreachable("Not yet implemented."); |
Jan Voung | b36ad9b | 2015-04-21 17:01:49 -0700 | [diff] [blame] | 70 | } |
| 71 | }; |
| 72 | |
Jan Voung | 90ccc3f | 2015-04-30 14:15:10 -0700 | [diff] [blame] | 73 | } // end of namespace ARM32 |
Jan Voung | b36ad9b | 2015-04-21 17:01:49 -0700 | [diff] [blame] | 74 | } // end of namespace Ice |
| 75 | |
John Porto | aff4ccf | 2015-06-10 16:35:06 -0700 | [diff] [blame] | 76 | #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H |