blob: ca1068f7f39fdf23a2f26114cca44569f6906de2 [file] [log] [blame]
JF Bastien5ca0bac2015-07-10 18:23:10 +00001//===-- WebAssemblyInstrConv.td-WebAssembly Conversion 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 datatype conversions, truncations, reinterpretations,
12/// promotions, and demotions operand code-gen constructs.
13///
14//===----------------------------------------------------------------------===//
15
16/*
17 * TODO(jfb): Add the following.
18 *
Dan Gohmand0bf9812015-09-26 01:09:44 +000019 * i32.wrap[i64]: wrap a 64-bit integer to a 32-bit integer
20 * i32.trunc_s[f32]: truncate a 32-bit float to a signed 32-bit integer
21 * i32.trunc_s[f64]: truncate a 64-bit float to a signed 32-bit integer
22 * i32.trunc_u[f32]: truncate a 32-bit float to an unsigned 32-bit integer
23 * i32.trunc_u[f64]: truncate a 64-bit float to an unsigned 32-bit integer
24 * i32.reinterpret[f32]: reinterpret the bits of a 32-bit float as a 32-bit integer
25 * i64.extend_s[i32]: extend a signed 32-bit integer to a 64-bit integer
26 * i64.extend_u[i32]: extend an unsigned 32-bit integer to a 64-bit integer
27 * i64.trunc_s[f32]: truncate a 32-bit float to a signed 64-bit integer
28 * i64.trunc_s[f64]: truncate a 64-bit float to a signed 64-bit integer
29 * i64.trunc_u[f32]: truncate a 32-bit float to an unsigned 64-bit integer
30 * i64.trunc_u[f64]: truncate a 64-bit float to an unsigned 64-bit integer
31 * i64.reinterpret[f64]: reinterpret the bits of a 64-bit float as a 64-bit integer
32 * f32.demote[f64]: demote a 64-bit float to a 32-bit float
33 * f32.convert_s[i32]: convert a signed 32-bit integer to a 32-bit float
34 * f32.convert_s[i64]: convert a signed 64-bit integer to a 32-bit float
35 * f32.convert_u[i32]: convert an unsigned 32-bit integer to a 32-bit float
36 * f32.convert_u[i64]: convert an unsigned 64-bit integer to a 32-bit float
37 * f32.reinterpret[i32]: reinterpret the bits of a 32-bit integer as a 32-bit float
38 * f64.promote[f32]: promote a 32-bit float to a 64-bit float
39 * f64.convert_s[i32]: convert a signed 32-bit integer to a 64-bit float
40 * f64.convert_s[i64]: convert a signed 64-bit integer to a 64-bit float
41 * f64.convert_u[i32]: convert an unsigned 32-bit integer to a 64-bit float
42 * f64.convert_u[i64]: convert an unsigned 64-bit integer to a 64-bit float
43 * f64.reinterpret[i64]: reinterpret the bits of a 64-bit integer as a 64-bit float
JF Bastien5ca0bac2015-07-10 18:23:10 +000044 */
Dan Gohman311b4882015-09-15 00:55:19 +000045
Dan Gohmand0bf9812015-09-26 01:09:44 +000046def WRAP_I64_I32 : I<(outs I32:$dst), (ins I64:$src),
47 [(set I32:$dst, (trunc I64:$src))]>;