diff options
author | JF Bastien <jfb@google.com> | 2015-07-14 21:13:29 +0000 |
---|---|---|
committer | JF Bastien <jfb@google.com> | 2015-07-14 21:13:29 +0000 |
commit | d9767a368fb7d425bbc7bec6d02afb596c232c34 (patch) | |
tree | 903cb93e8743cc92439d74f57fab3e06eccc7603 /llvm/lib/Target/WebAssembly/WebAssemblyInstrFloat.td | |
parent | fdfaae42b6e2a3f3f6f8ab963a0cf165eda398de (diff) | |
download | bcm5719-llvm-d9767a368fb7d425bbc7bec6d02afb596c232c34.tar.gz bcm5719-llvm-d9767a368fb7d425bbc7bec6d02afb596c232c34.zip |
WebAssembly: add basic int/fp instruction codegen.
Summary: This patch has the most basic instruction codegen for 32 and 64 bit int/fp.
Reviewers: sunfish
Subscribers: llvm-commits, jfb
Differential Revision: http://reviews.llvm.org/D11193
llvm-svn: 242201
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyInstrFloat.td')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyInstrFloat.td | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrFloat.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrFloat.td index b9906d7a3f0..30ef6339d65 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrFloat.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrFloat.td @@ -12,26 +12,33 @@ /// //===----------------------------------------------------------------------===// +defm FADD : BinaryFP<fadd>; +defm FSUB : BinaryFP<fsub>; +defm FMUL : BinaryFP<fmul>; +defm FDIV : BinaryFP<fdiv>; +defm FABS : UnaryFP<fabs>; +defm FNEG : UnaryFP<fneg>; +defm COPYSIGN : BinaryFP<fcopysign>; +defm CEIL : UnaryFP<fceil>; +defm FLOOR : UnaryFP<ffloor>; +defm TRUNC : UnaryFP<ftrunc>; +defm NEARESTINT : UnaryFP<fnearbyint>; + /* * TODO(jfb): Add the following for 32-bit and 64-bit. * - * float32.add: addition - * float32.sub: subtraction - * float32.mul: multiplication - * float32.div: division - * float32.abs: absolute value - * float32.neg: negation - * float32.copysign: copysign - * float32.ceil: ceiling operation - * float32.floor: floor operation - * float32.trunc: round to nearest integer towards zero - * float32.nearestint: round to nearest integer, ties to even * float32.eq: compare equal * float32.lt: less than * float32.le: less than or equal * float32.gt: greater than * float32.ge: greater than or equal - * float32.sqrt: square root + */ + +defm SQRT : UnaryFP<fsqrt>; + +/* + * TODO(jfb): Add the following for 32-bit and 64-bit. + * * float32.min: minimum (binary operator); if either operand is NaN, returns NaN * float32.max: maximum (binary operator); if either operand is NaN, returns NaN */ |