[PATCH] EABI Divmod Legal

Renato Golin renato.golin at linaro.org
Tue Sep 10 02:42:03 PDT 2013



================
Comment at: test/CodeGen/ARM/divmod-eabi.ll:99
@@ -98,3 +98,3 @@
 
-; FIXME: AEABI is not lowering long u/srem into u/ldivmod
+; FIXME: Not joining DIV+REM for 64-bits
 define i64 @longf(i64 %a, i64 %b) {
----------------
This fixme is wrong, ignore

================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:698
@@ -698,2 +698,2 @@
   // FIXME: Also set divmod for SREM on EABI
   setOperationAction(ISD::SREM,  MVT::i32, Expand);
----------------
This fixme is also wrong, ignore

================
Comment at: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1935
@@ -1922,1 +1934,3 @@
+  }
+
   TargetLowering::
----------------
Amaury de la Vieuville wrote:
> If you leave it this way, you probably need to add all this to the SDNode* overload of ExpandLibCall as well (right above).
That's a good point, I'll look into that.

================
Comment at: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:3380
@@ -3332,1 +3379,3 @@
+      Tmp1 = ExpandLibCall(LC, VT, Args, 2, isSigned, dl);
+    }
     Results.push_back(Tmp1);
----------------
Amaury de la Vieuville wrote:
> Do you still need this? Isn't ExpandIntLibcall able to handle this now?
ExpandIntLibcall calls another Libcall function, but that should be solved by replicating the same thing on that, too.

================
Comment at: test/CodeGen/ARM/divmod-eabi.ll:109
@@ -108,1 +108,3 @@
+; EABI: mov [[div2:r[0-9]+]], r1
+; EABI: __aeabi_ldivmod
 ; GNU: __aeabi_ldivmod
----------------
Amaury de la Vieuville wrote:
> I think the part checking the remainder registers is missing here.
some of the checks were omitted because they may be fragile (order of registers/instructions). I'll try to come up with a stronger check on this.


http://llvm-reviews.chandlerc.com/D1575



More information about the llvm-commits mailing list