[PATCH] Use ".arch_extension" ARM directive to specify the additional CPU features

Renato Golin renato.golin at linaro.org
Wed Feb 4 06:42:43 PST 2015


Hi Sumanth,

The patch is looking good, thanks!

I'm just wondering if you could end up having a Krait with HDIV only in ARM and chose Thumb2. If so, than my comments need addressing.

cheers,
--renato


================
Comment at: lib/Target/ARM/ARMAsmPrinter.cpp:682
@@ +681,3 @@
+  // Enable hwdiv through ".arch_extension idiv"
+  if (Subtarget->isKrait() && (Subtarget->hasDivide()
+      || Subtarget->hasDivideInARMMode()))
----------------
shouldn't you check here based on the instruction set you're using? Something like:

    if (Subtarget->isKrait() && (
        Subtarget->hasDivide() ||
        (!Subtarget->isThumb() && Subtarget->hasDivideInARMMode())
      )

To make sure we don't turn it on when it's thumb and it only has div on ARM.

================
Comment at: test/CodeGen/ARM/krait-cpu-div-attribute.ll:11
@@ +10,3 @@
+; RUN: llc < %s -mcpu=krait -mattr=+v7,+thumb-mode,-vfp4,-hwdiv,+vfp3,-hwdiv-arm | FileCheck %s --check-prefix=NODIV_KRAIT
+; RUN: llc <%s -mcpu=krait -mattr=-v7,+v6,-hwdiv,-hwdiv-arm,-vfp4,-vfp3,+vfp2,-neon,-t2dsp,+slowfpvmlx,-aclass,-trustzone | FileCheck %s --check-prefix=NODIV_KRAIT
+
----------------
If the above change is needed (checking for ISA on hdiv), then we'll need the corresponding lines here.

http://reviews.llvm.org/D7316

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list