[Qemu-devel] [PATCH 4/5] tcg-sparc: Implement division properly.

2010-01-11 Thread Richard Henderson
The {div,divu}2 opcodes are intended for systems for which the division instruction produces both quotient and remainder. Sparc is not such a system. Indeed, the remainder must be computed as quot = a / b rem = a - (quot * b) Split out a tcg_out_div32 function that properly initializes Y

Re: [Qemu-devel] [PATCH 4/5] tcg-sparc: Implement division properly.

2010-01-11 Thread Richard Henderson
On 01/11/2010 11:09 AM, Richard Henderson wrote: +/* Load Y with the sign/zero extension of RS1 to 64-bits. */ +if (uns) { +tcg_out_sety(s, TCG_REG_G0); +} else { +tcg_out_arith(s, TCG_REG_I5, rs1, 31, SHIFT_SRA); Bah. tcg_out_arithi. Programming by code