[PATCH 2/2] LoongArch: Fix tst-gnu2-tls2 register checks
dengjianbo
dengjianbo@loongson.cn
Sat Nov 7 02:12:59 GMT 2026
On 11/6/26 5:43 PM, Florian Weimer wrote:
> * Deng Jianbo:
>
>> + /* Keep the callee-saved values live as operands across TLSDESC_CALL. */ \
>> + asm volatile ("fld.d %0, %8\n\t" \
>> + "fld.d %1, %9\n\t" \
>> + "fld.d %2, %10\n\t" \
>> + "fld.d %3, %11\n\t" \
>> + "fld.d %4, %12\n\t" \
>> + "fld.d %5, %13\n\t" \
>> + "fld.d %6, %14\n\t" \
>> + "fld.d %7, %15" \
>> + : "=f"(src_f24), "=f"(src_f25), "=f"(src_f26), \
>> + "=f"(src_f27), "=f"(src_f28), "=f"(src_f29), \
>> + "=f"(src_f30), "=f"(src_f31) \
>> + : "m"(src_float[24]), "m"(src_float[25]), \
>> + "m"(src_float[26]), "m"(src_float[27]), \
>> + "m"(src_float[28]), "m"(src_float[29]), \
>> + "m"(src_float[30]), "m"(src_float[31])); \
>
> Doesn't this need a memory clobber?
>
> Thanks,
> Florian
>
Regarding the memory clobber, the GCC manual says:
The "memory" clobber tells the compiler that the assembly code performs
memory reads or writes to items other than those listed in the input and
output operands.
As I understand it, these instructions only read from src_float[24]
through src_float[31], all of which are listed as "m" input operands.
There is no hidden memory access here, so I think a memory clobber is
not needed here.
More information about the Libc-alpha
mailing list