Commit Graph

2750 Commits

Author SHA1 Message Date
Nick Lewycky
481bdb7d48 Implement saturation part of the saturating truncation operators.
These are described here: https://github.com/WebAssembly/nontrapping-float-to-int-conversions/blob/master/proposals/nontrapping-float-to-int-conversion/Overview.md
with the relevant text being:
"Instead of trapping on positive or negative overflow, they return the maximum or minimum integer value, respectively, and do not trap. (This behavior is also referred to as 'saturating'.)"
"Instead of trapping on NaN, they return 0 and do not trap."
2019-07-11 17:55:40 -07:00
Nick Lewycky
7fb88251d4 Simplify trap_if_not_representable_as_int.
Fix typo in function name. Use two fcmp instructions instead of unpacking the bits of the IEEE float and using integer arithmetic to determine details about its value.
2019-07-11 16:46:37 -07:00
Nick Lewycky
7045030532 Try a new list of optimization passes.
A few notes:
a) the inliner doesn't help because all the calls are indirect and not even opt -O2 can figure out which functions they're actually calling.
b) aggressive instruction combining is not a super-set of the instruction combiner. Instcombine is made up of a large number (probably 10,000s) of patterns, and some particularly slow ones were taken out and moved to the aggressive instruction combiner. Aggressive instcombine *only* runs that handful of optimizations, which fired zero times on our example wasm files.
c) NewGVN is not ready for production, it has asserts that fire when building sqlite or cowsay. This is why sqlite didn't build with the llvm backend.
d) Scalar-replacement-of-aggregates (sroa) is a strict superset of promote-memory-to-registers (mem2reg), and you probably want sroa because it's usually faster. It also fires 10,000s more times than mem2reg on lua.wasm.
e) Aggressive-dead-code-elimination was only deleting as much regular dead-code-elimination, but is slower because it depends on a postdominator tree (PDT) analysis that. Other passes don't need PDT so we'll have to build it for just this one pass (as opposed to regular dominator-tree which is reused by many passes). I've replaced this with bit-tracking dead-code-elimination which deletes more code than dce/adce.
2019-07-11 14:48:07 -07:00
bors[bot]
0c4a8f77d2 Merge #543 #544
543: update version numbers to 0.5.5 r=MarkMcCaskey a=MarkMcCaskey



544: Use bitcast instead of alloca+load+ptrcast+store sequence. r=MarkMcCaskey a=nlewycky



Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
2019-07-11 00:51:31 +00:00
Mark McCaskey
80a8262b2f revert appveyor change 2019-07-10 17:30:24 -07:00
Mark McCaskey
019de38fe8 update lock file 2019-07-10 17:19:20 -07:00
nlewycky
3795b48401
Merge branch 'master' into llvm-cleanup 2019-07-10 16:58:27 -07:00
Mark McCaskey
7789d1b096
Merge branch 'master' into release-0.5.5 2019-07-10 16:35:00 -07:00
Mark McCaskey
e084cd9e04
Merge pull request #546 from wasmerio/fix/publishing-for-clif-backend
use published forks of clif so we can publish again
2019-07-10 16:33:55 -07:00
Nick Lewycky
7f00dc3cdb Reformat. 2019-07-10 15:33:32 -07:00
Nick Lewycky
8faff26c31 Give float_bits bitcast instruction a name. 2019-07-10 15:31:18 -07:00
Mark McCaskey
50302d5d4e use published forks of clif so we can publish again 2019-07-10 15:10:00 -07:00
nlewycky
d1f3fb2ec2
Merge branch 'master' into llvm-cleanup 2019-07-10 13:32:17 -07:00
Mark McCaskey
b2db9238af
Merge pull request #545 from wasmerio/fix/ci-on-master-oops
rm clif submodule; fix master
2019-07-10 13:23:35 -07:00
Mark McCaskey
ad3d4a4679 rm clif submodule; fix master 2019-07-10 10:38:38 -07:00
Nick Lewycky
1e86e32d40 Use bitcast instead of alloca+load+ptrcast+store sequence. 2019-07-10 10:24:14 -07:00
Mark McCaskey
2ef7448e62 remove colons from feature names 2019-07-09 17:57:31 -07:00
Mark McCaskey
4752492974 update version numbers to 0.5.5 2019-07-09 17:43:04 -07:00
bors[bot]
8901f3fb66 Merge #541
541: fix abi crates depending on compilers r=MarkMcCaskey a=MarkMcCaskey

Here's the new dep graph: (red is optional)
![wasmer_depgraph](https://user-images.githubusercontent.com/5770194/60916081-6191d800-a242-11e9-9a0d-438079dea701.png)


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-07-09 23:35:02 +00:00
Mark McCaskey
74ce33919f
Merge branch 'master' into fix/abi-crate-deps 2019-07-09 15:31:45 -07:00
Mark McCaskey
3dbb4c27ba update CI for new submodule 2019-07-09 15:28:50 -07:00
Syrus Akbary
40e67e37aa
Merge pull request #537 from wasmerio/feature/prehashed-keys
Add hidden flag `--cache-key` to use prehashed modules for speed
2019-07-09 15:15:59 -07:00
Mark McCaskey
4612b2bf9a add cranelift as submodule to clif-backend 2019-07-09 14:30:31 -07:00
Mark McCaskey
6d494a297f fix emscripten tests 2019-07-09 13:41:40 -07:00
Mark McCaskey
5993c0bcae add wasi and emscripten unit tests to CI 2019-07-09 13:21:34 -07:00
Mark McCaskey
e0c285c652 fix emscripten dependencies by making separate test crate 2019-07-09 12:07:05 -07:00
Mark McCaskey
5bf491857b fix abi crates depending on compilers 2019-07-09 11:58:03 -07:00
Mark McCaskey
30add2481e do backend caching with a directory 2019-07-08 17:05:54 -07:00
Mark McCaskey
4407a7cf93 Add hidden flag --cache-key to use prehashed modules for speed 2019-07-08 15:46:28 -07:00
bors[bot]
2fa58097c2 Merge #536
536: Update cache key generation to use backend compiler name too r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-07-08 22:17:30 +00:00
Mark McCaskey
62798fd966 fix test
fix doc test
2019-07-08 13:21:34 -07:00
Mark McCaskey
8e34cb6818 Merge branch 'feature/improved-cache-key' of github.com:wasmerio/wasmer into feature/improved-cache-key 2019-07-08 12:23:13 -07:00
Mark McCaskey
9a3fd82a4b Keep WashHash::generate function the same 2019-07-08 12:22:17 -07:00
Mark McCaskey
f2b9ccbee8
Merge branch 'master' into feature/improved-cache-key 2019-07-08 11:30:24 -07:00
Syrus
1d1c22326b Fixed CI 2019-07-08 11:30:04 -07:00
Mark McCaskey
f45d523012 update tests to use backend as in cache key gen 2019-07-08 11:11:27 -07:00
Mark McCaskey
b746a88138 Update cache key generation to use backend compiler name too 2019-07-08 10:50:28 -07:00
Jesús Leganés-Combarro
c8a15ede7f
Make wasmer compatible with latest Emscripten (#533)
Make wasmer compatible with latest Emscripten
2019-07-08 19:06:07 +02:00
Syrus
b67b051a4a Updated emscripten with comment 2019-07-08 09:39:19 -07:00
Syrus
6f1a8995ca Fixed emscripten windows vars format 2019-07-08 00:35:18 -07:00
Syrus
680b833e94 Move emscripten ___syscall221 to the unix implementation 2019-07-07 23:36:50 -07:00
Syrus
72a80a6122 FIxed emscripten windows issues 2019-07-07 22:50:50 -07:00
Syrus
69be61c9cb Remove this calls in windows 2019-07-07 19:51:11 -07:00
Syrus
798ad03182 Improved formatting in unix syscalls 2019-07-07 19:35:46 -07:00
Syrus
e786939589 Improved Makefile 2019-07-07 19:35:28 -07:00
Syrus
f4e60c09c1 Squashed commit of the following:
commit 62d9da4e3e02251a0f61c904e826bc06cf964ff7
Author: Syrus <me@syrusakbary.com>
Date:   Sun Jul 7 18:16:34 2019 -0700

    Fixed syscall221

commit a8fde9148d50d89616d8a85a68110b89e3273229
Author: Syrus <me@syrusakbary.com>
Date:   Sun Jul 7 18:16:04 2019 -0700

    Improved ioctl use case

commit 5ad109d39838624ad84232a4c17714b885835893
Merge: 61526e2c 5cab8161
Author: Syrus <me@syrusakbary.com>
Date:   Sun Jul 7 17:44:25 2019 -0700

    Merge branch 'command/dash' into feature/emscripten-update

commit 5cab816193
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 20:11:49 2019 +0200

    Generic IOCTLs mapping

commit 5a0dc0374c
Merge: 61cfed79 9d120ed3
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 17:15:02 2019 +0200

    Merge remote-tracking branch 'origin/master' into command/dash

commit 61cfed7916
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 13:04:04 2019 +0200

    Fixed implementation for syscalls 200, 201 and 202

commit 91e26d1a0e
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 13:03:26 2019 +0200

    Improved debug messages

commit 53a8fbeb2a
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 13:03:04 2019 +0200

    [___syscall146] Move loop out of `unsafe` zone

commit d6dd3696f1
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 13:01:31 2019 +0200

    [___syscall140] Fixed types

commit c827a6a993
Merge: 2bc16826 5e18d04d
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 12:21:33 2019 +0200

    Merge remote-tracking branch 'origin/master' into command/dash

commit 2bc16826b5
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Thu Jul 4 07:05:00 2019 +0200

    Implement `getpgid` syscall

commit d464954f58
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Thu Jul 4 07:04:36 2019 +0200

    [fcntl64] Replace mock for real implementation

commit 3fe0183d85
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Thu Jul 4 07:03:39 2019 +0200

    [ioctl] No-of for `TIOCSPGRP` command & code clean-up

commit cc83ec9ac1
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Thu Jul 4 07:02:47 2019 +0200

    [___syscall5] debug messages

commit 91587c8bde
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Thu Jul 4 07:02:20 2019 +0200

    [___syscall57] debug messages
2019-07-07 19:35:09 -07:00
Syrus
61526e2c45 Improved code format 2019-07-07 17:10:55 -07:00
Syrus
d9eee3f35a Added contains_key method to Namespace 2019-07-07 17:10:34 -07:00
Syrus
cb7a1f4486 Improved emscripten code based on comments 2019-07-07 17:10:13 -07:00
Syrus
9c96f01494 Fixed emscripten ns collision. Added ctime implementation 2019-07-07 15:55:52 -07:00