mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@xry111.site>
To: Huacai Chen <chenhuacai@loongson.cn>,
	Huacai Chen <chenhuacai@kernel.org>
Cc: 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: Sun, 16 Oct 2022 23:04:42 +0800	[thread overview]
Message-ID: <c1b674a37a1a04f9c84df1e9a227db68bf78e922.camel@xry111.site> (raw)
In-Reply-To: <20221016133418.2122777-1-chenhuacai@loongson.cn>

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.

/* snip */

> +static inline unsigned long read_fpr(unsigned int fd)
> +{
> +#define READ_FPR(fd, __value)          \
> +{                                      \

Unnecessary curly brace pair.

> +       __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?

"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

  reply	other threads:[~2022-10-16 15:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-16 13:34 Huacai Chen
2022-10-16 15:04 ` Xi Ruoyao [this message]
2022-10-17  0:16   ` Huacai Chen
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=c1b674a37a1a04f9c84df1e9a227db68bf78e922.camel@xry111.site \
    --to=xry111@xry111.site \
    --cc=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=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

all inboxes | Powered by JetHome®