]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyInstrRef.td
MFC r355940:
[FreeBSD/FreeBSD.git] / contrib / llvm-project / llvm / lib / Target / WebAssembly / WebAssemblyInstrRef.td
1 // WebAssemblyInstrRef.td - WebAssembly reference type codegen --*- tablegen -*-
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// WebAssembly refence type operand codegen constructs.
11 ///
12 //===----------------------------------------------------------------------===//
13
14 defm SELECT_EXNREF : I<(outs EXNREF:$dst),
15                        (ins EXNREF:$lhs, EXNREF:$rhs, I32:$cond),
16                        (outs), (ins),
17                        [(set EXNREF:$dst,
18                          (select I32:$cond, EXNREF:$lhs, EXNREF:$rhs))],
19                        "exnref.select\t$dst, $lhs, $rhs, $cond",
20                        "exnref.select", 0x1b>;
21
22 def : Pat<(select (i32 (setne I32:$cond, 0)), EXNREF:$lhs, EXNREF:$rhs),
23           (SELECT_EXNREF EXNREF:$lhs, EXNREF:$rhs, I32:$cond)>;
24 def : Pat<(select (i32 (seteq I32:$cond, 0)), EXNREF:$lhs, EXNREF:$rhs),
25           (SELECT_EXNREF EXNREF:$rhs, EXNREF:$lhs, I32:$cond)>;