[PATCH] D125506: [PowerPC] Implement XL compat __fnabs and __fnabss builtins.

Lei Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 11:56:41 PDT 2022


lei accepted this revision.
lei added a comment.
This revision is now accepted and ready to land.

LGTM with minor updates before commit.



================
Comment at: clang/test/CodeGen/PowerPC/builtins-ppc-xlcompat-fnabs.c:25
+// RUN: %clang_cc1 -no-opaque-pointers -triple powerpc-unknown-aix \
+// RUN:   -emit-llvm %s -target-cpu pwr6 -o - | FileCheck %s
+
----------------
Since we emit `xsnabsdp` for pwr7 and above I don't think it's necessary to have all combination tested on both pwr7 and pwr8.



================
Comment at: llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-fnabs.ll:24
+
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
+; RUN:   -mattr=-vsx < %s | FileCheck %s --check-prefix=CHECK-NOVSX
----------------
I think the default pwr level is lower then pwr6 which means it's no vsx by default.  Maybe add `pwr[7|8]` to these test lines to test the `-vsx` attr?


================
Comment at: llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-fnabs.ll:45
+; CHECK-PWR6-NEXT:    fnabs 1, 1
+; CHECK-PWR6-NEXT:    blr
+;
----------------
probably don't need both NOVSX and PWR6 checks since they are the same.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125506/new/

https://reviews.llvm.org/D125506



More information about the llvm-commits mailing list