1 // WebAssemblyInstrExceptRef.td-WebAssembly except_ref codegen --*- tablegen -*-
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// WebAssembly except_ref operand code-gen constructs.
13 //===----------------------------------------------------------------------===//
15 let Defs = [ARGUMENTS] in {
17 defm SELECT_EXCEPT_REF : I<(outs EXCEPT_REF:$dst),
18 (ins EXCEPT_REF:$lhs, EXCEPT_REF:$rhs, I32:$cond),
20 [(set EXCEPT_REF:$dst,
21 (select I32:$cond, EXCEPT_REF:$lhs,
23 "except_ref.select\t$dst, $lhs, $rhs, $cond",
24 "except_ref.select", 0x1b>;
26 } // Defs = [ARGUMENTS]
28 def : Pat<(select (i32 (setne I32:$cond, 0)), EXCEPT_REF:$lhs, EXCEPT_REF:$rhs),
29 (SELECT_EXCEPT_REF EXCEPT_REF:$lhs, EXCEPT_REF:$rhs, I32:$cond)>;
30 def : Pat<(select (i32 (seteq I32:$cond, 0)), EXCEPT_REF:$lhs, EXCEPT_REF:$rhs),
31 (SELECT_EXCEPT_REF EXCEPT_REF:$rhs, EXCEPT_REF:$lhs, I32:$cond)>;