1 // WebAssemblyInstrRef.td - WebAssembly reference type codegen --*- tablegen -*-
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 /// WebAssembly refence type operand codegen constructs.
12 //===----------------------------------------------------------------------===//
14 defm SELECT_EXNREF : I<(outs EXNREF:$dst),
15 (ins EXNREF:$lhs, EXNREF:$rhs, I32:$cond),
18 (select I32:$cond, EXNREF:$lhs, EXNREF:$rhs))],
19 "exnref.select\t$dst, $lhs, $rhs, $cond",
20 "exnref.select", 0x1b>;
22 def : Pat<(select (i32 (setne I32:$cond, 0)), EXNREF:$lhs, EXNREF:$rhs),
23 (SELECT_EXNREF EXNREF:$lhs, EXNREF:$rhs, I32:$cond)>;
24 def : Pat<(select (i32 (seteq I32:$cond, 0)), EXNREF:$lhs, EXNREF:$rhs),
25 (SELECT_EXNREF EXNREF:$rhs, EXNREF:$lhs, I32:$cond)>;