WebAssembly: add basic int/fp instruction codegen.
[oota-llvm.git] / lib / Target / WebAssembly / WebAssemblyInstrFloat.td
1 // WebAssemblyInstrFloat.td-WebAssembly Float codegen support ---*- 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 Floating-point operand code-gen constructs.
12 ///
13 //===----------------------------------------------------------------------===//
14
15 defm FADD : BinaryFP<fadd>;
16 defm FSUB : BinaryFP<fsub>;
17 defm FMUL : BinaryFP<fmul>;
18 defm FDIV : BinaryFP<fdiv>;
19 defm FABS : UnaryFP<fabs>;
20 defm FNEG : UnaryFP<fneg>;
21 defm COPYSIGN : BinaryFP<fcopysign>;
22 defm CEIL : UnaryFP<fceil>;
23 defm FLOOR : UnaryFP<ffloor>;
24 defm TRUNC : UnaryFP<ftrunc>;
25 defm NEARESTINT : UnaryFP<fnearbyint>;
26
27 /*
28  * TODO(jfb): Add the following for 32-bit and 64-bit.
29  *
30  * float32.eq: compare equal
31  * float32.lt: less than
32  * float32.le: less than or equal
33  * float32.gt: greater than
34  * float32.ge: greater than or equal
35  */
36
37 defm SQRT : UnaryFP<fsqrt>;
38
39 /*
40  * TODO(jfb): Add the following for 32-bit and 64-bit.
41  *
42  * float32.min: minimum (binary operator); if either operand is NaN, returns NaN
43  * float32.max: maximum (binary operator); if either operand is NaN, returns NaN
44  */