Either works for me.

Honestly

- either one is hard to understand without referring to the
  docs (and then realizing power numbers bits backwards). 
- It is simple enough it has to work or there will be chaos

and I'm not that afraid of more poeple seeing RETGUARD stubs :) 

Christian Weisgerber <[email protected]> wrote:

> On 2020-06-08, Christian Weisgerber <[email protected]> wrote:
> 
> > More archs to come...
> 
> Style question:
> Since this mostly comes down to embedding a single special instruction
> in between normal C operations, I wonder whether I should just do .c
> with asm() instead of .S, and leave all the boilerplate to the
> compiler?  It would save me from reading up on calling conventions,
> more assembly syntax, etc.
> 
> E.g.:
> 
> int ffs(int x)
> {
>         x = x & -x;
>         __asm volatile("clz %0, %0" : "=r" (x));
>         return (32 - x);
> }
> 
> -- 
> Christian "naddy" Weisgerber                          [email protected]
> 

Reply via email to