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

Unified Diff: src/arm/constants-arm.h

Issue 3107027: Fix incorrect encoding of single and double precision registers for some... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 4 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/arm/assembler-arm.cc ('k') | src/arm/disasm-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/constants-arm.h
===================================================================
--- src/arm/constants-arm.h (revision 5347)
+++ src/arm/constants-arm.h (working copy)
@@ -194,6 +194,13 @@
};
+// Type of VFP register. Determines register encoding.
+enum VFPRegPrecision {
+ kSinglePrecision = 0,
+ kDoublePrecision = 1
+};
+
+
typedef int32_t instr_t;
@@ -269,6 +276,15 @@
inline int VCField() const { return Bit(8); }
inline int VAField() const { return Bits(23, 21); }
inline int VBField() const { return Bits(6, 5); }
+ inline int VFPNRegCode(VFPRegPrecision pre) {
+ return VFPGlueRegCode(pre, 16, 7);
+ }
+ inline int VFPMRegCode(VFPRegPrecision pre) {
+ return VFPGlueRegCode(pre, 0, 5);
+ }
+ inline int VFPDRegCode(VFPRegPrecision pre) {
+ return VFPGlueRegCode(pre, 12, 22);
+ }
// Fields used in Data processing instructions
inline Opcode OpcodeField() const {
@@ -343,6 +359,17 @@
static Instr* At(byte* pc) { return reinterpret_cast<Instr*>(pc); }
private:
+ // Join split register codes, depending on single or double precision.
+ // four_bit is the position of the least-significant bit of the four
+ // bit specifier. one_bit is the position of the additional single bit
+ // specifier.
+ inline int VFPGlueRegCode(VFPRegPrecision pre, int four_bit, int one_bit) {
+ if (pre == kSinglePrecision) {
+ return (Bits(four_bit + 3, four_bit) << 1) | Bit(one_bit);
+ }
+ return (Bit(one_bit) << 4) | Bits(four_bit + 3, four_bit);
+ }
+
// We need to prevent the creation of instances of class Instr.
DISALLOW_IMPLICIT_CONSTRUCTORS(Instr);
};
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | src/arm/disasm-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698