[PATCH] D27309: builtins: Add ARM Thumb1 implementation for uidiv and uidivmod

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 20:48:20 PST 2016


compnerd added inline comments.


================
Comment at: lib/builtins/arm/udivsi3.S:106
+	adr r0, LOCAL_LABEL(div0block)
+	adds r0, #1
+#    else
----------------
weimingz wrote:
> compnerd wrote:
> > Can we use or instead?
> in Thumb1, ORR doesn't support immediate values.
Hmm, do we have some way to guarantee that the thumb bit would never be set by the linker?  (at least with link, the linker will set the thumb bit on the relocation target if it is in the code section on a thumb block).


================
Comment at: lib/builtins/arm/udivsi3.S:200
+LOCAL_LABEL(block_skip_ ## shift): ;\
+	adcs r3, r3 /* same as ((r3 << 1) | Carry). Carry is set if r0 >= r2. */
+
----------------
Can you format this please?  (clang-format).


================
Comment at: lib/builtins/arm/udivsi3.S:254
 
+#if __ARM_ARCH_ISA_THUMB != 1
 LOCAL_LABEL(divby0):
----------------
Any reason to not just use the single definition of this label?  (as in just move it for both cases.


https://reviews.llvm.org/D27309





More information about the llvm-commits mailing list