JF Bastien | 5ca0bac | 2015-07-10 18:23:10 +0000 | [diff] [blame] | 1 | // WebAssemblyInstrInteger.td-WebAssembly Integer 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 Integer operand code-gen constructs. |
| 12 | /// |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
JF Bastien | d9767a3 | 2015-07-14 21:13:29 +0000 | [diff] [blame] | 15 | defm ADD : BinaryInt<add>; |
| 16 | defm SUB : BinaryInt<sub>; |
| 17 | defm MUL : BinaryInt<mul>; |
| 18 | defm SDIV : BinaryInt<sdiv>; |
| 19 | defm UDIV : BinaryInt<udiv>; |
| 20 | defm SREM : BinaryInt<srem>; |
| 21 | defm UREM : BinaryInt<urem>; |
| 22 | defm AND : BinaryInt<and>; |
| 23 | defm IOR : BinaryInt<or>; |
| 24 | defm XOR : BinaryInt<xor>; |
| 25 | defm SHL : BinaryInt<shl>; |
| 26 | defm SHR : BinaryInt<srl>; |
| 27 | defm SAR : BinaryInt<sra>; |
| 28 | |
JF Bastien | 5ca0bac | 2015-07-10 18:23:10 +0000 | [diff] [blame] | 29 | /* |
| 30 | * TODO(jfb): Add the following for 32-bit and 64-bit. |
| 31 | * |
JF Bastien | 5ca0bac | 2015-07-10 18:23:10 +0000 | [diff] [blame] | 32 | * int32.eq: signed-less compare equal |
| 33 | * int32.slt: signed less than |
| 34 | * int32.sle: signed less than or equal |
| 35 | * int32.ult: unsigned less than |
| 36 | * int32.ule: unsigned less than or equal |
| 37 | * int32.sgt: signed greater than |
| 38 | * int32.sge: signed greater than or equal |
| 39 | * int32.ugt: unsigned greater than |
| 40 | * int32.uge: unsigned greater than or equal |
JF Bastien | 5ca0bac | 2015-07-10 18:23:10 +0000 | [diff] [blame] | 41 | */ |
JF Bastien | d9767a3 | 2015-07-14 21:13:29 +0000 | [diff] [blame] | 42 | |
| 43 | defm CLZ : UnaryInt<ctlz>; |
| 44 | defm CTZ : UnaryInt<cttz>; |
| 45 | defm POPCNT : UnaryInt<ctpop>; |