Re: [Qemu-devel] [RFC] target/xtensa: rework zero overhead loops implementation

2018-10-04 Thread Max Filippov
On Thu, Oct 4, 2018 at 3:03 PM Max Filippov wrote: > But I guess always storing low 13 bits of LEND - PC should work? ...when they're within two pages from each other... -- Thanks. -- Max

Re: [Qemu-devel] [RFC] target/xtensa: rework zero overhead loops implementation

2018-10-04 Thread Max Filippov
Hi Richard, thank you for taking a look. On Thu, Oct 4, 2018 at 2:13 PM Richard Henderson wrote: > Think first about how, if PC >= LEND or LEND - PC > PAGE_SIZE, that all of the > loop stuff is irrelevant because we won't hit LEND within this TB. > > Think second about how to represent the commo

Re: [Qemu-devel] [RFC] target/xtensa: rework zero overhead loops implementation

2018-10-04 Thread Richard Henderson
On 10/4/18 3:14 PM, Max Filippov wrote: > I thought about it some more and it looks like this is not going to work > in general case in the presence of TB linking: a block with a big (and thus > not precise) LEND distance may be linked to a block with a small (and > thus precise) LEND distance. The

Re: [Qemu-devel] [RFC] target/xtensa: rework zero overhead loops implementation

2018-10-04 Thread Max Filippov
On Wed, Oct 3, 2018 at 6:05 PM Max Filippov wrote: > > Don't invalidate TB with the end of zero overhead loop when LBEG or LEND > change. Instead encode the distance from the TB start to the LEND in the > TB flags and generate loopback code when offset of the next PC from the > TB start equals tha

[Qemu-devel] [RFC] target/xtensa: rework zero overhead loops implementation

2018-10-03 Thread Max Filippov
Don't invalidate TB with the end of zero overhead loop when LBEG or LEND change. Instead encode the distance from the TB start to the LEND in the TB flags and generate loopback code when offset of the next PC from the TB start equals that distance. Distance not greater than the maximal instruction