Re: [Qemu-devel] [PATCH 2/2] target-mips/translate.c: Add judgement for msb and lsb

2014-07-29 Thread Dongxue Zhang
Ok, I got you. I will re-build a new patch for all the bitops. 2014-07-29 22:08 GMT+08:00 Aurelien Jarno : > On Tue, Jul 29, 2014 at 08:41:08PM +0800, Elta wrote: > > I think, debug mode shouldn't crash the qemu with an unpredictable > > operation, > > so i want to fix it. And you say there shou

Re: [Qemu-devel] [PATCH 2/2] target-mips/translate.c: Add judgement for msb and lsb

2014-07-29 Thread Aurelien Jarno
On Tue, Jul 29, 2014 at 08:41:08PM +0800, Elta wrote: > I think, debug mode shouldn't crash the qemu with an unpredictable > operation, > so i want to fix it. And you say there shouldn't raise RI, i agree with you. Agreed. > Or when lsb > msb, just leave the code and do nothing. What do you > thi

Re: [Qemu-devel] [PATCH 2/2] target-mips/translate.c: Add judgement for msb and lsb

2014-07-29 Thread Peter Maydell
On 28 July 2014 23:52, Aurelien Jarno wrote: > On Mon, Jul 28, 2014 at 11:34:30PM +0100, Peter Maydell wrote: >> On 28 July 2014 23:32, Aurelien Jarno wrote: >> > On Mon, Jul 28, 2014 at 11:01:02PM +0100, Peter Maydell wrote: >> >> This may be true, but the TCG README doesn't define negative >> >

Re: [Qemu-devel] [PATCH 2/2] target-mips/translate.c: Add judgement for msb and lsb

2014-07-29 Thread Elta
On 07/29/2014 06:52 AM, Aurelien Jarno wrote: On Mon, Jul 28, 2014 at 11:34:30PM +0100, Peter Maydell wrote: On 28 July 2014 23:32, Aurelien Jarno wrote: On Mon, Jul 28, 2014 at 11:01:02PM +0100, Peter Maydell wrote: This may be true, but the TCG README doesn't define negative lengths as bein

Re: [Qemu-devel] [PATCH 2/2] target-mips/translate.c: Add judgement for msb and lsb

2014-07-28 Thread Aurelien Jarno
On Mon, Jul 28, 2014 at 11:34:30PM +0100, Peter Maydell wrote: > On 28 July 2014 23:32, Aurelien Jarno wrote: > > On Mon, Jul 28, 2014 at 11:01:02PM +0100, Peter Maydell wrote: > >> This may be true, but the TCG README doesn't define negative > >> lengths as being "unspecified behaviour" (ie guara

Re: [Qemu-devel] [PATCH 2/2] target-mips/translate.c: Add judgement for msb and lsb

2014-07-28 Thread Peter Maydell
On 28 July 2014 23:32, Aurelien Jarno wrote: > On Mon, Jul 28, 2014 at 11:01:02PM +0100, Peter Maydell wrote: >> This may be true, but the TCG README doesn't define negative >> lengths as being "unspecified behaviour" (ie guaranteed to at >> least not crash even if the result isn't specified), and

Re: [Qemu-devel] [PATCH 2/2] target-mips/translate.c: Add judgement for msb and lsb

2014-07-28 Thread Aurelien Jarno
On Mon, Jul 28, 2014 at 11:01:02PM +0100, Peter Maydell wrote: > On 28 July 2014 22:42, Aurelien Jarno wrote: > > On Mon, Jul 28, 2014 at 11:58:22PM +0800, Dongxue Zhang wrote: > >> Use 'if' to make sure the real msb greater than the lsb. As the compiler > >> may > >> not do this. > > > > What ar

Re: [Qemu-devel] [PATCH 2/2] target-mips/translate.c: Add judgement for msb and lsb

2014-07-28 Thread Peter Maydell
On 28 July 2014 22:42, Aurelien Jarno wrote: > On Mon, Jul 28, 2014 at 11:58:22PM +0800, Dongxue Zhang wrote: >> Use 'if' to make sure the real msb greater than the lsb. As the compiler may >> not do this. > > What are you trying to fix exactly? These cases are defined as > "unpredictable" in the

Re: [Qemu-devel] [PATCH 2/2] target-mips/translate.c: Add judgement for msb and lsb

2014-07-28 Thread Aurelien Jarno
On Mon, Jul 28, 2014 at 11:58:22PM +0800, Dongxue Zhang wrote: > Use 'if' to make sure the real msb greater than the lsb. As the compiler may > not do this. What are you trying to fix exactly? These cases are defined as "unpredictable" in the MIPS ISA manual, which is what is implemented in QEMU.

[Qemu-devel] [PATCH 2/2] target-mips/translate.c: Add judgement for msb and lsb

2014-07-28 Thread Dongxue Zhang
Use 'if' to make sure the real msb greater than the lsb. As the compiler may not do this. Signed-off-by: Dongxue Zhang --- target-mips/translate.c | 9 + 1 file changed, 9 insertions(+) diff --git a/target-mips/translate.c b/target-mips/translate.c index c381366..e2cce31 100644 --- a/ta