lkml.org 
[lkml]   [2008]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] x86: fix text_poke
Mathieu Desnoyers wrote:
>
> This epilogue should then be used on both branches of the condition,
> like this :
>
> if (unlikely(imv_cond(var))) {
> imv_cond_end();
> ...
> } else {
> imv_cond_end();
> ...
> }
>
> Where imv_cond_end() would look like this :
>
> +/*
> + * Puts a test and branch make sure the %al register and ZF are not live
> + * anymore.
> + * All asm statements clobbers the flags, but add "cc" clobber just to be sure.
> + * Clobbers %al.
> + */
> +#define imv_cond_end() \
> + do { \
> + asm (".section __imv_cond_end,\"a\",@progbits\n\t" \
> + _ASM_PTR "1f\n\t" \
> + ".previous\n\t" \
> + "1:\n\t" \
> + : : : "a", "cc"); \
> + } while (0)
> +
>

As far as this is concerned, all you accomplish here is that gcc, if it
wants to re-use the %al value, will copy it into another register before
doing your imv_conv_end().

-hpa


\
 
 \ /
  Last update: 2008-04-25 22:33    [W:0.279 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site