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

Unified Diff: src/a64/simulator-a64.h

Issue 194473005: A64: Rename k<Y>RegSize to k<Y>RegSizeInBits, and k<Y>RegSizeInBytes to k<Y>RegSize. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/a64/regexp-macro-assembler-a64.cc ('k') | src/a64/simulator-a64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/simulator-a64.h
diff --git a/src/a64/simulator-a64.h b/src/a64/simulator-a64.h
index c4f1472bab231bc0b7ab4545a7d40ba45925c476..602d72395b3a2a26598bd655f3cceeeb7c566c9a 100644
--- a/src/a64/simulator-a64.h
+++ b/src/a64/simulator-a64.h
@@ -186,8 +186,8 @@ class SimRegisterBase {
protected:
uint8_t value_[kSizeInBytes];
};
-typedef SimRegisterBase<kXRegSizeInBytes> SimRegister; // r0-r31
-typedef SimRegisterBase<kDRegSizeInBytes> SimFPRegister; // v0-v31
+typedef SimRegisterBase<kXRegSize> SimRegister; // r0-r31
+typedef SimRegisterBase<kDRegSize> SimFPRegister; // v0-v31
class Simulator : public DecoderVisitor {
@@ -358,13 +358,14 @@ class Simulator : public DecoderVisitor {
// Return 'size' bits of the value of an integer register, as the specified
// type. The value is zero-extended to fill the result.
//
- // The only supported values of 'size' are kXRegSize and kWRegSize.
+ // The only supported values of 'size' are kXRegSizeInBits and
+ // kWRegSizeInBits.
template<typename T>
T reg(unsigned size, unsigned code,
Reg31Mode r31mode = Reg31IsZeroRegister) const {
unsigned size_in_bytes = size / 8;
ASSERT(size_in_bytes <= sizeof(T));
- ASSERT((size == kXRegSize) || (size == kWRegSize));
+ ASSERT((size == kXRegSizeInBits) || (size == kWRegSizeInBits));
ASSERT(code < kNumberOfRegisters);
if ((code == 31) && (r31mode == Reg31IsZeroRegister)) {
@@ -400,13 +401,14 @@ class Simulator : public DecoderVisitor {
// Write 'size' bits of 'value' into an integer register. The value is
// zero-extended. This behaviour matches AArch64 register writes.
//
- // The only supported values of 'size' are kXRegSize and kWRegSize.
+ // The only supported values of 'size' are kXRegSizeInBits and
+ // kWRegSizeInBits.
template<typename T>
void set_reg(unsigned size, unsigned code, T value,
Reg31Mode r31mode = Reg31IsZeroRegister) {
unsigned size_in_bytes = size / 8;
ASSERT(size_in_bytes <= sizeof(T));
- ASSERT((size == kXRegSize) || (size == kWRegSize));
+ ASSERT((size == kXRegSizeInBits) || (size == kWRegSizeInBits));
ASSERT(code < kNumberOfRegisters);
if ((code == 31) && (r31mode == Reg31IsZeroRegister)) {
@@ -425,12 +427,12 @@ class Simulator : public DecoderVisitor {
// Common specialized accessors for the set_reg() template.
void set_wreg(unsigned code, int32_t value,
Reg31Mode r31mode = Reg31IsZeroRegister) {
- set_reg(kWRegSize, code, value, r31mode);
+ set_reg(kWRegSizeInBits, code, value, r31mode);
}
void set_xreg(unsigned code, int64_t value,
Reg31Mode r31mode = Reg31IsZeroRegister) {
- set_reg(kXRegSize, code, value, r31mode);
+ set_reg(kXRegSizeInBits, code, value, r31mode);
}
// Commonly-used special cases.
@@ -458,12 +460,13 @@ class Simulator : public DecoderVisitor {
// Return 'size' bits of the value of a floating-point register, as the
// specified type. The value is zero-extended to fill the result.
//
- // The only supported values of 'size' are kDRegSize and kSRegSize.
+ // The only supported values of 'size' are kDRegSizeInBits and
+ // kSRegSizeInBits.
template<typename T>
T fpreg(unsigned size, unsigned code) const {
unsigned size_in_bytes = size / 8;
ASSERT(size_in_bytes <= sizeof(T));
- ASSERT((size == kDRegSize) || (size == kSRegSize));
+ ASSERT((size == kDRegSizeInBits) || (size == kSRegSizeInBits));
ASSERT(code < kNumberOfFPRegisters);
return fpregisters_[code].Get<T>(size_in_bytes);
}
@@ -493,8 +496,8 @@ class Simulator : public DecoderVisitor {
double fpreg(unsigned size, unsigned code) const {
switch (size) {
- case kSRegSize: return sreg(code);
- case kDRegSize: return dreg(code);
+ case kSRegSizeInBits: return sreg(code);
+ case kDRegSizeInBits: return dreg(code);
default:
UNREACHABLE();
return 0.0;
@@ -505,8 +508,7 @@ class Simulator : public DecoderVisitor {
// This behaviour matches AArch64 register writes.
template<typename T>
void set_fpreg(unsigned code, T value) {
- ASSERT((sizeof(value) == kDRegSizeInBytes) ||
- (sizeof(value) == kSRegSizeInBytes));
+ ASSERT((sizeof(value) == kDRegSize) || (sizeof(value) == kSRegSize));
ASSERT(code < kNumberOfFPRegisters);
fpregisters_[code].Set(value, sizeof(value));
}
« no previous file with comments | « src/a64/regexp-macro-assembler-a64.cc ('k') | src/a64/simulator-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698