[PATCH] D102839: [RISCV][Clang] Add -mno-idiv option to disable hardware int division

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat May 22 20:05:31 PDT 2021


craig.topper added a comment.

Isn't the gcc name for this -mno-div? Should we be consistent?



================
Comment at: clang/lib/Basic/Targets/RISCV.cpp:154
+  if (DisableHardwareIntDiv) {
+    Builder.defineMacro("__riscv_no_idiv");
   }
----------------
Does gcc also have this define? Why do we need this in addition to not defining __riscv_div. 


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:216
     if (Subtarget.is64Bit()) {
       setOperationAction(ISD::MUL, MVT::i32, Custom);
       setOperationAction(ISD::MUL, MVT::i128, Custom);
----------------
These MUL lines are affected by the disableHardwareIntDiv above. Please split mul and div handling apart.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102839



More information about the cfe-commits mailing list