[PATCH] D124060: [PowerPC] Enable CR bits support for Power8 and above.

ChenZheng via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 25 23:55:26 PDT 2022

shchenz added a comment.

> This patch turns on support for CR bit accesses for Power8 and above. The reason why CR bits are turned on as the default for Power8 and above is that because later architectures make use of builtins and instructions that require CR bit accesses (such as the use of setbc in the vector string isolate predicate and bcd builtins on Power10).

Maybe we also can add some comments in `docs/ClangCommandLineReference.rst` to explicitly say that `-mcrbits` will be default to on when PowerPC arch is no smaller than 8. I believe some cr-bit operations also exist on Power7 or even Power6?

Comment at: clang/lib/Basic/Targets/PPC.cpp:519
+  Features["crbits"] = llvm::StringSwitch<bool>(CPU)
+                                .Case("ppc64le", true)
If we set the `+crbits` by the arch name, do we still need the customization (Turn on crbits for O2 and above) in `computeFSAdditions()`? 

Comment at: clang/test/Driver/ppc-crbits.cpp:50
+// RUN: %clang -target powerpc64le-unknown-linux-gnu -mcpu=pwr7 -mno-crbits \
+// RUN:   -emit-llvm -S %s -o - | FileCheck %s --check-prefix=HAS-NOCRBITS
Do we need some cases for AIX?

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list