WebAssembly: NFC rename shr/sar
[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_U : BinaryInt<srl>;
27 defm SHR_S : BinaryInt<sra>;
28
29 defm EQ : ComparisonInt<SETEQ>;
30 defm NE : ComparisonInt<SETNE>;
31 defm SLT : ComparisonInt<SETLT>;
32 defm SLE : ComparisonInt<SETLE>;
33 defm ULT : ComparisonInt<SETULT>;
34 defm ULE : ComparisonInt<SETULE>;
35 defm SGT : ComparisonInt<SETGT>;
36 defm SGE : ComparisonInt<SETGE>;
37 defm UGT : ComparisonInt<SETUGT>;
38 defm UGE : ComparisonInt<SETUGE>;
39
40 defm CLZ : UnaryInt<ctlz>;
41 defm CTZ : UnaryInt<cttz>;
42 defm POPCNT : UnaryInt<ctpop>;
43
44 // Expand the "don't care" operations to supported operations.
45 def : Pat<(ctlz_zero_undef Int32:$src), (CLZ_I32 Int32:$src)>;
46 def : Pat<(ctlz_zero_undef Int64:$src), (CLZ_I64 Int64:$src)>;
47 def : Pat<(cttz_zero_undef Int32:$src), (CTZ_I32 Int32:$src)>;
48 def : Pat<(cttz_zero_undef Int64:$src), (CTZ_I64 Int64:$src)>;