1 // WebAssemblyInstrExceptRef.td-WebAssembly except_ref 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 except_ref operand code-gen constructs.
12 //===----------------------------------------------------------------------===//
14 defm SELECT_EXCEPT_REF : I<(outs EXCEPT_REF:$dst),
15 (ins EXCEPT_REF:$lhs, EXCEPT_REF:$rhs, I32:$cond),
17 [(set EXCEPT_REF:$dst,
18 (select I32:$cond, EXCEPT_REF:$lhs,
20 "except_ref.select\t$dst, $lhs, $rhs, $cond",
21 "except_ref.select", 0x1b>;
23 def : Pat<(select (i32 (setne I32:$cond, 0)), EXCEPT_REF:$lhs, EXCEPT_REF:$rhs),
24 (SELECT_EXCEPT_REF EXCEPT_REF:$lhs, EXCEPT_REF:$rhs, I32:$cond)>;
25 def : Pat<(select (i32 (seteq I32:$cond, 0)), EXCEPT_REF:$lhs, EXCEPT_REF:$rhs),
26 (SELECT_EXCEPT_REF EXCEPT_REF:$rhs, EXCEPT_REF:$lhs, I32:$cond)>;