Author: Jinsong Ji Date: 2021-10-15T16:23:04Z New Revision: 42eea2b69bb99415f5116ca8e28efdd5f836a03b
URL: https://github.com/llvm/llvm-project/commit/42eea2b69bb99415f5116ca8e28efdd5f836a03b DIFF: https://github.com/llvm/llvm-project/commit/42eea2b69bb99415f5116ca8e28efdd5f836a03b.diff LOG: [AIX] Enable int128 in 64 bit mode This patch remove the override in AIX target, so the int128 is enabled in 64 bit mode or with ForceEnableInt128. Reviewed By: lkail Differential Revision: https://reviews.llvm.org/D111078 Added: Modified: clang/lib/Basic/Targets/OSTargets.h clang/test/AST/ast-print-int128.cpp clang/test/Analysis/sval-dump-int128.c clang/test/CodeGen/dbg-const-int128.c clang/test/CodeGen/debug-info.c clang/test/CodeGen/extend-arg-64.c clang/test/CodeGen/ppc-varargs-struct.c clang/test/CodeGen/uint128_t.c clang/test/CodeGenCXX/debug-info-enum-i128.cpp clang/test/Driver/types.c clang/test/Preprocessor/init-ppc64.c clang/test/Sema/128bitint.c clang/test/Sema/const-eval.c clang/test/Sema/redefine_extname.c clang/test/Sema/types.c llvm/test/CodeGen/PowerPC/ctrloop-i128.ll llvm/test/CodeGen/PowerPC/int128_ldst.ll llvm/test/CodeGen/PowerPC/ppc64-i128-abi.ll Removed: ################################################################################ diff --git a/clang/lib/Basic/Targets/OSTargets.h b/clang/lib/Basic/Targets/OSTargets.h index 220290c1bacf..3adb12568eea 100644 --- a/clang/lib/Basic/Targets/OSTargets.h +++ b/clang/lib/Basic/Targets/OSTargets.h @@ -743,7 +743,6 @@ class AIXTargetInfo : public OSTargetInfo<Target> { // AIX sets FLT_EVAL_METHOD to be 1. unsigned getFloatEvalMethod() const override { return 1; } - bool hasInt128Type() const override { return false; } bool defaultsToAIXPowerAlignment() const override { return true; } }; diff --git a/clang/test/AST/ast-print-int128.cpp b/clang/test/AST/ast-print-int128.cpp index 51d15b609f0b..8086ea7c751a 100644 --- a/clang/test/AST/ast-print-int128.cpp +++ b/clang/test/AST/ast-print-int128.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -ast-print -std=c++20 %s -o - -triple x86_64-linux | FileCheck %s +// RUN: %clang_cc1 -ast-print -std=c++20 %s -o - -triple powerpc64-ibm-aix-xcoff | FileCheck %s template <bool> struct enable_if { diff --git a/clang/test/Analysis/sval-dump-int128.c b/clang/test/Analysis/sval-dump-int128.c index 3c28f1bd1bb6..82f2fe37c2e8 100644 --- a/clang/test/Analysis/sval-dump-int128.c +++ b/clang/test/Analysis/sval-dump-int128.c @@ -1,4 +1,5 @@ // RUN: %clang_analyze_cc1 -triple x86_64-linux-gnu -analyzer-checker=debug.ExprInspection %s -verify +// RUN: %clang_analyze_cc1 -triple powerpc64-ibm-aix-xcoff -analyzer-checker=debug.ExprInspection %s -verify void clang_analyzer_dump(unsigned __int128 x); diff --git a/clang/test/CodeGen/dbg-const-int128.c b/clang/test/CodeGen/dbg-const-int128.c index 966c22705500..0af788e26304 100644 --- a/clang/test/CodeGen/dbg-const-int128.c +++ b/clang/test/CodeGen/dbg-const-int128.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux -S -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -S -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s // CHECK: !DIGlobalVariable({{.*}} // CHECK-NOT: expr: diff --git a/clang/test/CodeGen/debug-info.c b/clang/test/CodeGen/debug-info.c index 0958f4d0298e..8850ed4a4daa 100644 --- a/clang/test/CodeGen/debug-info.c +++ b/clang/test/CodeGen/debug-info.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -triple x86_64-unk-unk -o - -emit-llvm -debug-info-kind=limited %s | FileCheck %s +// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -o - -emit-llvm -debug-info-kind=limited %s | FileCheck %s // PR3023 void convert(void) { diff --git a/clang/test/CodeGen/extend-arg-64.c b/clang/test/CodeGen/extend-arg-64.c index 85b70e0238cb..8cdbda8e4ff5 100644 --- a/clang/test/CodeGen/extend-arg-64.c +++ b/clang/test/CodeGen/extend-arg-64.c @@ -16,6 +16,12 @@ // RUN: %s -emit-llvm -o - | FileCheck %s \ // RUN: --implicit-check-not "ext {{.*}}to i64" +// The option isn't supported on ppc, no effect +// RUN: %clang_cc1 -DD128 -triple powerpc64-ibm-aix-xcoff -fextend-arguments=64 \ +// RUN: %s -emit-llvm -o - | FileCheck %s \ +// RUN: --implicit-check-not "ext {{.*}}to i64" + + int vararg(int, ...); void knr(); diff --git a/clang/test/CodeGen/ppc-varargs-struct.c b/clang/test/CodeGen/ppc-varargs-struct.c index c201074e1fd9..9a54c47a067e 100644 --- a/clang/test/CodeGen/ppc-varargs-struct.c +++ b/clang/test/CodeGen/ppc-varargs-struct.c @@ -2,6 +2,7 @@ // REQUIRES: asserts // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s // RUN: %clang_cc1 -triple powerpc-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-PPC +// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -emit-llvm -o - %s | FileCheck %s #include <stdarg.h> diff --git a/clang/test/CodeGen/uint128_t.c b/clang/test/CodeGen/uint128_t.c index 92cb5faba4a0..4a11eca9d5e4 100644 --- a/clang/test/CodeGen/uint128_t.c +++ b/clang/test/CodeGen/uint128_t.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-apple-darwin9 +// RUN: %clang_cc1 %s -emit-llvm -o - -triple=powerpc64-ibm-aix-xcoff typedef unsigned long long uint64_t; extern uint64_t numer; diff --git a/clang/test/CodeGenCXX/debug-info-enum-i128.cpp b/clang/test/CodeGenCXX/debug-info-enum-i128.cpp index ca6f2f406c05..92bf8eba873c 100644 --- a/clang/test/CodeGenCXX/debug-info-enum-i128.cpp +++ b/clang/test/CodeGenCXX/debug-info-enum-i128.cpp @@ -1,5 +1,6 @@ // RUN: %clang_cc1 %s -triple x86_64-windows-msvc -gcodeview -debug-info-kind=limited -emit-llvm -o - | FileCheck %s // RUN: %clang_cc1 %s -triple x86_64-linux-gnu -debug-info-kind=limited -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -triple powerpc64-ibm-aix-xcoff -debug-info-kind=limited -emit-llvm -o - | FileCheck %s // FIXME: llvm.org/pr51221, the APSInt leaks // UNSUPPORTED: asan diff --git a/clang/test/Driver/types.c b/clang/test/Driver/types.c index 75b81d81c5e0..febce5c709ea 100644 --- a/clang/test/Driver/types.c +++ b/clang/test/Driver/types.c @@ -12,8 +12,8 @@ // RUN: not %clang -c --target=powerpc-ibm-aix -fsyntax-only %s \ // RUN: 2>&1 | FileCheck %s -// RUN: not %clang -c --target=powerpc64-ibm-aix -fsyntax-only %s \ -// RUN: 2>&1 | FileCheck %s +// RUN: %clang -c --target=powerpc64-ibm-aix -fsyntax-only %s \ +// RUN: 2>&1 void a() { __int128_t s; diff --git a/clang/test/Preprocessor/init-ppc64.c b/clang/test/Preprocessor/init-ppc64.c index ca9029d6cab5..7a9525228c3b 100644 --- a/clang/test/Preprocessor/init-ppc64.c +++ b/clang/test/Preprocessor/init-ppc64.c @@ -811,6 +811,7 @@ // PPC64-AIX:#define __SIG_ATOMIC_WIDTH__ 32 // PPC64-AIX:#define __SIZEOF_DOUBLE__ 8 // PPC64-AIX:#define __SIZEOF_FLOAT__ 4 +// PPC64-AIX:#define __SIZEOF_INT128__ 16 // PPC64-AIX:#define __SIZEOF_INT__ 4 // PPC64-AIX:#define __SIZEOF_LONG_DOUBLE__ 8 // PPC64-AIX:#define __SIZEOF_LONG_LONG__ 8 diff --git a/clang/test/Sema/128bitint.c b/clang/test/Sema/128bitint.c index 45e1cd8d57ff..e5fb4ab77200 100644 --- a/clang/test/Sema/128bitint.c +++ b/clang/test/Sema/128bitint.c @@ -1,5 +1,7 @@ // RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-apple-darwin9 %s -DHAVE // RUN: %clang_cc1 -fsyntax-only -verify -triple i686-linux-gnu %s -DHAVE_NOT +// RUN: %clang_cc1 -fsyntax-only -verify -triple powerpc64-ibm-aix-xcoff %s -DHAVE +// RUN: %clang_cc1 -fsyntax-only -verify -triple powerpc-ibm-aix-xcoff %s -DHAVE_NOT #ifdef HAVE typedef int i128 __attribute__((__mode__(TI))); diff --git a/clang/test/Sema/const-eval.c b/clang/test/Sema/const-eval.c index bbba474748bc..7846a6e9f363 100644 --- a/clang/test/Sema/const-eval.c +++ b/clang/test/Sema/const-eval.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-linux %s -Wno-tautological-pointer-compare -Wno-pointer-to-int-cast +// RUN: %clang_cc1 -fsyntax-only -verify -triple powerpc64-ibm-aix-xcoff %s -Wno-tautological-pointer-compare -Wno-pointer-to-int-cast #define EVAL_EXPR(testno, expr) enum { test##testno = (expr) }; struct check_positive##testno { int a[test##testno]; }; int x; diff --git a/clang/test/Sema/redefine_extname.c b/clang/test/Sema/redefine_extname.c index b1e8dab9244f..b6984c16b086 100644 --- a/clang/test/Sema/redefine_extname.c +++ b/clang/test/Sema/redefine_extname.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -triple=x86_64-unknown-linux -Wpragmas -verify %s +// RUN: %clang_cc1 -triple=powerpc64-ibm-aix-xcoff -Wpragmas -verify %s // Check that pragma redefine_extname applies to external declarations only. #pragma redefine_extname foo_static bar_static diff --git a/clang/test/Sema/types.c b/clang/test/Sema/types.c index 177e5fbd9704..c306c1ead5c6 100644 --- a/clang/test/Sema/types.c +++ b/clang/test/Sema/types.c @@ -3,6 +3,7 @@ // RUN: %clang_cc1 %s -fblocks -pedantic -verify -triple=x86_64-unknown-linux // RUN: %clang_cc1 %s -fblocks -pedantic -verify -triple=x86_64-unknown-linux-gnux32 // RUN: %clang_cc1 %s -fblocks -pedantic -pedantic -verify -triple=arm64_32-apple-ios7.0 +// RUN: %clang_cc1 %s -fblocks -pedantic -verify -triple=powerpc64-ibm-aix-xcoff // rdar://6097662 typedef int (*T)[2]; diff --git a/llvm/test/CodeGen/PowerPC/ctrloop-i128.ll b/llvm/test/CodeGen/PowerPC/ctrloop-i128.ll index 8c1e0c160d30..a44f74fab110 100644 --- a/llvm/test/CodeGen/PowerPC/ctrloop-i128.ll +++ b/llvm/test/CodeGen/PowerPC/ctrloop-i128.ll @@ -1,6 +1,5 @@ -; RUN: llc -O1 -verify-machineinstrs < %s -target datalayout = "E-m:e-i64:64-n32:64" -target triple = "powerpc64-unknown-linux-gnu" +; RUN: llc -O1 -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s +; RUN: llc -O1 -verify-machineinstrs -mtriple=powerpc64-ibm-aix-xcoff < %s ; Function Attrs: uwtable define fastcc void @_Crash_Fn() unnamed_addr #0 { diff --git a/llvm/test/CodeGen/PowerPC/int128_ldst.ll b/llvm/test/CodeGen/PowerPC/int128_ldst.ll index f37829ee032d..f72c2c062b65 100644 --- a/llvm/test/CodeGen/PowerPC/int128_ldst.ll +++ b/llvm/test/CodeGen/PowerPC/int128_ldst.ll @@ -17,6 +17,9 @@ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \ ; RUN: -mcpu=pwr8 \ ; RUN: < %s | FileCheck %s --check-prefixes=CHECK,CHECK-PREP10,CHECK-P8 +; RUN: llc -verify-machineinstrs -mtriple=powerpc64-ibm-aix-xcoff \ +; RUN: -mcpu=pwr8 \ +; RUN: < %s | FileCheck %s --check-prefixes=CHECK,CHECK-PREP10,CHECK-P8 ; Function Attrs: norecurse nounwind readonly uwtable willreturn define dso_local i128 @ld_0___int128___int128(i64 %ptr) { diff --git a/llvm/test/CodeGen/PowerPC/ppc64-i128-abi.ll b/llvm/test/CodeGen/PowerPC/ppc64-i128-abi.ll index 1b4e8e4e8c71..f9a02343e02a 100644 --- a/llvm/test/CodeGen/PowerPC/ppc64-i128-abi.ll +++ b/llvm/test/CodeGen/PowerPC/ppc64-i128-abi.ll @@ -5,9 +5,15 @@ ; RUN: llc -relocation-model=pic -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \ ; RUN: -mcpu=pwr8 < %s | FileCheck %s -check-prefix=CHECK-BE +; RUN: llc -verify-machineinstrs -mtriple=powerpc64-ibm-aix-xcoff \ +; RUN: -mcpu=pwr8 < %s | FileCheck %s -check-prefix=CHECK-BE + ; RUN: llc -relocation-model=pic -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \ ; RUN: -mcpu=pwr8 -mattr=-vsx < %s | FileCheck %s -check-prefix=CHECK-NOVSX +; RUN: llc -verify-machineinstrs -mtriple=powerpc64-ibm-aix-xcoff \ +; RUN: -mcpu=pwr8 -mattr=-vsx < %s | FileCheck %s -check-prefix=CHECK-NOVSX + ; RUN: llc -relocation-model=pic -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \ ; RUN: -mcpu=pwr8 -mattr=-vsx < %s | FileCheck %s -check-prefix=CHECK-NOVSX \ ; RUN: --implicit-check-not xxswapd @@ -15,6 +21,9 @@ ; RUN: llc -relocation-model=pic -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \ ; RUN: -mcpu=pwr8 -mattr=-vsx < %s | FileCheck %s -check-prefix=CHECK-BE-NOVSX +; RUN: llc -verify-machineinstrs -mtriple=powerpc64-ibm-aix-xcoff \ +; RUN: -mcpu=pwr8 -mattr=-vsx < %s | FileCheck %s -check-prefix=CHECK-BE-NOVSX + ; RUN: llc -relocation-model=pic -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \ ; RUN: -mcpu=pwr8 -mattr=-vsx < %s | \ ; RUN: FileCheck %s -check-prefix=CHECK-LE-NOVSX --implicit-check-not xxswapd @@ -23,10 +32,16 @@ ; RUN: -mcpu=pwr9 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \ ; RUN: FileCheck %s -check-prefix=CHECK-P9 --implicit-check-not xxswapd +; RUN: llc -verify-machineinstrs -mtriple=powerpc64-ibm-aix-xcoff \ +; RUN: -mcpu=pwr9 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | FileCheck %s -check-prefix=CHECK-P9 + ; RUN: llc -relocation-model=pic -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \ ; RUN: -mcpu=pwr9 -mattr=-vsx < %s | FileCheck %s -check-prefix=CHECK-NOVSX \ ; RUN: --implicit-check-not xxswapd +; RUN: llc -verify-machineinstrs -mtriple=powerpc64-ibm-aix-xcoff \ +; RUN: -mcpu=pwr9 -mattr=-vsx < %s | FileCheck %s -check-prefix=CHECK-NOVSX + ; RUN: llc -relocation-model=pic -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \ ; RUN: -mcpu=pwr9 -mattr=-power9-vector -mattr=-direct-move < %s | \ ; RUN: FileCheck %s -check-prefix=CHECK-LE --implicit-check-not xxswapd @@ -208,19 +223,19 @@ define <1 x i128> @call_v1i128_increment_by_one() nounwind { ; CHECK-P9-LABEL: @call_v1i128_increment_by_one ; CHECK-P9: lxv -; CHECK-P9: bl v1i128_increment_by_one +; CHECK-P9: bl {{.?}}v1i128_increment_by_one ; CHECK-P9: blr ; CHECK-BE-LABEL: @call_v1i128_increment_by_one ; CHECK-BE: lxvw4x 34, {{[0-9]+}}, {{[0-9]+}} ; CHECK-BE-NOT: xxswapd 34, {{[0-9]+}} -; CHECK-BE: bl v1i128_increment_by_one +; CHECK-BE: bl {{.?}}v1i128_increment_by_one ; CHECK-BE: blr ; CHECK-NOVSX-LABEL: @call_v1i128_increment_by_one ; CHECK-NOVSX: lvx 2, {{[0-9]+}}, {{[0-9]+}} ; CHECK-NOVSX-NOT: xxswapd {{[0-9]+}}, {{[0-9]+}} -; CHECK-NOVSX: bl v1i128_increment_by_one +; CHECK-NOVSX: bl {{.?}}v1i128_increment_by_one ; CHECK-NOVSX: blr } @@ -239,7 +254,7 @@ define <1 x i128> @call_v1i128_increment_by_val() nounwind { ; CHECK-P9-LABEL: @call_v1i128_increment_by_val ; CHECK-P9-DAG: lxv v2 ; CHECK-P9-DAG: lxv v3 -; CHECK-P9: bl v1i128_increment_by_val +; CHECK-P9: bl {{.?}}v1i128_increment_by_val ; CHECK-P9: blr ; CHECK-BE-LABEL: @call_v1i128_increment_by_val @@ -248,7 +263,7 @@ define <1 x i128> @call_v1i128_increment_by_val() nounwind { ; CHECK-BE-DAG: lxvw4x 35, {{[0-9]+}}, {{[0-9]+}} ; CHECK-BE-NOT: xxswapd 34, {{[0-9]+}} ; CHECK-BE-NOT: xxswapd 35, {{[0-9]+}} -; CHECK-BE: bl v1i128_increment_by_val +; CHECK-BE: bl {{.?}}v1i128_increment_by_val ; CHECK-BE: blr ; CHECK-NOVSX-LABEL: @call_v1i128_increment_by_val @@ -256,7 +271,7 @@ define <1 x i128> @call_v1i128_increment_by_val() nounwind { ; CHECK-NOVSX-DAG: lvx 3, {{[0-9]+}}, {{[0-9]+}} ; CHECK-NOVSX-NOT: xxswapd 34, {{[0-9]+}} ; CHECK-NOVSX-NOT: xxswapd 35, {{[0-9]+}} -; CHECK-NOVSX: bl v1i128_increment_by_val +; CHECK-NOVSX: bl {{.?}}v1i128_increment_by_val ; CHECK-NOVSX: blr } @@ -275,13 +290,13 @@ define i128 @call_i128_increment_by_one() nounwind { ; CHECK-BE-LABEL: @call_i128_increment_by_one ; CHECK-BE-DAG: ld 3, 0([[BASEREG:[0-9]+]]) ; CHECK-BE-DAG: ld 4, 8([[BASEREG]]) -; CHECK-BE: bl i128_increment_by_one +; CHECK-BE: bl {{.?}}i128_increment_by_one ; CHECK-BE: blr ; CHECK-NOVSX-LABEL: @call_i128_increment_by_one ; CHECK-NOVSX-DAG: ld 3, 0([[BASEREG:[0-9]+]]) ; CHECK-NOVSX-DAG: ld 4, 8([[BASEREG]]) -; CHECK-NOVSX: bl i128_increment_by_one +; CHECK-NOVSX: bl {{.?}}i128_increment_by_one ; CHECK-NOVSX: blr } @@ -303,7 +318,7 @@ define i128 @call_i128_increment_by_val() nounwind { ; CHECK-BE-DAG: ld 4, 8([[P1BASEREG]]) ; CHECK-BE-DAG: ld 5, 0([[P2BASEREG:[0-9]+]]) ; CHECK-BE-DAG: ld 6, 8([[P2BASEREG]]) -; CHECK-BE: bl i128_increment_by_val +; CHECK-BE: bl {{.?}}i128_increment_by_val ; CHECK-BE: blr ; CHECK-NOVSX-LABEL: @call_i128_increment_by_val @@ -311,7 +326,7 @@ define i128 @call_i128_increment_by_val() nounwind { ; CHECK-NOVSX-DAG: ld 4, 8([[P1BASEREG]]) ; CHECK-NOVSX-DAG: ld 5, 0([[P2BASEREG:[0-9]+]]) ; CHECK-NOVSX-DAG: ld 6, 8([[P2BASEREG]]) -; CHECK-NOVSX: bl i128_increment_by_val +; CHECK-NOVSX: bl {{.?}}i128_increment_by_val ; CHECK-NOVSX: blr } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits