* [PATCH] LoongArch: Slightly clean up drdtime
@ 2023-11-26 12:17 Xi Ruoyao
2023-12-05 8:01 ` Ping: " Xi Ruoyao
0 siblings, 1 reply; 3+ messages in thread
From: Xi Ruoyao @ 2023-11-26 12:17 UTC (permalink / raw)
To: Huacai Chen, WANG Xuerui; +Cc: loongarch, linux-kernel, Xi Ruoyao
As we are just discarding the stable clock ID, simply write it into
$zero instead of allocating a temporary register.
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
---
arch/loongarch/include/asm/loongarch.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/loongarch/include/asm/loongarch.h b/arch/loongarch/include/asm/loongarch.h
index 9b4957cefa8a..46366e783c84 100644
--- a/arch/loongarch/include/asm/loongarch.h
+++ b/arch/loongarch/include/asm/loongarch.h
@@ -1098,12 +1098,11 @@
static __always_inline u64 drdtime(void)
{
- int rID = 0;
u64 val = 0;
__asm__ __volatile__(
- "rdtime.d %0, %1 \n\t"
- : "=r"(val), "=r"(rID)
+ "rdtime.d %0, $zero\n\t"
+ : "=r"(val)
:
);
return val;
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Ping: [PATCH] LoongArch: Slightly clean up drdtime
2023-11-26 12:17 [PATCH] LoongArch: Slightly clean up drdtime Xi Ruoyao
@ 2023-12-05 8:01 ` Xi Ruoyao
2023-12-05 8:07 ` Huacai Chen
0 siblings, 1 reply; 3+ messages in thread
From: Xi Ruoyao @ 2023-12-05 8:01 UTC (permalink / raw)
To: Huacai Chen, WANG Xuerui; +Cc: loongarch, linux-kernel
Ping.
On Sun, 2023-11-26 at 20:17 +0800, Xi Ruoyao wrote:
> As we are just discarding the stable clock ID, simply write it into
> $zero instead of allocating a temporary register.
>
> Signed-off-by: Xi Ruoyao <xry111@xry111.site>
> ---
> arch/loongarch/include/asm/loongarch.h | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/arch/loongarch/include/asm/loongarch.h b/arch/loongarch/include/asm/loongarch.h
> index 9b4957cefa8a..46366e783c84 100644
> --- a/arch/loongarch/include/asm/loongarch.h
> +++ b/arch/loongarch/include/asm/loongarch.h
> @@ -1098,12 +1098,11 @@
>
> static __always_inline u64 drdtime(void)
> {
> - int rID = 0;
> u64 val = 0;
>
> __asm__ __volatile__(
> - "rdtime.d %0, %1 \n\t"
> - : "=r"(val), "=r"(rID)
> + "rdtime.d %0, $zero\n\t"
> + : "=r"(val)
> :
> );
> return val;
--
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Ping: [PATCH] LoongArch: Slightly clean up drdtime
2023-12-05 8:01 ` Ping: " Xi Ruoyao
@ 2023-12-05 8:07 ` Huacai Chen
0 siblings, 0 replies; 3+ messages in thread
From: Huacai Chen @ 2023-12-05 8:07 UTC (permalink / raw)
To: Xi Ruoyao; +Cc: WANG Xuerui, loongarch, linux-kernel
Queued, thanks.
Huacai
On Tue, Dec 5, 2023 at 4:01 PM Xi Ruoyao <xry111@xry111.site> wrote:
>
> Ping.
>
> On Sun, 2023-11-26 at 20:17 +0800, Xi Ruoyao wrote:
> > As we are just discarding the stable clock ID, simply write it into
> > $zero instead of allocating a temporary register.
> >
> > Signed-off-by: Xi Ruoyao <xry111@xry111.site>
> > ---
> > arch/loongarch/include/asm/loongarch.h | 5 ++---
> > 1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/loongarch/include/asm/loongarch.h b/arch/loongarch/include/asm/loongarch.h
> > index 9b4957cefa8a..46366e783c84 100644
> > --- a/arch/loongarch/include/asm/loongarch.h
> > +++ b/arch/loongarch/include/asm/loongarch.h
> > @@ -1098,12 +1098,11 @@
> >
> > static __always_inline u64 drdtime(void)
> > {
> > - int rID = 0;
> > u64 val = 0;
> >
> > __asm__ __volatile__(
> > - "rdtime.d %0, %1 \n\t"
> > - : "=r"(val), "=r"(rID)
> > + "rdtime.d %0, $zero\n\t"
> > + : "=r"(val)
> > :
> > );
> > return val;
>
> --
> Xi Ruoyao <xry111@xry111.site>
> School of Aerospace Science and Technology, Xidian University
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-12-05 8:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-26 12:17 [PATCH] LoongArch: Slightly clean up drdtime Xi Ruoyao
2023-12-05 8:01 ` Ping: " Xi Ruoyao
2023-12-05 8:07 ` Huacai Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®