blob: 921e7ab04fe6058c836133950db222561832467d [file] [log] [blame]
Heejin Ahn0de58722018-03-08 04:05:37 +00001// WebAssemblyInstrExceptRef.td-WebAssembly except_ref codegen --*- tablegen -*-
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9///
10/// \file
11/// \brief WebAssembly except_ref operand code-gen constructs.
12///
13//===----------------------------------------------------------------------===//
14
15let Defs = [ARGUMENTS] in {
16
17def SELECT_EXCEPT_REF : I<(outs EXCEPT_REF:$dst),
18 (ins EXCEPT_REF:$lhs, EXCEPT_REF:$rhs, I32:$cond),
19 [(set EXCEPT_REF:$dst,
20 (select I32:$cond, EXCEPT_REF:$lhs,
21 EXCEPT_REF:$rhs))],
22 "except_ref.select\t$dst, $lhs, $rhs, $cond", 0x1b>;
23
24} // Defs = [ARGUMENTS]
25
26def : Pat<(select (i32 (setne I32:$cond, 0)), EXCEPT_REF:$lhs, EXCEPT_REF:$rhs),
27 (SELECT_EXCEPT_REF EXCEPT_REF:$lhs, EXCEPT_REF:$rhs, I32:$cond)>;
28def : Pat<(select (i32 (seteq I32:$cond, 0)), EXCEPT_REF:$lhs, EXCEPT_REF:$rhs),
29 (SELECT_EXCEPT_REF EXCEPT_REF:$rhs, EXCEPT_REF:$lhs, I32:$cond)>;