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

Side by Side Diff: src/arm64/instructions-arm64.h

Issue 222433002: ARM64: Introduce a version of ADR handling distant targets. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix loop offset Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 153 }
154 154
155 #define DEFINE_GETTER(Name, HighBit, LowBit, Func) \ 155 #define DEFINE_GETTER(Name, HighBit, LowBit, Func) \
156 int64_t Name() const { return Func(HighBit, LowBit); } 156 int64_t Name() const { return Func(HighBit, LowBit); }
157 INSTRUCTION_FIELDS_LIST(DEFINE_GETTER) 157 INSTRUCTION_FIELDS_LIST(DEFINE_GETTER)
158 #undef DEFINE_GETTER 158 #undef DEFINE_GETTER
159 159
160 // ImmPCRel is a compound field (not present in INSTRUCTION_FIELDS_LIST), 160 // ImmPCRel is a compound field (not present in INSTRUCTION_FIELDS_LIST),
161 // formed from ImmPCRelLo and ImmPCRelHi. 161 // formed from ImmPCRelLo and ImmPCRelHi.
162 int ImmPCRel() const { 162 int ImmPCRel() const {
163 ASSERT(IsPCRelAddressing());
163 int const offset = ((ImmPCRelHi() << ImmPCRelLo_width) | ImmPCRelLo()); 164 int const offset = ((ImmPCRelHi() << ImmPCRelLo_width) | ImmPCRelLo());
164 int const width = ImmPCRelLo_width + ImmPCRelHi_width; 165 int const width = ImmPCRelLo_width + ImmPCRelHi_width;
165 return signed_bitextract_32(width-1, 0, offset); 166 return signed_bitextract_32(width - 1, 0, offset);
166 } 167 }
167 168
168 uint64_t ImmLogical(); 169 uint64_t ImmLogical();
169 float ImmFP32(); 170 float ImmFP32();
170 double ImmFP64(); 171 double ImmFP64();
171 172
172 LSDataSize SizeLSPair() const { 173 LSDataSize SizeLSPair() const {
173 return CalcLSPairDataSize( 174 return CalcLSPairDataSize(
174 static_cast<LoadStorePairOp>(Mask(LoadStorePairMask))); 175 static_cast<LoadStorePairOp>(Mask(LoadStorePairMask)));
175 } 176 }
(...skipping 20 matching lines...) Expand all
196 } 197 }
197 198
198 bool IsLdrLiteralX() const { 199 bool IsLdrLiteralX() const {
199 return Mask(LoadLiteralMask) == LDR_x_lit; 200 return Mask(LoadLiteralMask) == LDR_x_lit;
200 } 201 }
201 202
202 bool IsPCRelAddressing() const { 203 bool IsPCRelAddressing() const {
203 return Mask(PCRelAddressingFMask) == PCRelAddressingFixed; 204 return Mask(PCRelAddressingFMask) == PCRelAddressingFixed;
204 } 205 }
205 206
207 bool IsAdr() const {
208 return Mask(PCRelAddressingMask) == ADR;
209 }
210
206 bool IsLogicalImmediate() const { 211 bool IsLogicalImmediate() const {
207 return Mask(LogicalImmediateFMask) == LogicalImmediateFixed; 212 return Mask(LogicalImmediateFMask) == LogicalImmediateFixed;
208 } 213 }
209 214
210 bool IsAddSubImmediate() const { 215 bool IsAddSubImmediate() const {
211 return Mask(AddSubImmediateFMask) == AddSubImmediateFixed; 216 return Mask(AddSubImmediateFMask) == AddSubImmediateFixed;
212 } 217 }
213 218
219 bool IsAddSubShifted() const {
220 return Mask(AddSubShiftedFMask) == AddSubShiftedFixed;
221 }
222
214 bool IsAddSubExtended() const { 223 bool IsAddSubExtended() const {
215 return Mask(AddSubExtendedFMask) == AddSubExtendedFixed; 224 return Mask(AddSubExtendedFMask) == AddSubExtendedFixed;
216 } 225 }
217 226
218 // Match any loads or stores, including pairs. 227 // Match any loads or stores, including pairs.
219 bool IsLoadOrStore() const { 228 bool IsLoadOrStore() const {
220 return Mask(LoadStoreAnyFMask) == LoadStoreAnyFixed; 229 return Mask(LoadStoreAnyFMask) == LoadStoreAnyFixed;
221 } 230 }
222 231
223 // Match any loads, including pairs. 232 // Match any loads, including pairs.
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 389
381 template<typename T> V8_INLINE static Instruction* Cast(T src) { 390 template<typename T> V8_INLINE static Instruction* Cast(T src) {
382 return reinterpret_cast<Instruction*>(src); 391 return reinterpret_cast<Instruction*>(src);
383 } 392 }
384 393
385 V8_INLINE ptrdiff_t DistanceTo(Instruction* target) { 394 V8_INLINE ptrdiff_t DistanceTo(Instruction* target) {
386 return reinterpret_cast<Address>(target) - reinterpret_cast<Address>(this); 395 return reinterpret_cast<Address>(target) - reinterpret_cast<Address>(this);
387 } 396 }
388 397
389 398
399 static const int ImmPCRelRangeBitwidth = 21;
400 static bool IsValidPCRelOffset(int offset) {
401 return is_int21(offset);
402 }
390 void SetPCRelImmTarget(Instruction* target); 403 void SetPCRelImmTarget(Instruction* target);
391 void SetBranchImmTarget(Instruction* target); 404 void SetBranchImmTarget(Instruction* target);
392 }; 405 };
393 406
394 407
395 // Where Instruction looks at instructions generated by the Assembler, 408 // Where Instruction looks at instructions generated by the Assembler,
396 // InstructionSequence looks at instructions sequences generated by the 409 // InstructionSequence looks at instructions sequences generated by the
397 // MacroAssembler. 410 // MacroAssembler.
398 class InstructionSequence : public Instruction { 411 class InstructionSequence : public Instruction {
399 public: 412 public:
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 TRACE_ENABLE = 1 << 6, 505 TRACE_ENABLE = 1 << 6,
493 TRACE_DISABLE = 2 << 6, 506 TRACE_DISABLE = 2 << 6,
494 TRACE_OVERRIDE = 3 << 6 507 TRACE_OVERRIDE = 3 << 6
495 }; 508 };
496 509
497 510
498 } } // namespace v8::internal 511 } } // namespace v8::internal
499 512
500 513
501 #endif // V8_ARM64_INSTRUCTIONS_ARM64_H_ 514 #endif // V8_ARM64_INSTRUCTIONS_ARM64_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698