[llvm-bugs] [Bug 50799] New: [SIMD] Creating a vector from dereferenced pointer and zeros should use v128.load32/64_zero

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 22 08:11:09 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50799

            Bug ID: 50799
           Summary: [SIMD] Creating a vector from dereferenced pointer and
                    zeros should use v128.load32/64_zero
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: WebAssembly
          Assignee: unassignedbugs at nondot.org
          Reporter: clang at evan.coeusgroup.com
                CC: llvm-bugs at lists.llvm.org

Currently the compiler will generate a scalar load and a vector replace_lane. 
Example (Compiler Explorer: https://godbolt.org/z/bfv3nY6ro):



#include <stdint.h>

#pragma clang diagnostic ignored "-Wmissing-prototypes"

typedef int32_t i32x4 __attribute__((__vector_size__(16)));
typedef int64_t i64x2 __attribute__((__vector_size__(16)));

i32x4
load32_zero(const int32_t * a) {
  return (i32x4) { *a, 0, 0, 0 };
}

i64x2
load64_zero(const int64_t * a) {
  return (i64x2) { *a, 0 };
}

i32x4
load32_zero_intrin(const int32_t * a) {
    return __builtin_wasm_load32_zero(a);
}

i64x2
load64_zero_intrin(const int64_t * a) {
    return __builtin_wasm_load64_zero(a);
}

-- 
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/20210622/2f9336e8/attachment.html>


More information about the llvm-bugs mailing list