lkml.org 
[lkml]   [2003]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] oops_in_progress is unlikely()
Richard B. Johnson wrote:
> cmpl $1, %eax
> jz 1f
> jc 2f
> call do_default
> jmp more_code
> 1: call do_something_if_equal
> jmp more_code
> 2: call do_something_if_less
> more_code:
>
> In every case, one has to jump around code for other execution paths
> except the last, where you have to jump on condition anyway. There
> is no free liunch, and the straight-through route, do_default
> uas just as many jumps as the last.

Here is your code optimised for no jumps in the "do_default" case:

cmpl $1,%eax
jbe 1f
call do_default
more_code:
.subsection 1
1: jnz 2f
call do_something_if_equal
jmp more_code
2: call do_something_if_less
jmp more_code
.previous

> > How would you optimise it, if you were writing assembly language yourself?

> I did. And I do this for a living. And, after 30 years of this shit
> they still haven't fired me. Learn something. I'm pissed.

It's ok to be pissed. I'd be pissed too :)

*ducks*

Enjoy :)
-- Jame
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.063 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site