All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: wuruilong <wuruilong@loongson.cn>
Cc: linux-sparse@vger.kernel.org
Subject: Re: [ Patch 001 ] feature: add support for loongarch
Date: Wed, 4 Sep 2024 08:39:43 +0300	[thread overview]
Message-ID: <f687e64e-d653-46a3-a302-68aa4a021215@stanley.mountain> (raw)
In-Reply-To: <c35dc58e-444f-0809-67cc-113d6b4b29be@loongson.cn>

On Fri, May 24, 2024 at 10:47:23AM +0800, wuruilong wrote:
> +const struct target target_loongarch64 = {
> +	.mach = MACH_LOONGARCH64,
> +	.bitness = ARCH_LP64,
> +
> +	.big_endian = 0,

No need to initialize things to zero.

> +	.unsigned_char = 1,

According to
https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html
"For all base ABI types of LoongArch, the char datatype is signed by default."
Is the webpage wrong?

> +	.has_int128 = 1,
> +
> +	.predefine = predefine_loongarch64,
> +};
> diff --git a/target.c b/target.c
> index 8ae22d74..0e075d59 100644
> --- a/target.c
> +++ b/target.c
> @@ -94,6 +94,7 @@ static const struct target *targets[] = {
>  	[MACH_PPC64] =		&target_ppc64,
>  	[MACH_RISCV32] =	&target_riscv32,
>  	[MACH_RISCV64] =	&target_riscv64,
> +	[MACH_LOONGARCH64] =    &target_loongarch64,
>  	[MACH_S390] =		&target_s390,
>  	[MACH_S390X] =		&target_s390x,
>  	[MACH_SH] =		&target_sh,
> @@ -112,29 +113,30 @@ enum machine target_parse(const char *name)
>  		enum machine mach;
>  		char bits;
>  	} archs[] = {
> -		{ "alpha",	MACH_ALPHA,	64, },
> -		{ "aarch64",	MACH_ARM64,	64, },
> -		{ "arm64",	MACH_ARM64,	64, },
> -		{ "arm",	MACH_ARM,	32, },
> -		{ "bfin",	MACH_BFIN,	32, },
> -		{ "h8300",	MACH_H8300,	32, },
> -		{ "i386",	MACH_I386,	32, },
> -		{ "m68k",	MACH_M68K,	32, },
> -		{ "microblaze",	MACH_MICROBLAZE,32, },
> -		{ "mips",	MACH_MIPS32,	0,  },
> -		{ "nds32",	MACH_NDS32,	32, },
> -		{ "nios2",	MACH_NIOS2,	32, },
> -		{ "openrisc",	MACH_OPENRISC,	32, },
> -		{ "powerpc",	MACH_PPC32,	0,  },
> -		{ "ppc",	MACH_PPC32,	0,  },
> -		{ "riscv",	MACH_RISCV32,	0,  },
> -		{ "s390x",	MACH_S390X,	64, },
> -		{ "s390",	MACH_S390,	32, },
> -		{ "sparc",	MACH_SPARC32,	0,  },
> -		{ "x86_64",	MACH_X86_64,	64, },
> -		{ "x86-64",	MACH_X86_64,	64, },
> -		{ "sh",		MACH_SH,	32, },
> -		{ "xtensa",	MACH_XTENSA,	32, },
> +		{ "alpha",	MACH_ALPHA,	 64, },
> +		{ "aarch64",	MACH_ARM64,	 64, },
> +		{ "arm64",	MACH_ARM64,	 64, },
> +		{ "arm",	MACH_ARM,	 32, },
> +		{ "bfin",	MACH_BFIN,	 32, },
> +		{ "h8300",	MACH_H8300,	 32, },
> +		{ "i386",	MACH_I386,	 32, },
> +		{ "loongarch64",MACH_LOONGARCH64,64, },

Add spaces after the commas, especially if we're going to re-indent the whole
table anyway.

regards,
dan carpenter



  parent reply	other threads:[~2024-09-04  5:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-24  2:47 [ Patch 001 ] feature: add support for loongarch wuruilong
2024-09-03 21:15 ` Uwe Kleine-König
2024-09-04  5:39 ` Dan Carpenter [this message]
2024-09-04  9:21   ` Uwe Kleine-König
2024-09-04  9:32     ` Dan Carpenter

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=f687e64e-d653-46a3-a302-68aa4a021215@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=wuruilong@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.