WebAssembly: add basic int/fp instruction codegen.
[oota-llvm.git] / lib / Target / WebAssembly / WebAssemblyInstrInteger.td
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
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
29 /*
30  * TODO(jfb): Add the following for 32-bit and 64-bit.
31  *
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
41  */
42
43 defm CLZ : UnaryInt<ctlz>;
44 defm CTZ : UnaryInt<cttz>;
45 defm POPCNT : UnaryInt<ctpop>;