blob: 33a4f2519545d8081d68a81b3c6d6e180ad1a9f4 [file] [log] [blame]
Heejin Ahn0de58722018-03-08 04:05:37 +00001// WebAssemblyInstrExceptRef.td-WebAssembly except_ref codegen --*- tablegen -*-
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Heejin Ahn0de58722018-03-08 04:05:37 +00006//
7//===----------------------------------------------------------------------===//
8///
9/// \file
Adrian Prantl5f8f34e42018-05-01 15:54:18 +000010/// WebAssembly except_ref operand code-gen constructs.
Heejin Ahn0de58722018-03-08 04:05:37 +000011///
12//===----------------------------------------------------------------------===//
13
Wouter van Oortmerssen48dac312018-06-18 21:22:44 +000014defm SELECT_EXCEPT_REF : I<(outs EXCEPT_REF:$dst),
15 (ins EXCEPT_REF:$lhs, EXCEPT_REF:$rhs, I32:$cond),
16 (outs), (ins),
17 [(set EXCEPT_REF:$dst,
18 (select I32:$cond, EXCEPT_REF:$lhs,
19 EXCEPT_REF:$rhs))],
20 "except_ref.select\t$dst, $lhs, $rhs, $cond",
21 "except_ref.select", 0x1b>;
Heejin Ahn0de58722018-03-08 04:05:37 +000022
Heejin Ahn0de58722018-03-08 04:05:37 +000023def : 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)>;
25def : 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)>;