Re: [patch 06/10] Immediate Value - i386 Optimization

2007-07-03 Thread Jeremy Fitzhardinge
Chuck Ebbert wrote: On 07/03/2007 04:18 PM, H. Peter Anvin wrote: One could, though, use an indirect jump to achieve, if not as good, at least most of the effect: movl$, jmp * Yeah, but there's this GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id

Re: [patch 06/10] Immediate Value - i386 Optimization

2007-07-03 Thread H. Peter Anvin
Chuck Ebbert wrote: > On 07/03/2007 04:18 PM, H. Peter Anvin wrote: >> One could, though, use an indirect jump to achieve, if not as good, at >> least most of the effect: >> >> movl$, >> jmp * >> > > Yeah, but there's this GCC bug: > > http://gcc.gnu.org/bugzilla/show_bug.

Re: [patch 06/10] Immediate Value - i386 Optimization

2007-07-03 Thread H. Peter Anvin
Mathieu Desnoyers wrote: > > If we can change the compiler, here is what we could do: > > Tell GCC to put NOPs that could be altered by a branch alternative to > some specified code. We should be able to get the instruction pointers > (think of inlines) to these nop/branch instructions so we can

Re: [patch 06/10] Immediate Value - i386 Optimization

2007-07-03 Thread Mathieu Desnoyers
* H. Peter Anvin ([EMAIL PROTECTED]) wrote: > Mathieu Desnoyers wrote: > > > > Hi Peter, > > > > I understand your concern. If you find a way to let the code be compiled > > by gcc, put at the end of the functions (never being a branch target) > > and then, dynamically, get the address of the bra

Re: [patch 06/10] Immediate Value - i386 Optimization

2007-07-03 Thread Chuck Ebbert
On 07/03/2007 04:18 PM, H. Peter Anvin wrote: > > One could, though, use an indirect jump to achieve, if not as good, at > least most of the effect: > > movl$, > jmp * > Yeah, but there's this GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22448 You can't eve

Re: [patch 06/10] Immediate Value - i386 Optimization

2007-07-03 Thread H. Peter Anvin
Mathieu Desnoyers wrote: > > Hi Peter, > > I understand your concern. If you find a way to let the code be compiled > by gcc, put at the end of the functions (never being a branch target) > and then, dynamically, get the address of the branch instruction and > patch it, all that in cooperation wi

Re: [patch 06/10] Immediate Value - i386 Optimization

2007-07-03 Thread Mathieu Desnoyers
* H. Peter Anvin ([EMAIL PROTECTED]) wrote: > What is not clear to me is the exact code that is generated by these > macros. Nor can I find it anywhere in the documentation. > > Could you please describe this in some detail? In particular, it seems > that the uses of these are largely as branch

Re: [patch 06/10] Immediate Value - i386 Optimization

2007-07-03 Thread H. Peter Anvin
What is not clear to me is the exact code that is generated by these macros. Nor can I find it anywhere in the documentation. Could you please describe this in some detail? In particular, it seems that the uses of these are largely as branch targets, where the extra indirection over modifying th

[patch 06/10] Immediate Value - i386 Optimization

2007-07-03 Thread Mathieu Desnoyers
i386 optimization of the immediate values which uses a movl with code patching to set/unset the value used to populate the register used for the branch test. Signed-off-by: Mathieu Desnoyers <[EMAIL PROTECTED]> --- arch/i386/kernel/Makefile|1 arch/i386/kernel/immediate.c | 171