Commit 909ad1bb authored by rgabor@webkit.org's avatar rgabor@webkit.org

DFG JIT doesn't work properly on ARM hardfp

https://bugs.webkit.org/show_bug.cgi?id=95684

Reviewed by Filip Pizlo.

Add hardfp support to DFG JIT. The patch is created with the
help of Zoltan Herczeg.

Source/JavaScriptCore: 

* dfg/DFGCCallHelpers.h:
(CCallHelpers):
(JSC::DFG::CCallHelpers::setupArguments):
* dfg/DFGFPRInfo.h:
(FPRInfo):
* dfg/DFGSpeculativeJIT.h:
(SpeculativeJIT):
(JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheckSetResult):
(JSC::DFG::SpeculativeJIT::appendCallSetResult):

Source/WTF: 

* wtf/Platform.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127561 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 00bd3817
2012-09-05 Gabor Rapcsanyi <rgabor@webkit.org>
DFG JIT doesn't work properly on ARM hardfp
https://bugs.webkit.org/show_bug.cgi?id=95684
Reviewed by Filip Pizlo.
Add hardfp support to DFG JIT. The patch is created with the
help of Zoltan Herczeg.
* dfg/DFGCCallHelpers.h:
(CCallHelpers):
(JSC::DFG::CCallHelpers::setupArguments):
* dfg/DFGFPRInfo.h:
(FPRInfo):
* dfg/DFGSpeculativeJIT.h:
(SpeculativeJIT):
(JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheckSetResult):
(JSC::DFG::SpeculativeJIT::appendCallSetResult):
2012-09-04 Mark Lam <mark.lam@apple.com> 2012-09-04 Mark Lam <mark.lam@apple.com>
Allow the YarrJIT to use the assembler even when useJIT() is false. Allow the YarrJIT to use the assembler even when useJIT() is false.
......
...@@ -456,6 +456,28 @@ public: ...@@ -456,6 +456,28 @@ public:
setupTwoStubArgs<FPRInfo::argumentFPR0, FPRInfo::argumentFPR1>(arg1, arg2); setupTwoStubArgs<FPRInfo::argumentFPR0, FPRInfo::argumentFPR1>(arg1, arg2);
} }
#elif CPU(ARM) #elif CPU(ARM)
#if CPU(ARM_HARDFP)
ALWAYS_INLINE void setupArguments(FPRReg arg1)
{
moveDouble(arg1, FPRInfo::argumentFPR0);
}
ALWAYS_INLINE void setupArguments(FPRReg arg1, FPRReg arg2)
{
if (arg2 != FPRInfo::argumentFPR0) {
moveDouble(arg1, FPRInfo::argumentFPR0);
moveDouble(arg2, FPRInfo::argumentFPR1);
} else if (arg1 != FPRInfo::argumentFPR1) {
moveDouble(arg2, FPRInfo::argumentFPR1);
moveDouble(arg1, FPRInfo::argumentFPR0);
} else {
// Swap arg1, arg2.
moveDouble(FPRInfo::argumentFPR0, ARMRegisters::d2);
moveDouble(FPRInfo::argumentFPR1, FPRInfo::argumentFPR0);
moveDouble(ARMRegisters::d2, FPRInfo::argumentFPR1);
}
}
#else
ALWAYS_INLINE void setupArguments(FPRReg arg1) ALWAYS_INLINE void setupArguments(FPRReg arg1)
{ {
assembler().vmov(GPRInfo::argumentGPR0, GPRInfo::argumentGPR1, arg1); assembler().vmov(GPRInfo::argumentGPR0, GPRInfo::argumentGPR1, arg1);
...@@ -466,6 +488,7 @@ public: ...@@ -466,6 +488,7 @@ public:
assembler().vmov(GPRInfo::argumentGPR0, GPRInfo::argumentGPR1, arg1); assembler().vmov(GPRInfo::argumentGPR0, GPRInfo::argumentGPR1, arg1);
assembler().vmov(GPRInfo::argumentGPR2, GPRInfo::argumentGPR3, arg2); assembler().vmov(GPRInfo::argumentGPR2, GPRInfo::argumentGPR3, arg2);
} }
#endif // CPU(ARM_HARDFP)
#else #else
#error "DFG JIT not supported on this platform." #error "DFG JIT not supported on this platform."
#endif #endif
......
...@@ -122,6 +122,11 @@ public: ...@@ -122,6 +122,11 @@ public:
// we'll return in d0 for simplicity. // we'll return in d0 for simplicity.
static const FPRReg returnValueFPR = ARMRegisters::d0; // fpRegT0 static const FPRReg returnValueFPR = ARMRegisters::d0; // fpRegT0
#if CPU(ARM_HARDFP)
static const FPRReg argumentFPR0 = ARMRegisters::d0; // fpRegT0
static const FPRReg argumentFPR1 = ARMRegisters::d1; // fpRegT1
#endif
// FPRReg mapping is direct, the machine regsiter numbers can // FPRReg mapping is direct, the machine regsiter numbers can
// be used directly as indices into the FPR RegisterBank. // be used directly as indices into the FPR RegisterBank.
COMPILE_ASSERT(ARMRegisters::d0 == 0, d0_is_0); COMPILE_ASSERT(ARMRegisters::d0 == 0, d0_is_0);
......
...@@ -1835,7 +1835,21 @@ public: ...@@ -1835,7 +1835,21 @@ public:
return call; return call;
} }
#elif CPU(ARM) #elif CPU(ARM)
#if CPU(ARM_HARDFP)
JITCompiler::Call appendCallWithExceptionCheckSetResult(const FunctionPtr& function, FPRReg result) JITCompiler::Call appendCallWithExceptionCheckSetResult(const FunctionPtr& function, FPRReg result)
{
JITCompiler::Call call = appendCallWithExceptionCheck(function);
m_jit.moveDouble(result, FPRInfo::argumentFPR0);
return call;
}
JITCompiler::Call appendCallSetResult(const FunctionPtr& function, FPRReg result)
{
JITCompiler::Call call = m_jit.appendCall(function);
m_jit.moveDouble(result, FPRInfo::argumentFPR0);
return call;
}
#else
JITCompiler::Call appendCallWithExceptionCheckSetResult(const FunctionPtr& function, FPRReg result)
{ {
JITCompiler::Call call = appendCallWithExceptionCheck(function); JITCompiler::Call call = appendCallWithExceptionCheck(function);
m_jit.assembler().vmov(result, GPRInfo::returnValueGPR, GPRInfo::returnValueGPR2); m_jit.assembler().vmov(result, GPRInfo::returnValueGPR, GPRInfo::returnValueGPR2);
...@@ -1847,6 +1861,7 @@ public: ...@@ -1847,6 +1861,7 @@ public:
m_jit.assembler().vmov(result, GPRInfo::returnValueGPR, GPRInfo::returnValueGPR2); m_jit.assembler().vmov(result, GPRInfo::returnValueGPR, GPRInfo::returnValueGPR2);
return call; return call;
} }
#endif // CPU(ARM_HARDFP)
#else #else
JITCompiler::Call appendCallWithExceptionCheckSetResult(const FunctionPtr& function, FPRReg result) JITCompiler::Call appendCallWithExceptionCheckSetResult(const FunctionPtr& function, FPRReg result)
{ {
......
2012-09-05 Gabor Rapcsanyi <rgabor@webkit.org>
DFG JIT doesn't work properly on ARM hardfp
https://bugs.webkit.org/show_bug.cgi?id=95684
Reviewed by Filip Pizlo.
Add hardfp support to DFG JIT. The patch is created with the
help of Zoltan Herczeg.
* wtf/Platform.h:
2012-09-04 Zoltan Horvath <zoltan@webkit.org> 2012-09-04 Zoltan Horvath <zoltan@webkit.org>
Extend the coverage of the Custom Allocation Framework in WTF and in JavaScriptCore Extend the coverage of the Custom Allocation Framework in WTF and in JavaScriptCore
......
...@@ -169,6 +169,10 @@ ...@@ -169,6 +169,10 @@
|| defined(_ARM_) || defined(_ARM_)
#define WTF_CPU_ARM 1 #define WTF_CPU_ARM 1
#if defined(__ARM_PCS_VFP)
#define WTF_CPU_ARM_HARDFP 1
#endif
#if defined(__ARMEB__) || (COMPILER(RVCT) && defined(__BIG_ENDIAN)) #if defined(__ARMEB__) || (COMPILER(RVCT) && defined(__BIG_ENDIAN))
#define WTF_CPU_BIG_ENDIAN 1 #define WTF_CPU_BIG_ENDIAN 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment