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