<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - [SIMD] *dest = vec[lane] should generate store*_lane instruction"
   href="https://bugs.llvm.org/show_bug.cgi?id=50800">50800</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[SIMD] *dest = vec[lane] should generate store*_lane instruction
          </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>Windows NT
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

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

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

        <tr>
          <th>Reporter</th>
          <td>clang@evan.coeusgroup.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This is very similar to #50792 (which is the load*_lane version, this is for
store*_lane).  Both are blocking the implementation of overloaded functions for
these operations in WAV.

Assigning an element from a vector to a pointer should use one of the
v128.store*_lane instructions, but right now uses an extract_lane and a scalar
store.

Example (Compiler Explorer: <a href="https://godbolt.org/z/a1cz8hexW">https://godbolt.org/z/a1cz8hexW</a>):


#include <stdint.h>

typedef int8_t i8x16 __attribute__((__vector_size__(16)));
typedef int16_t i16x8 __attribute__((__vector_size__(16)));
typedef int32_t i32x4 __attribute__((__vector_size__(16)));
typedef int64_t i64x2 __attribute__((__vector_size__(16)));

void
i8x16_store_lane(int8_t * dest, i8x16 src) {
    *dest = src[1];
}

void
i16x8_store_lane(int16_t * dest, i16x8 src) {
    *dest = src[1];
}

void
i32x4_store_lane(int32_t * dest, i32x4 src) {
    *dest = src[1];
}

void
i64x2_store_lane(int64_t * dest, i64x2 src) {
    *dest = src[1];
}

void
i8x16_load_lane_intrin(int8_t * dest, i8x16 src) {
    __builtin_wasm_store8_lane(dest, src, 1);
}

void
i16x8_load_lane_intrin(int16_t * dest, i16x8 src) {
    __builtin_wasm_store16_lane(dest, src, 1);
}

void
i32x4_load_lane_intrin(int32_t * dest, i32x4 src) {
    __builtin_wasm_store32_lane(dest, src, 1);
}

void
i64x2_load_lane_intrin(int64_t * dest, i64x2 src) {
    __builtin_wasm_store64_lane(dest, src, 1);
}</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>