我們知道在NEON上,SIMD寄存器q0
〜q7
與浮點寄存器s0
〜s31
共享。所以下面的代碼有一個bug:NEON有沒有像「emms」這樣的東西?
float_t fRatio = (float_t)srcWidth/dstWidth;
// NEON asm modified q0~q7
MyNeonFunctionPtr1(pData, Stride, (int32_t)(fHorRatio*m_iHorScale));
// following sentence use wrong "fHorRatio",
// which is modified by "MyNeonFunctionPtr1";
int32_t vertStepLuma = (int32_t)(fHorRatio*m_iVertScale);
在x86中,emms可以解決它。但我如何在NEON上做到這一點?我的臨時解決方案是在vertStepLuma
上使用volatile
。有沒有更好的辦法?謝謝!
它是外部函數。你的建議很有幫助! – lcljesse 2012-04-01 06:03:37
反過來也一樣。 ABI規定您不得損壞Q4-Q7 – 2012-04-02 19:11:56
Ooops。抱歉。是的,這是相反的方式,而不是我寫的。 – 2012-04-02 20:04:43