[llvm-bugs] [Bug 38751] Missed optimization in 16-bit __builtin_add_overflow on aarch64

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 22 05:56:59 PDT 2018


Arnaud de Grandmaison <arnaud.degrandmaison at arm.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
 Fixed By Commit(s)|                            |344439

--- Comment #4 from Arnaud de Grandmaison <arnaud.degrandmaison at arm.com> ---
Closing this bug as commit r344439 fixed this issue :

$ cat pr38751.c
#include <stdint.h>

void g(int a, int b, int *c, int *o, int *v) {
  *o = __builtin_add_overflow((int16_t)a, (int16_t)b, (int16_t *)c);

$ bin/clang -target arm64 -c -O3 -o - -S pr38751.c
        sxth    w8, w0
        add     w8, w8, w1, sxth
        cmp     w8, w8, sxth
        cset    w9, ne
        strh    w8, [x2]
        str     w9, [x3]

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181022/fca5620f/attachment.html>

More information about the llvm-bugs mailing list