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

Side by Side Diff: src/IceAssemblerX8632.h

Issue 1211863004: Enables llvm dyn_cast for Assemblers. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: 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
OLDNEW
1 //===- subzero/src/assembler_ia32.h - Assembler for x86-32 ------*- C++ -*-===// 1 //===- subzero/src/assembler_ia32.h - Assembler for x86-32 ------*- 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 //
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 intptr_t unresolved_near_positions_[kMaxUnresolvedBranches]; 330 intptr_t unresolved_near_positions_[kMaxUnresolvedBranches];
331 331
332 friend class AssemblerX8632; 332 friend class AssemblerX8632;
333 }; 333 };
334 334
335 class AssemblerX8632 : public Assembler { 335 class AssemblerX8632 : public Assembler {
336 AssemblerX8632(const AssemblerX8632 &) = delete; 336 AssemblerX8632(const AssemblerX8632 &) = delete;
337 AssemblerX8632 &operator=(const AssemblerX8632 &) = delete; 337 AssemblerX8632 &operator=(const AssemblerX8632 &) = delete;
338 338
339 public: 339 public:
340 explicit AssemblerX8632(bool use_far_branches = false) : Assembler() { 340 explicit AssemblerX8632(bool use_far_branches = false)
341 : Assembler(Asm_X8632) {
341 // This mode is only needed and implemented for MIPS and ARM. 342 // This mode is only needed and implemented for MIPS and ARM.
342 assert(!use_far_branches); 343 assert(!use_far_branches);
343 (void)use_far_branches; 344 (void)use_far_branches;
344 } 345 }
345 ~AssemblerX8632() override; 346 ~AssemblerX8632() override;
346 347
347 static const bool kNearJump = true; 348 static const bool kNearJump = true;
348 static const bool kFarJump = false; 349 static const bool kFarJump = false;
349 350
350 void alignFunction() override; 351 void alignFunction() override;
(...skipping 19 matching lines...) Expand all
370 Label *GetOrCreateCfgNodeLabel(SizeT NodeNumber); 371 Label *GetOrCreateCfgNodeLabel(SizeT NodeNumber);
371 void bindCfgNodeLabel(SizeT NodeNumber) override; 372 void bindCfgNodeLabel(SizeT NodeNumber) override;
372 Label *GetOrCreateLocalLabel(SizeT Number); 373 Label *GetOrCreateLocalLabel(SizeT Number);
373 void BindLocalLabel(SizeT Number); 374 void BindLocalLabel(SizeT Number);
374 375
375 bool fixupIsPCRel(FixupKind Kind) const override { 376 bool fixupIsPCRel(FixupKind Kind) const override {
376 // Currently assuming this is the only PC-rel relocation type used. 377 // Currently assuming this is the only PC-rel relocation type used.
377 return Kind == llvm::ELF::R_386_PC32; 378 return Kind == llvm::ELF::R_386_PC32;
378 } 379 }
379 380
381 static bool classof(const Assembler *Asm) {
382 return Asm->getKind() == Asm_X8632;
383 }
384
380 // Operations to emit GPR instructions (and dispatch on operand type). 385 // Operations to emit GPR instructions (and dispatch on operand type).
381 typedef void (AssemblerX8632::*TypedEmitGPR)(Type, GPRRegister); 386 typedef void (AssemblerX8632::*TypedEmitGPR)(Type, GPRRegister);
382 typedef void (AssemblerX8632::*TypedEmitAddr)(Type, const Address &); 387 typedef void (AssemblerX8632::*TypedEmitAddr)(Type, const Address &);
383 struct GPREmitterOneOp { 388 struct GPREmitterOneOp {
384 TypedEmitGPR Reg; 389 TypedEmitGPR Reg;
385 TypedEmitAddr Addr; 390 TypedEmitAddr Addr;
386 }; 391 };
387 392
388 typedef void (AssemblerX8632::*TypedEmitGPRGPR)(Type, GPRRegister, 393 typedef void (AssemblerX8632::*TypedEmitGPRGPR)(Type, GPRRegister,
389 GPRRegister); 394 GPRRegister);
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 inline void AssemblerX8632::emitFixup(AssemblerFixup *fixup) { 920 inline void AssemblerX8632::emitFixup(AssemblerFixup *fixup) {
916 Buffer.emitFixup(fixup); 921 Buffer.emitFixup(fixup);
917 } 922 }
918 923
919 inline void AssemblerX8632::emitOperandSizeOverride() { emitUint8(0x66); } 924 inline void AssemblerX8632::emitOperandSizeOverride() { emitUint8(0x66); }
920 925
921 } // end of namespace X8632 926 } // end of namespace X8632
922 } // end of namespace Ice 927 } // end of namespace Ice
923 928
924 #endif // SUBZERO_SRC_ICEASSEMBLERX8632_H 929 #endif // SUBZERO_SRC_ICEASSEMBLERX8632_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698