diff options
| author | Dan Gohman <dan433584@gmail.com> | 2015-12-10 00:17:35 +0000 |
|---|---|---|
| committer | Dan Gohman <dan433584@gmail.com> | 2015-12-10 00:17:35 +0000 |
| commit | df00a9ebc266744566fdb63d450fccc396e4b5c3 (patch) | |
| tree | 7e41af03fc816df36949e8577d94b6e621d5f942 /llvm/lib | |
| parent | 201c08f811cc2804e855185fbc52ca386a430d94 (diff) | |
| download | bcm5719-llvm-df00a9ebc266744566fdb63d450fccc396e4b5c3.tar.gz bcm5719-llvm-df00a9ebc266744566fdb63d450fccc396e4b5c3.zip | |
[WebAssembly] Implement anyext.
llvm-svn: 255179
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyInstrConv.td | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrConv.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrConv.td index 4926b8fd872..931f4a913d0 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrConv.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrConv.td @@ -26,6 +26,15 @@ def I64_EXTEND_U_I32 : I<(outs I64:$dst), (ins I32:$src), [(set I64:$dst, (zext I32:$src))], "i64.extend_u/i32\t$dst, $src">; +} // defs = [ARGUMENTS] + +// Expand a "don't care" extend into zero-extend (chosen over sign-extend +// somewhat arbitrarily, although it favors popular hardware architectures +// and is conceptually a simpler operation). +def : Pat<(i64 (anyext I32:$src)), (I64_EXTEND_U_I32 I32:$src)>; + +let Defs = [ARGUMENTS] in { + // Conversion from floating point to integer traps on overflow and invalid. let hasSideEffects = 1 in { def I32_TRUNC_S_F32 : I<(outs I32:$dst), (ins F32:$src), |

