1 // WebAssemblyInstrInteger.td-WebAssembly Integer codegen -------*- tablegen -*-
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief WebAssembly Integer operand code-gen constructs.
13 //===----------------------------------------------------------------------===//
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>;
30 * TODO(jfb): Add the following for 32-bit and 64-bit.
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
43 defm CLZ : UnaryInt<ctlz>;
44 defm CTZ : UnaryInt<cttz>;
45 defm POPCNT : UnaryInt<ctpop>;