File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -402,9 +402,13 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts,
402
402
Builder.defineMacro (" __VEC__" , " 10206" );
403
403
Builder.defineMacro (" __ALTIVEC__" );
404
404
}
405
- if (HasSPE) {
405
+ if (HasSPE)
406
406
Builder.defineMacro (" __SPE__" );
407
+ if (HasSPE || FloatABI == SoftFloat)
407
408
Builder.defineMacro (" __NO_FPRS__" );
409
+ if (FloatABI == SoftFloat) {
410
+ Builder.defineMacro (" _SOFT_FLOAT" );
411
+ Builder.defineMacro (" _SOFT_DOUBLE" );
408
412
}
409
413
if (HasVSX)
410
414
Builder.defineMacro (" __VSX__" );
@@ -439,14 +443,12 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts,
439
443
// FIXME: The following are not yet generated here by Clang, but are
440
444
// generated by GCC:
441
445
//
442
- // _SOFT_FLOAT_
443
446
// __RECIP_PRECISION__
444
447
// __APPLE_ALTIVEC__
445
448
// __RECIP__
446
449
// __RECIPF__
447
450
// __RSQRTE__
448
451
// __RSQRTEF__
449
- // _SOFT_DOUBLE_
450
452
// __NO_LWSYNC__
451
453
// __CMODEL_MEDIUM__
452
454
// __CMODEL_LARGE__
Original file line number Diff line number Diff line change 977
977
978
978
// RUN: %clang_cc1 -E -dM -triple=powerpc-unknown-openbsd -x c++ < /dev/null | FileCheck -match-full-lines -check-prefix PPC-OPENBSD-CXX %s
979
979
// PPC-OPENBSD-CXX: #define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16UL
980
+
981
+ // RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-unknown-linux-gnu -target-feature -hard-float < /dev/null | FileCheck -match-full-lines -check-prefix PPC-SOFTFLT %s
982
+ //
983
+ // PPC-SOFTFLT:#define _SOFT_DOUBLE 1
984
+ // PPC-SOFTFLT:#define _SOFT_FLOAT 1
985
+ // PPC-SOFTFLT:#define __NO_FPRS__ 1
Original file line number Diff line number Diff line change 1110
1110
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-freebsd < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-FREEBSD %s
1111
1111
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64le-unknown-freebsd < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-FREEBSD %s
1112
1112
// PPC64-FREEBSD-NOT: #define __LONG_DOUBLE_128__ 1
1113
+
1114
+ // RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-linux-gnu -target-feature -hard-float -xc /dev/null | FileCheck --check-prefix=PPC64-SOFTFLT %s
1115
+ // RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64le-unknown-linux-gnu -target-feature -hard-float -xc /dev/null | FileCheck --check-prefix=PPC64-SOFTFLT %s
1116
+ // PPC64-SOFTFLT:#define _SOFT_DOUBLE 1
1117
+ // PPC64-SOFTFLT:#define _SOFT_FLOAT 1
1118
+ // PPC64-SOFTFLT:#define __NO_FPRS__ 1
You can’t perform that action at this time.
0 commit comments