2015-07-11 02:23:10 +08:00
|
|
|
// WebAssemblyInstrInteger.td-WebAssembly Integer codegen -------*- tablegen -*-
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
///
|
|
|
|
/// \file
|
|
|
|
/// \brief WebAssembly Integer operand code-gen constructs.
|
|
|
|
///
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2015-07-15 05:13:29 +08:00
|
|
|
defm ADD : BinaryInt<add>;
|
|
|
|
defm SUB : BinaryInt<sub>;
|
|
|
|
defm MUL : BinaryInt<mul>;
|
2015-10-22 10:32:50 +08:00
|
|
|
defm DIV_S : BinaryInt<sdiv>;
|
|
|
|
defm DIV_U : BinaryInt<udiv>;
|
|
|
|
defm REM_S : BinaryInt<srem>;
|
|
|
|
defm REM_U : BinaryInt<urem>;
|
2015-07-15 05:13:29 +08:00
|
|
|
defm AND : BinaryInt<and>;
|
|
|
|
defm IOR : BinaryInt<or>;
|
|
|
|
defm XOR : BinaryInt<xor>;
|
|
|
|
defm SHL : BinaryInt<shl>;
|
2015-09-09 01:21:21 +08:00
|
|
|
defm SHR_U : BinaryInt<srl>;
|
|
|
|
defm SHR_S : BinaryInt<sra>;
|
2015-07-15 05:13:29 +08:00
|
|
|
|
2015-08-12 05:02:46 +08:00
|
|
|
defm EQ : ComparisonInt<SETEQ>;
|
|
|
|
defm NE : ComparisonInt<SETNE>;
|
2015-10-17 08:12:29 +08:00
|
|
|
defm LT_S : ComparisonInt<SETLT>;
|
|
|
|
defm LE_S : ComparisonInt<SETLE>;
|
|
|
|
defm LT_U : ComparisonInt<SETULT>;
|
|
|
|
defm LE_U : ComparisonInt<SETULE>;
|
|
|
|
defm GT_S : ComparisonInt<SETGT>;
|
|
|
|
defm GE_S : ComparisonInt<SETGE>;
|
|
|
|
defm GT_U : ComparisonInt<SETUGT>;
|
|
|
|
defm GE_U : ComparisonInt<SETUGE>;
|
2015-07-15 05:13:29 +08:00
|
|
|
|
|
|
|
defm CLZ : UnaryInt<ctlz>;
|
|
|
|
defm CTZ : UnaryInt<cttz>;
|
|
|
|
defm POPCNT : UnaryInt<ctpop>;
|
2015-08-25 00:39:37 +08:00
|
|
|
|
|
|
|
// Expand the "don't care" operations to supported operations.
|
2015-09-26 09:09:44 +08:00
|
|
|
def : Pat<(ctlz_zero_undef I32:$src), (CLZ_I32 I32:$src)>;
|
|
|
|
def : Pat<(ctlz_zero_undef I64:$src), (CLZ_I64 I64:$src)>;
|
|
|
|
def : Pat<(cttz_zero_undef I32:$src), (CTZ_I32 I32:$src)>;
|
|
|
|
def : Pat<(cttz_zero_undef I64:$src), (CTZ_I64 I64:$src)>;
|