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

Side by Side Diff: src/IceAssemblerARM32.cpp

Issue 1674033002: Subzero: Clean up some uses of *_cast<>. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Cleanup of llvm::cast<> style operations Created 4 years, 10 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 | « no previous file | src/IceCfg.cpp » ('j') | src/IceInstARM32.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- C++ -*-===// 1 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- 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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 if (!L) { 699 if (!L) {
700 L = new (this->allocate<Label>()) Label(); 700 L = new (this->allocate<Label>()) Label();
701 Labels[Number] = L; 701 Labels[Number] = L;
702 } 702 }
703 return L; 703 return L;
704 } 704 }
705 705
706 // Pull out offset from branch Inst. 706 // Pull out offset from branch Inst.
707 IOffsetT AssemblerARM32::decodeBranchOffset(IValueT Inst) { 707 IOffsetT AssemblerARM32::decodeBranchOffset(IValueT Inst) {
708 // Sign-extend, left-shift by 2, and adjust to the way ARM CPUs read PC. 708 // Sign-extend, left-shift by 2, and adjust to the way ARM CPUs read PC.
709 IOffsetT Offset = static_cast<IOffsetT>((Inst & kBranchOffsetMask) << 8); 709 auto Offset = static_cast<IOffsetT>((Inst & kBranchOffsetMask) << 8);
John 2016/02/07 16:18:32 I'd prefer IOffsetT Offset = ...;
Jim Stichnoth 2016/02/07 16:42:42 You mean the original way? I'm curious why, since
John 2016/02/07 16:59:43 I meant const IOffsetT Offset = (Inst & kBranchOf
Jim Stichnoth 2016/02/07 17:44:41 Done.
710 return (Offset >> 6) + kPCReadOffset; 710 return (Offset >> 6) + kPCReadOffset;
711 } 711 }
712 712
713 void AssemblerARM32::bind(Label *L) { 713 void AssemblerARM32::bind(Label *L) {
714 IOffsetT BoundPc = Buffer.size(); 714 IOffsetT BoundPc = Buffer.size();
715 assert(!L->isBound()); // Labels can only be bound once. 715 assert(!L->isBound()); // Labels can only be bound once.
716 while (L->isLinked()) { 716 while (L->isLinked()) {
717 IOffsetT Position = L->getLinkPosition(); 717 IOffsetT Position = L->getLinkPosition();
718 IOffsetT Dest = BoundPc - Position; 718 IOffsetT Dest = BoundPc - Position;
719 IValueT Inst = Buffer.load<IValueT>(Position); 719 IValueT Inst = Buffer.load<IValueT>(Position);
(...skipping 2331 matching lines...) Expand 10 before | Expand all | Expand 10 after
3051 constexpr const char *Vsqrts = "vsqrts"; 3051 constexpr const char *Vsqrts = "vsqrts";
3052 IValueT Sd = encodeSRegister(OpSd, "Sd", Vsqrts); 3052 IValueT Sd = encodeSRegister(OpSd, "Sd", Vsqrts);
3053 IValueT Sm = encodeSRegister(OpSm, "Sm", Vsqrts); 3053 IValueT Sm = encodeSRegister(OpSm, "Sm", Vsqrts);
3054 constexpr IValueT VsqrtsOpcode = B23 | B21 | B20 | B16 | B7 | B6; 3054 constexpr IValueT VsqrtsOpcode = B23 | B21 | B20 | B16 | B7 | B6;
3055 constexpr IValueT S0 = 0; 3055 constexpr IValueT S0 = 0;
3056 emitVFPsss(Cond, VsqrtsOpcode, Sd, S0, Sm); 3056 emitVFPsss(Cond, VsqrtsOpcode, Sd, S0, Sm);
3057 } 3057 }
3058 3058
3059 } // end of namespace ARM32 3059 } // end of namespace ARM32
3060 } // end of namespace Ice 3060 } // end of namespace Ice
OLDNEW
« no previous file with comments | « no previous file | src/IceCfg.cpp » ('j') | src/IceInstARM32.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698