Heejin Ahn | 0de5872 | 2018-03-08 04:05:37 +0000 | [diff] [blame] | 1 | // 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 |
Adrian Prantl | 5f8f34e4 | 2018-05-01 15:54:18 +0000 | [diff] [blame] | 11 | /// WebAssembly except_ref operand code-gen constructs. |
Heejin Ahn | 0de5872 | 2018-03-08 04:05:37 +0000 | [diff] [blame] | 12 | /// |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | let Defs = [ARGUMENTS] in { |
| 16 | |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame^] | 17 | defm SELECT_EXCEPT_REF : I<(outs EXCEPT_REF:$dst), |
| 18 | (ins EXCEPT_REF:$lhs, EXCEPT_REF:$rhs, I32:$cond), |
| 19 | (outs), (ins), |
| 20 | [(set EXCEPT_REF:$dst, |
| 21 | (select I32:$cond, EXCEPT_REF:$lhs, |
| 22 | EXCEPT_REF:$rhs))], |
| 23 | "except_ref.select\t$dst, $lhs, $rhs, $cond", |
| 24 | "except_ref.select", 0x1b>; |
Heejin Ahn | 0de5872 | 2018-03-08 04:05:37 +0000 | [diff] [blame] | 25 | |
| 26 | } // Defs = [ARGUMENTS] |
| 27 | |
| 28 | def : Pat<(select (i32 (setne I32:$cond, 0)), EXCEPT_REF:$lhs, EXCEPT_REF:$rhs), |
| 29 | (SELECT_EXCEPT_REF EXCEPT_REF:$lhs, EXCEPT_REF:$rhs, I32:$cond)>; |
| 30 | def : Pat<(select (i32 (seteq I32:$cond, 0)), EXCEPT_REF:$lhs, EXCEPT_REF:$rhs), |
| 31 | (SELECT_EXCEPT_REF EXCEPT_REF:$rhs, EXCEPT_REF:$lhs, I32:$cond)>; |