[clang] [llvm] [MIPS] LLVM data layout give i128 an alignment of 16 for mips64 (PR #112084)

via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 15 20:03:33 PDT 2024


yingopq wrote:

> Also, what alignment does clang use for o32 with ForceEnableInt128

I did test about o32 with ForceEnableInt128:
```
$ cat 1.c
#include <stdio.h>

int main()
{
    printf("alignment of int128: %zd\n", _Alignof(__int128));
    return 0;
}

$ sudo ./build/bin/clang -target mipsel-unknown-linux-gnu -fforce-enable-int128 -emit-llvm -S 1.c
$ sudo ./build/bin/llc -march=mipsel -target-abi o32 -relocation-model=pic 1.ll
$ sudo ./build/bin/clang -target mipsel-unknown-linux-gnu -fPIC -pthread 1.s -o a1main

root at debian-sid-mipsel:~# ./a1main 
alignment of int128: 16

root at debian-sid-mipsel:~# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/mipsel-linux-gnu/12/lto-wrapper
Target: mipsel-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 12.2.0-14' --with-bugurl=file:///usr/share/doc/gcc-12/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-12 --program-prefix=mipsel-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libsanitizer --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-multilib --with-arch-32=mips32r2 --with-fp-32=xx --with-madd4=no --with-lxc1-sxc1=no --enable-targets=all --with-arch-64=mips64r2 --enable-checking=release --build=mipsel-linux-gnu --host=mipsel-linux-gnu --target=mipsel-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (Debian 12.2.0-14) 

```
> Possibly we need to specify the alignment in that case as well to cover that option.

Thanks for your reminder, I would add this.

https://github.com/llvm/llvm-project/pull/112084


More information about the cfe-commits mailing list