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 |
| 11 | /// \brief WebAssembly except_ref operand code-gen constructs. |
| 12 | /// |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | let Defs = [ARGUMENTS] in { |
| 16 | |
| 17 | def SELECT_EXCEPT_REF : I<(outs EXCEPT_REF:$dst), |
| 18 | (ins EXCEPT_REF:$lhs, EXCEPT_REF:$rhs, I32:$cond), |
| 19 | [(set EXCEPT_REF:$dst, |
| 20 | (select I32:$cond, EXCEPT_REF:$lhs, |
| 21 | EXCEPT_REF:$rhs))], |
| 22 | "except_ref.select\t$dst, $lhs, $rhs, $cond", 0x1b>; |
| 23 | |
| 24 | } // Defs = [ARGUMENTS] |
| 25 | |
| 26 | def : Pat<(select (i32 (setne I32:$cond, 0)), EXCEPT_REF:$lhs, EXCEPT_REF:$rhs), |
| 27 | (SELECT_EXCEPT_REF EXCEPT_REF:$lhs, EXCEPT_REF:$rhs, I32:$cond)>; |
| 28 | def : Pat<(select (i32 (seteq I32:$cond, 0)), EXCEPT_REF:$lhs, EXCEPT_REF:$rhs), |
| 29 | (SELECT_EXCEPT_REF EXCEPT_REF:$rhs, EXCEPT_REF:$lhs, I32:$cond)>; |