On Sun, May 22, 2011 at 7:10 PM, Peter Maydell <peter.mayd...@linaro.org> wrote:
> On 22 May 2011 17:55, Blue Swirl <blauwir...@gmail.com> wrote:
>> For ARM, the handcrafted instructions below need to be changed to save also 
>> r7:
>>    /* stmdb sp!, { r4 - r6, r8 - r11, lr } */
>>    tcg_out32(s, (COND_AL << 28) | 0x092d4f70);
>>
>>    /* ldmia sp!, { r4 - r6, r8 - r11, pc } */
>>    tcg_out32(s, (COND_AL << 28) | 0x08bd8f70);
>
> That would be ...ff0 rather than ...f70 in both cases
> (bottom 16 bits are a bit map of registers being saved/loaded):
>
>    /* stmdb sp!, { r4 - r11, lr } */
>    tcg_out32(s, (COND_AL << 28) | 0x092d4ff0);
>
>    /* ldmia sp!, { r4 - r11, pc } */
>    tcg_out32(s, (COND_AL << 28) | 0x08bd8ff0);

Shouldn't you extend the range to include r12, due to
the 8-byte alignment restriction of the stack?


Laurent

Reply via email to