Re: [Qemu-devel] [PATCH 2/7] nios2: Add architecture emulation support

2016-10-19 Thread Marek Vasut
On 10/19/2016 06:18 PM, Richard Henderson wrote: > On 10/18/2016 07:31 PM, Marek Vasut wrote: >>> Processing a little more data can be preferable to fewer branch >>> prediction failures. And the best way to avoid those is to not have the >>> branch at all. Especially when it's unlikely that the da

Re: [Qemu-devel] [PATCH 2/7] nios2: Add architecture emulation support

2016-10-19 Thread Richard Henderson
On 10/18/2016 07:31 PM, Marek Vasut wrote: Processing a little more data can be preferable to fewer branch prediction failures. And the best way to avoid those is to not have the branch at all. Especially when it's unlikely that the data will be created in the first place. OK, but I need to ma

Re: [Qemu-devel] [PATCH 2/7] nios2: Add architecture emulation support

2016-10-18 Thread Marek Vasut
On 10/19/2016 03:24 AM, Richard Henderson wrote: > On 10/18/2016 03:05 PM, Marek Vasut wrote: Thanks, I hope this is fixed now, although I mostly special-case the R_ZERO handling throughout the code. Any writes to R_ZERO are now ignored and any usage is converted to mov/movi instruct

Re: [Qemu-devel] [PATCH 2/7] nios2: Add architecture emulation support

2016-10-18 Thread Richard Henderson
On 10/18/2016 03:05 PM, Marek Vasut wrote: Thanks, I hope this is fixed now, although I mostly special-case the R_ZERO handling throughout the code. Any writes to R_ZERO are now ignored and any usage is converted to mov/movi instructions where applicable. We've done that in the past, but in the

Re: [Qemu-devel] [PATCH 2/7] nios2: Add architecture emulation support

2016-10-18 Thread Marek Vasut
On 10/18/2016 10:44 PM, Richard Henderson wrote: > On 10/18/2016 11:32 AM, Marek Vasut wrote: >> But the instruction encoding does, so I can use the field from the >> instruction to directly index the register array. > > Well, no, you can't. > > In fact, it would be cleaner to have multiple array

Re: [Qemu-devel] [PATCH 2/7] nios2: Add architecture emulation support

2016-10-18 Thread Richard Henderson
On 10/18/2016 11:32 AM, Marek Vasut wrote: But the instruction encoding does, so I can use the field from the instruction to directly index the register array. Well, no, you can't. In fact, it would be cleaner to have multiple arrays -- one for general registers and one for control registers

Re: [Qemu-devel] [PATCH 2/7] nios2: Add architecture emulation support

2016-10-18 Thread Marek Vasut
On 10/18/2016 05:31 PM, Richard Henderson wrote: > On 10/17/2016 08:58 PM, Marek Vasut wrote: >>> There's no particular reason why R_PC needs to be 64; if you change it >>> to 32, you can simplify this. >> >> I believe this is in fact needed, see [1] page 18 (section 2, Register >> file), quote: >>

Re: [Qemu-devel] [PATCH 2/7] nios2: Add architecture emulation support

2016-10-18 Thread Richard Henderson
On 10/17/2016 08:58 PM, Marek Vasut wrote: There's no particular reason why R_PC needs to be 64; if you change it to 32, you can simplify this. I believe this is in fact needed, see [1] page 18 (section 2, Register file), quote: " The Nios II architecture supports a flat register file, consist

Re: [Qemu-devel] [PATCH 2/7] nios2: Add architecture emulation support

2016-10-17 Thread Marek Vasut
On 09/29/2016 03:05 AM, Richard Henderson wrote: >> hw/nios2/cpu_pic.c | 70 +++ > > Why is this in this patch? Ah, good catch, moved to 10m50 support patch. >> target-nios2/instruction.c | 1427 >> >> target-nios2/instruction.h | 279

Re: [Qemu-devel] [PATCH 2/7] nios2: Add architecture emulation support

2016-09-28 Thread Richard Henderson
hw/nios2/cpu_pic.c | 70 +++ Why is this in this patch? target-nios2/instruction.c | 1427 target-nios2/instruction.h | 279 + target-nios2/translate.c | 242 Why are these files separate? +if (n < 32)