* [PATCH] util/loongarch64: Add clang compiler support
@ 2025-03-07 1:13 Bibo Mao
2025-03-14 17:19 ` Yao Zi
0 siblings, 1 reply; 3+ messages in thread
From: Bibo Mao @ 2025-03-07 1:13 UTC (permalink / raw)
To: Richard Henderson; +Cc: qemu-devel
Float register name f0 - f31 is not recognized with clang compiler
with LoongArch64 target, its name should be $f0 - $f31. It is ok
for both gcc and clang compiler.
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
host/include/loongarch64/host/bufferiszero.c.inc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/host/include/loongarch64/host/bufferiszero.c.inc b/host/include/loongarch64/host/bufferiszero.c.inc
index 69891eac80..bb2598fdc3 100644
--- a/host/include/loongarch64/host/bufferiszero.c.inc
+++ b/host/include/loongarch64/host/bufferiszero.c.inc
@@ -61,7 +61,8 @@ static bool buffer_is_zero_lsx(const void *buf, size_t len)
"2:"
: "=&r"(ret), "+r"(p)
: "r"(buf), "r"(e), "r"(l)
- : "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "fcc0");
+ : "$f0", "$f1", "$f2", "$f3", "$f4", "$f5", "$f6", "$f7", "$f8",
+ "$fcc0");
return ret;
}
@@ -119,7 +120,8 @@ static bool buffer_is_zero_lasx(const void *buf, size_t len)
"3:"
: "=&r"(ret), "+r"(p)
: "r"(buf), "r"(e), "r"(l)
- : "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "fcc0");
+ : "$f0", "$f1", "$f2", "$f3", "$f4", "$f5", "$f6", "$f7", "$f8",
+ "$fcc0");
return ret;
}
base-commit: 661c2e1ab29cd9c4d268ae3f44712e8d421c0e56
--
2.39.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] util/loongarch64: Add clang compiler support
2025-03-07 1:13 [PATCH] util/loongarch64: Add clang compiler support Bibo Mao
@ 2025-03-14 17:19 ` Yao Zi
2025-03-17 1:14 ` bibo mao
0 siblings, 1 reply; 3+ messages in thread
From: Yao Zi @ 2025-03-14 17:19 UTC (permalink / raw)
To: Bibo Mao, Richard Henderson; +Cc: qemu-devel
On Fri, Mar 07, 2025 at 09:13:39AM +0800, Bibo Mao wrote:
> Float register name f0 - f31 is not recognized with clang compiler
> with LoongArch64 target, its name should be $f0 - $f31. It is ok
> for both gcc and clang compiler.
Sorry I didn't search the list carefully and sent a similar patch[1].
Apart from preventing the disk tools to be built, this issue affects
several headers used by linux-user emulators as well. IMHO this should
be fixed, too, or my patch could be taken.
Sorry for the inconvenience,
Yao Zi
[1]: https://lore.kernel.org/all/20250314033150.53268-3-ziyao@disroot.org/
> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
> ---
> host/include/loongarch64/host/bufferiszero.c.inc | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/host/include/loongarch64/host/bufferiszero.c.inc b/host/include/loongarch64/host/bufferiszero.c.inc
> index 69891eac80..bb2598fdc3 100644
> --- a/host/include/loongarch64/host/bufferiszero.c.inc
> +++ b/host/include/loongarch64/host/bufferiszero.c.inc
> @@ -61,7 +61,8 @@ static bool buffer_is_zero_lsx(const void *buf, size_t len)
> "2:"
> : "=&r"(ret), "+r"(p)
> : "r"(buf), "r"(e), "r"(l)
> - : "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "fcc0");
> + : "$f0", "$f1", "$f2", "$f3", "$f4", "$f5", "$f6", "$f7", "$f8",
> + "$fcc0");
>
> return ret;
> }
> @@ -119,7 +120,8 @@ static bool buffer_is_zero_lasx(const void *buf, size_t len)
> "3:"
> : "=&r"(ret), "+r"(p)
> : "r"(buf), "r"(e), "r"(l)
> - : "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "fcc0");
> + : "$f0", "$f1", "$f2", "$f3", "$f4", "$f5", "$f6", "$f7", "$f8",
> + "$fcc0");
>
> return ret;
> }
>
> base-commit: 661c2e1ab29cd9c4d268ae3f44712e8d421c0e56
> --
> 2.39.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] util/loongarch64: Add clang compiler support
2025-03-14 17:19 ` Yao Zi
@ 2025-03-17 1:14 ` bibo mao
0 siblings, 0 replies; 3+ messages in thread
From: bibo mao @ 2025-03-17 1:14 UTC (permalink / raw)
To: Yao Zi, Richard Henderson; +Cc: qemu-devel
On 2025/3/15 上午1:19, Yao Zi wrote:
> On Fri, Mar 07, 2025 at 09:13:39AM +0800, Bibo Mao wrote:
>> Float register name f0 - f31 is not recognized with clang compiler
>> with LoongArch64 target, its name should be $f0 - $f31. It is ok
>> for both gcc and clang compiler.
>
> Sorry I didn't search the list carefully and sent a similar patch[1].
>
> Apart from preventing the disk tools to be built, this issue affects
> several headers used by linux-user emulators as well. IMHO this should
> be fixed, too, or my patch could be taken.
Yao,
Thanks for your patch. It is found only if clang is used on LoongArch
host, and your change log note is clearer than mine. Your patch should
be taken.
Regards
Bibo Mao
>
> Sorry for the inconvenience,
> Yao Zi
>
> [1]: https://lore.kernel.org/all/20250314033150.53268-3-ziyao@disroot.org/
>
>> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
>> ---
>> host/include/loongarch64/host/bufferiszero.c.inc | 6 ++++--
>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/host/include/loongarch64/host/bufferiszero.c.inc b/host/include/loongarch64/host/bufferiszero.c.inc
>> index 69891eac80..bb2598fdc3 100644
>> --- a/host/include/loongarch64/host/bufferiszero.c.inc
>> +++ b/host/include/loongarch64/host/bufferiszero.c.inc
>> @@ -61,7 +61,8 @@ static bool buffer_is_zero_lsx(const void *buf, size_t len)
>> "2:"
>> : "=&r"(ret), "+r"(p)
>> : "r"(buf), "r"(e), "r"(l)
>> - : "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "fcc0");
>> + : "$f0", "$f1", "$f2", "$f3", "$f4", "$f5", "$f6", "$f7", "$f8",
>> + "$fcc0");
>>
>> return ret;
>> }
>> @@ -119,7 +120,8 @@ static bool buffer_is_zero_lasx(const void *buf, size_t len)
>> "3:"
>> : "=&r"(ret), "+r"(p)
>> : "r"(buf), "r"(e), "r"(l)
>> - : "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "fcc0");
>> + : "$f0", "$f1", "$f2", "$f3", "$f4", "$f5", "$f6", "$f7", "$f8",
>> + "$fcc0");
>>
>> return ret;
>> }
>>
>> base-commit: 661c2e1ab29cd9c4d268ae3f44712e8d421c0e56
>> --
>> 2.39.3
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-17 1:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-07 1:13 [PATCH] util/loongarch64: Add clang compiler support Bibo Mao
2025-03-14 17:19 ` Yao Zi
2025-03-17 1:14 ` bibo mao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).