[llvmlinux] Wrong types in inline assembly?

Marcelo Sousa marceloabsousa at gmail.com
Fri Sep 27 10:47:11 UTC 2013


At the IR level, I see dozens (if not more) files with this (and
similar) behaviors. Although it may be bad practice, I'm interested in
potential bugs. This doesn't seem like it right?

On Fri, Sep 27, 2013 at 11:36 AM, Tim Northover <t.p.northover at gmail.com> wrote:
>> What file is generating this?
>
> There's at least one block in include/linux/math64.h in the function
> __iter_div_u64_rem:
>
>         while (dividend >= divisor) {
>                 /* The following asm() prevents the compiler from
>                    optimising this loop into a modulo operation.  */
>                 asm("" : "+rm"(dividend));
>
>                 dividend -= divisor;
>                 ret++;
>         }
>
> I can sympathise with the desire, but there's almost certainly a
> better way to do that. Yuck.
>
> Tim.
> _______________________________________________
> LLVMLinux mailing list
> LLVMLinux at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/llvmlinux


More information about the LLVMLinux mailing list