[PATCH] D105946: [PowerPC] Store, load, move from and to registers related builtins

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 16 03:41:28 PDT 2021


nemanjai requested changes to this revision.
nemanjai added a comment.
This revision now requires changes to proceed.

This is getting close to approval. The newly added `__stfiw` needs to be fixed and some nits need to be addressed.



================
Comment at: clang/lib/Sema/SemaChecking.cpp:3369
+  case PPC::BI__builtin_ppc_stfiw:
+    return SemaFeatureCheck(*this, TheCall, "isa-v30-instructions",
+                            diag::err_ppc_builtin_only_on_arch, "9");
----------------
This is not correct. The instruction (non-VSX version) has existed since Power3. The VSX version was added in Power8. No changes to the instruction came in Power9 so I have no idea where the decision to add this check came from.

In fact, this would also blow up in the back end if you compiled with something like `-mcpu=pwr9 -mno-altivec` or `-mcpu=pwr9 -mno-vsx`.


================
Comment at: llvm/include/llvm/IR/IntrinsicsPowerPC.td:1568
                                 [IntrWriteMem]>;
+  def int_ppc_sthcx : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty], [IntrWriteMem]>;
+  def int_ppc_dcbtstt : GCCBuiltin<"__builtin_ppc_dcbtstt">,
----------------
Nit: line too long.


================
Comment at: llvm/include/llvm/IR/IntrinsicsPowerPC.td:1577
+                      Intrinsic<[llvm_i32_ty], [], [IntrNoMem]>;
+def int_ppc_stfiw : GCCBuiltin<"__builtin_ppc_stfiw">,
+                    Intrinsic<[], [llvm_ptr_ty, llvm_double_ty], [IntrWriteMem]>;
----------------
Nit: indentation is inconsistent here.


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrVSX.td:4072
+
+def : Pat<(int_ppc_stfiw ForceXForm:$dst, f64:$XT),
+          (STXSIWX f64:$XT, ForceXForm:$dst)>;
----------------
This needs the non-VSX pattern as well.


================
Comment at: llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-stfiw.ll:1
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
----------------
One of the run lines should be with `-mattr=-vsx`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105946



More information about the llvm-commits mailing list