[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~
- [PATCH v8 27/35] Hexagon (target/hexagon) TCG for instructions with multiple definitions, (continued)
- [PATCH v8 27/35] Hexagon (target/hexagon) TCG for instructions with multiple definitions, Taylor Simpson, 2021/02/08
- [PATCH v8 31/35] Hexagon (tests/tcg/hexagon) TCG tests - multiarch, Taylor Simpson, 2021/02/08
- [PATCH v8 33/35] Hexagon (tests/tcg/hexagon) TCG tests - floating point, Taylor Simpson, 2021/02/08
- [PATCH v8 29/35] Hexagon (target/hexagon) translation, Taylor Simpson, 2021/02/08
- [PATCH v8 32/35] Hexagon (tests/tcg/hexagon) TCG tests - atomics/load/store/misc, Taylor Simpson, 2021/02/08
- Re: [PATCH v8 32/35] Hexagon (tests/tcg/hexagon) TCG tests - atomics/load/store/misc,
Richard Henderson <=
- [PATCH v8 22/35] Hexagon (target/hexagon) generater phase 4 - decode tree, Taylor Simpson, 2021/02/08
- [PATCH v8 30/35] Hexagon (linux-user/hexagon) Linux user emulation, Taylor Simpson, 2021/02/08
- [PATCH v8 08/35] Hexagon (target/hexagon) GDB Stub, Taylor Simpson, 2021/02/08
- [PATCH v8 21/35] Hexagon (target/hexagon) generator phase 3 - C preprocessor for decode tree, Taylor Simpson, 2021/02/08
- [PATCH v8 35/35] Add Dockerfile for hexagon, Taylor Simpson, 2021/02/08