xref: /freebsd/contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyInstrRef.td (revision 0b57cec536236d46e3dba9bd041533462f33dbb7)
1*0b57cec5SDimitry Andric// WebAssemblyInstrRef.td - WebAssembly reference type codegen --*- tablegen -*-
2*0b57cec5SDimitry Andric//
3*0b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*0b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
5*0b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*0b57cec5SDimitry Andric//
7*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
8*0b57cec5SDimitry Andric///
9*0b57cec5SDimitry Andric/// \file
10*0b57cec5SDimitry Andric/// WebAssembly refence type operand codegen constructs.
11*0b57cec5SDimitry Andric///
12*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
13*0b57cec5SDimitry Andric
14*0b57cec5SDimitry Andricdefm SELECT_EXNREF : I<(outs EXNREF:$dst),
15*0b57cec5SDimitry Andric                       (ins EXNREF:$lhs, EXNREF:$rhs, I32:$cond),
16*0b57cec5SDimitry Andric                       (outs), (ins),
17*0b57cec5SDimitry Andric                       [(set EXNREF:$dst,
18*0b57cec5SDimitry Andric                         (select I32:$cond, EXNREF:$lhs, EXNREF:$rhs))],
19*0b57cec5SDimitry Andric                       "exnref.select\t$dst, $lhs, $rhs, $cond",
20*0b57cec5SDimitry Andric                       "exnref.select", 0x1b>;
21*0b57cec5SDimitry Andric
22*0b57cec5SDimitry Andricdef : Pat<(select (i32 (setne I32:$cond, 0)), EXNREF:$lhs, EXNREF:$rhs),
23*0b57cec5SDimitry Andric          (SELECT_EXNREF EXNREF:$lhs, EXNREF:$rhs, I32:$cond)>;
24*0b57cec5SDimitry Andricdef : Pat<(select (i32 (seteq I32:$cond, 0)), EXNREF:$lhs, EXNREF:$rhs),
25*0b57cec5SDimitry Andric          (SELECT_EXNREF EXNREF:$rhs, EXNREF:$lhs, I32:$cond)>;
26