<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 - wasm32: Lowering of i32x4.lt may not handle sign extension"
   href="https://bugs.llvm.org/show_bug.cgi?id=39273">39273</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>wasm32: Lowering of i32x4.lt may not handle sign extension
          </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>alex@crichton.co
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, tlively@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>It looks like many of the comparison operations for wasm SIMD are all
implemented (nice!) but the tests largely return <4 x i1>. In the bindings
we're thinking of writing we'd like to match the intrinsics themselves in wasm,
which means returning <4 x i32>, and to that end we generate the following IR:


; ModuleID = 'foo.3a1fbbbh-cgu.0'
source_filename = "foo.3a1fbbbh-cgu.0"
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown"

; Function Attrs: norecurse nounwind readnone
define <4 x i32> @simd_lt(<4 x i32> %a, <4 x i32> %b) unnamed_addr #0 {
start:
  %0 = icmp eq <4 x i32> %a, %b
  %1 = sext <4 x i1> %0 to <4 x i32>
  ret <4 x i32> %1
}

attributes #0 = { norecurse nounwind readnone "target-features"="+simd128" }



when compiled though this yields:



$ llc foo.ll -filetype=obj
LLVM ERROR: Cannot select: t15: v4i32 = sign_extend_inreg t13,
ValueType:ch:v4i1
  t13: v4i32 = setcc t2, t4, seteq:ch
    t2: v4i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<0>
      t1: i32 = TargetConstant<0>
    t4: v4i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<1>
      t3: i32 = TargetConstant<1>
In function: simd_lt



This may not be the desired pattern though used to bind these intrinsics! We
certainly don't mind switching to different codegen.</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>