1 // WebAssemblyInstrFloat.td-WebAssembly Float codegen support ---*- 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 Floating-point operand code-gen constructs.
13 //===----------------------------------------------------------------------===//
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>;
24 * TODO(jfb): add and test these:
25 * defm CEIL : UnaryFP<fceil>;
26 * defm FLOOR : UnaryFP<ffloor>;
27 * defm TRUNC : UnaryFP<ftrunc>;
28 * defm NEARESTINT : UnaryFP<fnearbyint>;
31 defm EQ : ComparisonFP<SETOEQ>;
32 defm NE : ComparisonFP<SETUNE>;
33 defm LT : ComparisonFP<SETOLT>;
34 defm LE : ComparisonFP<SETOLE>;
35 defm GT : ComparisonFP<SETOGT>;
36 defm GE : ComparisonFP<SETOGE>;
38 defm SQRT : UnaryFP<fsqrt>;
41 * TODO(jfb): Add the following for 32-bit and 64-bit.
43 * float32.min: minimum (binary operator); if either operand is NaN, returns NaN
44 * float32.max: maximum (binary operator); if either operand is NaN, returns NaN