<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - invalid instruction generated for atomic store of __int128 on aarch64"
   href="https://llvm.org/bugs/show_bug.cgi?id=27081">27081</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>invalid instruction generated for atomic store of __int128 on aarch64
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: AArch64
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>yyc1992@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following program generates an invalid instruction on llvm trunk.

```
#include <atomic>
#include <stdint.h>

std::atomic<__int128> a;

__attribute__((noinline)) void f(int64_t v)
{
    a.store(v);
}

int main()
{
    f(1);
    return 0;
}
```

The assembly is

```
0000000000400610 <_Z1fl>:
  400610:       90000089        adrp    x9, 410000 <__FRAME_END__+0xf8a0>
  400614:       937ffc08        asr     x8, x0, #63
  400618:       91278129        add     x9, x9, #0x9e0
  40061c:       c87ffd3f        ldaxp   xzr, xzr, [x9]
  400620:       c82aa120        stlxp   w10, x0, x8, [x9]
  400624:       35ffffca        cbnz    w10, 40061c <_Z1fl+0xc>
  400628:       d65f03c0        ret
```

And the `ldaxp` instruction raise a SIGILL.

(GCC raises a linker error in this case...)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>