JF Bastien | 5ca0bac | 2015-07-10 18:23:10 +0000 | [diff] [blame] | 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 | |
JF Bastien | d9767a3 | 2015-07-14 21:13:29 +0000 | [diff] [blame] | 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>; |
JF Bastien | ef172fc | 2015-08-11 02:45:15 +0000 | [diff] [blame^] | 22 | |
| 23 | /* |
| 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>; |
| 29 | */ |
JF Bastien | d9767a3 | 2015-07-14 21:13:29 +0000 | [diff] [blame] | 30 | |
JF Bastien | 5ca0bac | 2015-07-10 18:23:10 +0000 | [diff] [blame] | 31 | /* |
| 32 | * TODO(jfb): Add the following for 32-bit and 64-bit. |
| 33 | * |
JF Bastien | 5ca0bac | 2015-07-10 18:23:10 +0000 | [diff] [blame] | 34 | * float32.eq: compare equal |
| 35 | * float32.lt: less than |
| 36 | * float32.le: less than or equal |
| 37 | * float32.gt: greater than |
| 38 | * float32.ge: greater than or equal |
JF Bastien | d9767a3 | 2015-07-14 21:13:29 +0000 | [diff] [blame] | 39 | */ |
| 40 | |
| 41 | defm SQRT : UnaryFP<fsqrt>; |
| 42 | |
| 43 | /* |
| 44 | * TODO(jfb): Add the following for 32-bit and 64-bit. |
| 45 | * |
JF Bastien | 5ca0bac | 2015-07-10 18:23:10 +0000 | [diff] [blame] | 46 | * float32.min: minimum (binary operator); if either operand is NaN, returns NaN |
| 47 | * float32.max: maximum (binary operator); if either operand is NaN, returns NaN |
| 48 | */ |