Heejin Ahn | 0de5872 | 2018-03-08 04:05:37 +0000 | [diff] [blame] | 1 | // WebAssemblyInstrExceptRef.td-WebAssembly except_ref codegen --*- tablegen -*- |
| 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 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 |
Heejin Ahn | 0de5872 | 2018-03-08 04:05:37 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | /// |
| 9 | /// \file |
Adrian Prantl | 5f8f34e4 | 2018-05-01 15:54:18 +0000 | [diff] [blame] | 10 | /// WebAssembly except_ref operand code-gen constructs. |
Heejin Ahn | 0de5872 | 2018-03-08 04:05:37 +0000 | [diff] [blame] | 11 | /// |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 14 | defm 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 Ahn | 0de5872 | 2018-03-08 04:05:37 +0000 | [diff] [blame] | 22 | |
Heejin Ahn | 0de5872 | 2018-03-08 04:05:37 +0000 | [diff] [blame] | 23 | def : 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)>; |
| 25 | def : 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)>; |