diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-10-06 09:12:41 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-10-07 20:19:47 +0100 |
commit | 7fb49da8ec62e8a10ed9419ade9f32c6b1174687 (patch) | |
tree | 8b1bec67452b84809cecd5645543e1f885ccbd44 /compiler/optimizing/code_generator_x86_64.h | |
parent | 4a1b4679cda2f0d2893b8e3f910c21231849291c (diff) | |
download | art-7fb49da8ec62e8a10ed9419ade9f32c6b1174687.tar.gz art-7fb49da8ec62e8a10ed9419ade9f32c6b1174687.tar.bz2 art-7fb49da8ec62e8a10ed9419ade9f32c6b1174687.zip |
Add support for floats and doubles.
- Follows Quick conventions.
- Currently only works with baseline register allocator.
Change-Id: Ie4b8e298f4f5e1cd82364da83e4344d4fc3621a3
Diffstat (limited to 'compiler/optimizing/code_generator_x86_64.h')
-rw-r--r-- | compiler/optimizing/code_generator_x86_64.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/compiler/optimizing/code_generator_x86_64.h b/compiler/optimizing/code_generator_x86_64.h index a299cf6476..c81f7855c2 100644 --- a/compiler/optimizing/code_generator_x86_64.h +++ b/compiler/optimizing/code_generator_x86_64.h @@ -28,13 +28,19 @@ namespace x86_64 { static constexpr size_t kX86_64WordSize = 8; static constexpr Register kParameterCoreRegisters[] = { RSI, RDX, RCX, R8, R9 }; +static constexpr FloatRegister kParameterFloatRegisters[] = + { XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7 }; static constexpr size_t kParameterCoreRegistersLength = arraysize(kParameterCoreRegisters); +static constexpr size_t kParameterFloatRegistersLength = arraysize(kParameterFloatRegisters); -class InvokeDexCallingConvention : public CallingConvention<Register> { +class InvokeDexCallingConvention : public CallingConvention<Register, FloatRegister> { public: - InvokeDexCallingConvention() - : CallingConvention(kParameterCoreRegisters, kParameterCoreRegistersLength) {} + InvokeDexCallingConvention() : CallingConvention( + kParameterCoreRegisters, + kParameterCoreRegistersLength, + kParameterFloatRegisters, + kParameterFloatRegistersLength) {} private: DISALLOW_COPY_AND_ASSIGN(InvokeDexCallingConvention); @@ -42,13 +48,17 @@ class InvokeDexCallingConvention : public CallingConvention<Register> { class InvokeDexCallingConventionVisitor { public: - InvokeDexCallingConventionVisitor() : gp_index_(0), stack_index_(0) {} + InvokeDexCallingConventionVisitor() : gp_index_(0), fp_index_(0), stack_index_(0) {} Location GetNextLocation(Primitive::Type type); private: InvokeDexCallingConvention calling_convention; + // The current index for cpu registers. uint32_t gp_index_; + // The current index for fpu registers. + uint32_t fp_index_; + // The current stack index. uint32_t stack_index_; DISALLOW_COPY_AND_ASSIGN(InvokeDexCallingConventionVisitor); |