[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c1b674a37a1a04f9c84df1e9a227db68bf78e922.camel@xry111.site>
Date: Sun, 16 Oct 2022 23:04:42 +0800
From: Xi Ruoyao <xry111@...111.site>
To: Huacai Chen <chenhuacai@...ngson.cn>,
Huacai Chen <chenhuacai@...nel.org>
Cc: loongarch@...ts.linux.dev, Xuefeng Li <lixuefeng@...ngson.cn>,
Tiezhu Yang <yangtiezhu@...ngson.cn>,
Guo Ren <guoren@...nel.org>, Xuerui Wang <kernel@...0n.name>,
Jiaxun Yang <jiaxun.yang@...goat.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] LoongArch: Add unaligned access support
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@...111.site>
School of Aerospace Science and Technology, Xidian University
Powered by blists - more mailing lists