Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: src/assembler_mips32.h

Issue 1159823004: First patch for Mips subzero compiler (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Changes to address comments on patch 2 Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceTypes.def ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/assembler_arm32.h - Assembler for ARM32 ------*- C++ -*-===// 1 //===- subzero/src/assembler_mips.h - Assembler for MIPS --------*- C++ -*-===//
2 // 2 //
3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 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 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. 5 // BSD-style license that can be found in the LICENSE file.
6 // 6 //
7 // Modified by the Subzero authors. 7 // Modified by the Subzero authors.
8 // 8 //
9 //===----------------------------------------------------------------------===// 9 //===----------------------------------------------------------------------===//
10 // 10 //
11 // The Subzero Code Generator 11 // The Subzero Code Generator
12 // 12 //
13 // This file is distributed under the University of Illinois Open Source 13 // This file is distributed under the University of Illinois Open Source
14 // License. See LICENSE.TXT for details. 14 // License. See LICENSE.TXT for details.
15 // 15 //
16 //===----------------------------------------------------------------------===// 16 //===----------------------------------------------------------------------===//
17 // 17 //
18 // This file implements the Assembler class for ARM32. 18 // This file implements the Assembler class for MIPS32.
19 // 19 //
20 //===----------------------------------------------------------------------===// 20 //===----------------------------------------------------------------------===//
21 21
22 #ifndef SUBZERO_SRC_ASSEMBLER_ARM32_H 22 #ifndef SUBZERO_SRC_ASSEMBLER_MIPS32_H
23 #define SUBZERO_SRC_ASSEMBLER_ARM32_H 23 #define SUBZERO_SRC_ASSEMBLER_MIPS32_H
24 24
25 #include "IceDefs.h" 25 #include "IceDefs.h"
26 #include "IceFixups.h" 26 #include "IceFixups.h"
27 27
28 #include "assembler.h" 28 #include "assembler.h"
29 29
30 namespace Ice { 30 namespace Ice {
31 namespace ARM32 { 31 namespace MIPS32 {
32 32
33 class AssemblerARM32 : public Assembler { 33 class AssemblerMIPS32 : public Assembler {
34 AssemblerARM32(const AssemblerARM32 &) = delete; 34 AssemblerMIPS32(const AssemblerMIPS32 &) = delete;
35 AssemblerARM32 &operator=(const AssemblerARM32 &) = delete; 35 AssemblerMIPS32 &operator=(const AssemblerMIPS32 &) = delete;
36 36
37 public: 37 public:
38 explicit AssemblerARM32(bool use_far_branches = false) : Assembler() { 38 explicit AssemblerMIPS32(bool use_far_branches = false) : Assembler() {
39 // This mode is only needed and implemented for MIPS and ARM. 39 // This mode is only needed and implemented for MIPS32 and ARM.
40 assert(!use_far_branches); 40 assert(!use_far_branches);
41 (void)use_far_branches; 41 (void)use_far_branches;
42 } 42 }
43 ~AssemblerARM32() override = default; 43 ~AssemblerMIPS32() override = default;
44 44
45 void alignFunction() override { llvm_unreachable("Not yet implemented."); } 45 void alignFunction() override {
46 llvm::report_fatal_error("Not yet implemented.");
47 }
46 48
47 SizeT getBundleAlignLog2Bytes() const override { return 4; } 49 SizeT getBundleAlignLog2Bytes() const override { return 4; }
48 50
49 const char *getNonExecPadDirective() const override { return ".p2alignl"; } 51 const char *getNonExecPadDirective() const override { return ".TBD"; }
50 52
51 llvm::ArrayRef<uint8_t> getNonExecBundlePadding() const override { 53 llvm::ArrayRef<uint8_t> getNonExecBundlePadding() const override {
52 // Use a particular UDF encoding -- TRAPNaCl in LLVM: 0xE7FEDEF0 54 llvm::report_fatal_error("Not yet implemented.");
53 // http://llvm.org/viewvc/llvm-project?view=revision&revision=173943
54 static const uint8_t Padding[] = {0xE7, 0xFE, 0xDE, 0xF0};
55 return llvm::ArrayRef<uint8_t>(Padding, 4);
56 } 55 }
57 56
58 void padWithNop(intptr_t Padding) override { 57 void padWithNop(intptr_t Padding) override {
59 (void)Padding; 58 (void)Padding;
60 llvm_unreachable("Not yet implemented."); 59 llvm::report_fatal_error("Not yet implemented.");
61 } 60 }
62 61
63 void BindCfgNodeLabel(SizeT NodeNumber) override { 62 void BindCfgNodeLabel(SizeT NodeNumber) override {
64 (void)NodeNumber; 63 (void)NodeNumber;
65 llvm_unreachable("Not yet implemented."); 64 llvm::report_fatal_error("Not yet implemented.");
66 } 65 }
67 66
68 bool fixupIsPCRel(FixupKind Kind) const override { 67 bool fixupIsPCRel(FixupKind Kind) const override {
69 (void)Kind; 68 (void)Kind;
70 llvm_unreachable("Not yet implemented."); 69 llvm::report_fatal_error("Not yet implemented.");
71 } 70 }
72 }; 71 };
73 72
74 } // end of namespace ARM32 73 } // end of namespace MIPS32
75 } // end of namespace Ice 74 } // end of namespace Ice
76 75
77 #endif // SUBZERO_SRC_ASSEMBLER_ARM32_H 76 #endif // SUBZERO_SRC_ASSEMBLER_MIPS32_H
OLDNEW
« no previous file with comments | « src/IceTypes.def ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698