qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v8 32/35] Hexagon (tests/tcg/hexagon) TCG tests - atomics/loa


From: Richard Henderson
Subject: Re: [PATCH v8 32/35] Hexagon (tests/tcg/hexagon) TCG tests - atomics/load/store/misc
Date: Sun, 14 Feb 2021 17:09:06 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 2/7/21 9:46 PM, Taylor Simpson wrote:
> +/* Using volatile because we are testing atomics */
> +static inline int atomic_inc32(volatile int *x)
> +{
> +    int old, dummy;
> +    __asm__ __volatile__(
> +        "1: %0 = memw_locked(%2)\n\t"
> +        "   %1 = add(%0, #1)\n\t"
> +        "   memw_locked(%2, p0) = %1\n\t"
> +        "   if (!p0) jump 1b\n\t"
> +        : "=&r"(old), "=&r"(dummy)
> +        : "r"(x)
> +        : "p0", "memory");
> +    return old;
> +}

While I can hardly deny a cpu testcase using inline asm, I'm a bit curious why
you didn't use the compiler builtins.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]