Re: [PATCH] arch: ia64: kernel: palinfo.c: Optimization of the Code

2014-06-02 Thread Rickard Strandqvist
Hi Thought I would be able to do that. But after testing, I could not measure any difference. Thought it would make a noticeable difference, but guess gcc resolve this in the best way. Best regards Rickard Strandqvist 2014-06-02 9:24 GMT+02:00 Clemens Ladisch : > Rickard Strandqvist wrote:

Re: [PATCH] arch: ia64: kernel: palinfo.c: Optimization of the Code

2014-06-02 Thread Clemens Ladisch
Rickard Strandqvist wrote: > From what I know, AND is faster then modulo. Which is why the compiler does this optimization automatically, if it can prove that it is correct. > - if (i != 0 && (i%64) == 0) > + if (i != 0 && (i&63) == 0) Did you prove that i cannot be

Re: [PATCH] arch: ia64: kernel: palinfo.c: Optimization of the Code

2014-06-02 Thread Clemens Ladisch
Rickard Strandqvist wrote: From what I know, AND is faster then modulo. Which is why the compiler does this optimization automatically, if it can prove that it is correct. - if (i != 0 (i%64) == 0) + if (i != 0 (i63) == 0) Did you prove that i cannot be negative?

Re: [PATCH] arch: ia64: kernel: palinfo.c: Optimization of the Code

2014-06-02 Thread Rickard Strandqvist
Hi Thought I would be able to do that. But after testing, I could not measure any difference. Thought it would make a noticeable difference, but guess gcc resolve this in the best way. Best regards Rickard Strandqvist 2014-06-02 9:24 GMT+02:00 Clemens Ladisch clem...@ladisch.de: Rickard

[PATCH] arch: ia64: kernel: palinfo.c: Optimization of the Code

2014-06-01 Thread Rickard Strandqvist
>From what I know, AND is faster then modulo. Not sure if this is worth changing though. Signed-off-by: Rickard Strandqvist --- arch/ia64/kernel/palinfo.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c index

[PATCH] arch: ia64: kernel: palinfo.c: Optimization of the Code

2014-06-01 Thread Rickard Strandqvist
From what I know, AND is faster then modulo. Not sure if this is worth changing though. Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se --- arch/ia64/kernel/palinfo.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/ia64/kernel/palinfo.c