From: Huacai Chen <chenhuacai@kernel.org>
To: Xi Ruoyao <xry111@xry111.site>
Cc: Huacai Chen <chenhuacai@loongson.cn>,
loongarch@lists.linux.dev, Xuefeng Li <lixuefeng@loongson.cn>,
Tiezhu Yang <yangtiezhu@loongson.cn>, Guo Ren <guoren@kernel.org>,
Xuerui Wang <kernel@xen0n.name>,
Jiaxun Yang <jiaxun.yang@flygoat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] LoongArch: Add unaligned access support
Date: Mon, 17 Oct 2022 08:16:53 +0800 [thread overview]
Message-ID: <CAAhV-H4vGt4MTXCyiSnn7cQFrxR-amLC4nKe7-EcLyT8G-Ciqg@mail.gmail.com> (raw)
In-Reply-To: <c1b674a37a1a04f9c84df1e9a227db68bf78e922.camel@xry111.site>
Hi, Ruoyao,
On Sun, Oct 16, 2022 at 11:05 PM Xi Ruoyao <xry111@xry111.site> wrote:
>
> On Sun, 2022-10-16 at 21:34 +0800, Huacai Chen wrote:
>
> > Loongson-2 series (Loongson-2K500, Loongson-2K1000)
>
> "2K1000LA"? "2K1000" is puzzling because of a name conflict with the
> MIPS-based model.
Technically this is correct, both MIPS-based and LoongArch-based
Loongson-2K1000 have no hardware support.
>
> /* snip */
>
> > +static inline unsigned long read_fpr(unsigned int fd)
> > +{
> > +#define READ_FPR(fd, __value) \
> > +{ \
>
> Unnecessary curly brace pair.
OK,thanks.
>
> > + __asm__ __volatile__( \
> > + "movfr2gr.d\t%0, $f%1\n\t" \
> > + : "=r"(__value) : "i"(fd)); \
> > +}
>
> I'm not sure if this is a correct use of "i" constraint. Maybe we
> should just concatenate the string?
OK, thanks.
Huacai
>
> "movfr2gr.d\t%0, $f" #fd "\n\t"
>
> > +
> > + unsigned long __value;
> > +
> > + switch (fd) {
>
> I don't like this "very long" switch statement, but it seems we have no
> way to make it better...
>
> > + case 0:
> > + READ_FPR(0, __value);
> > + break;
> > + case 1:
> > + READ_FPR(1, __value);
> > + break;
> > + case 2:
> > + READ_FPR(2, __value);
> > + break;
>
> --
> Xi Ruoyao <xry111@xry111.site>
> School of Aerospace Science and Technology, Xidian University
next prev parent reply other threads:[~2022-10-17 0:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-16 13:34 [PATCH] LoongArch: Add unaligned access support Huacai Chen
2022-10-16 15:04 ` Xi Ruoyao
2022-10-17 0:16 ` Huacai Chen [this message]
2022-10-17 5:49 ` WANG Xuerui
2022-10-17 7:12 ` Arnd Bergmann
2022-10-17 7:31 ` Huacai Chen
2022-10-17 7:38 ` Arnd Bergmann
2022-10-17 8:05 ` WANG Xuerui
2022-10-17 8:22 ` Arnd Bergmann
2022-10-17 8:13 ` Xi Ruoyao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAAhV-H4vGt4MTXCyiSnn7cQFrxR-amLC4nKe7-EcLyT8G-Ciqg@mail.gmail.com \
--to=chenhuacai@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=guoren@kernel.org \
--cc=jiaxun.yang@flygoat.com \
--cc=kernel@xen0n.name \
--cc=linux-kernel@vger.kernel.org \
--cc=lixuefeng@loongson.cn \
--cc=loongarch@lists.linux.dev \
--cc=xry111@xry111.site \
--cc=yangtiezhu@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).