[PATCH] [PATCH][ARM] Fix issue with UMLAL (unsigned multiple accumulate long) lowering

Jyoti Allur jyoti.allur at samsung.com
Wed May 20 08:15:20 PDT 2015


Hi jmolloy, t.p.northover,

[ARM] This patch addresses following issue.

```
unsigned long long
foo (unsigned long long a, unsigned char *b, unsigned short *c)
{
  return a + *b * *c;
}

```
Should compile to use UMLAL ((unsigned multiple accumulate long) which multiplies two unsigned 32-bit values to produce a 64-bit value, and accumulates this with a 64-bit value.


```
foo:
        ldrb    r2, [r2]
        ldrh    r3, [r3]
        mul     r2, r3, r2
        adds    r0, r2, r0
        adc     r1, r1, #0
        bx      lr
```

The above is reduced to following with this patch:

```
foo: 
        ldrb    r2, [r2]
        ldrh    r3, [r3]
        umlal   r0, r1, r3, r2
        bx      lr
```

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D9881

Files:
  ../../llvm/lib/Target/ARM/ARMISelLowering.cpp
  ../../llvm/test/CodeGen/ARM/longMAC.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9881.26152.patch
Type: text/x-patch
Size: 6950 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150520/529b6950/attachment.bin>


More information about the llvm-commits mailing list