blob: 16ed7acbb9d369e4b565c87441357c6ba5f09971 [file] [log] [blame]
JF Bastien5ca0bac2015-07-10 18:23:10 +00001// 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 Bastiend9767a32015-07-14 21:13:29 +000015defm ADD : BinaryInt<add>;
16defm SUB : BinaryInt<sub>;
17defm MUL : BinaryInt<mul>;
18defm SDIV : BinaryInt<sdiv>;
19defm UDIV : BinaryInt<udiv>;
20defm SREM : BinaryInt<srem>;
21defm UREM : BinaryInt<urem>;
22defm AND : BinaryInt<and>;
23defm IOR : BinaryInt<or>;
24defm XOR : BinaryInt<xor>;
25defm SHL : BinaryInt<shl>;
26defm SHR : BinaryInt<srl>;
27defm SAR : BinaryInt<sra>;
28
JF Bastienda06bce2015-08-11 21:02:46 +000029defm EQ : ComparisonInt<SETEQ>;
30defm NE : ComparisonInt<SETNE>;
31defm SLT : ComparisonInt<SETLT>;
32defm SLE : ComparisonInt<SETLE>;
33defm ULT : ComparisonInt<SETULT>;
34defm ULE : ComparisonInt<SETULE>;
35defm SGT : ComparisonInt<SETGT>;
36defm SGE : ComparisonInt<SETGE>;
37defm UGT : ComparisonInt<SETUGT>;
38defm UGE : ComparisonInt<SETUGE>;
JF Bastiend9767a32015-07-14 21:13:29 +000039
40defm CLZ : UnaryInt<ctlz>;
41defm CTZ : UnaryInt<cttz>;
42defm POPCNT : UnaryInt<ctpop>;
Dan Gohman08fc9662015-08-24 16:39:37 +000043
44// Expand the "don't care" operations to supported operations.
45def : Pat<(ctlz_zero_undef Int32:$src), (CLZ_I32 Int32:$src)>;
46def : Pat<(ctlz_zero_undef Int64:$src), (CLZ_I64 Int64:$src)>;
47def : Pat<(cttz_zero_undef Int32:$src), (CTZ_I32 Int32:$src)>;
48def : Pat<(cttz_zero_undef Int64:$src), (CTZ_I64 Int64:$src)>;