Commit Graph

8795 Commits

Author SHA1 Message Date
Chris Fallin
81bc811236 Merge pull request #2558 from cfallin/pic-symbol-refs
x64: support PC-rel symbol references using the GOT when in PIC mode.
2021-01-08 10:03:10 -08:00
Yury Delendik
3580205f12 [Cranelift][Atomics] Add address folding for atomic notify/wait. (#2556)
* fold address in wasm wait and notify ops

* add atomics addr folding tests
2021-01-08 11:55:21 -06:00
Chris Fallin
3ee898cb2c x64: support PC-rel symbol references using the GOT when in PIC mode. 2021-01-07 22:46:56 -08:00
Pat Hickey
4a6e92f52f upgrade to cap-std 0.9 2021-01-07 16:47:26 -08:00
Pat Hickey
a900d0431d Merge remote-tracking branch 'origin/main' into pch/wasi_common_cap_std 2021-01-07 16:39:27 -08:00
Nick Fitzgerald
5de5bf1565 Merge pull request #2550 from bytecodealliance/pch/wiggle_trapping
wiggle: introduce Trap enum
2021-01-07 16:23:21 -08:00
Nick Fitzgerald
9f4859b963 Merge pull request #2557 from fitzgen/wasmtime-0.22.0
Wasmtime 0.22.0
2021-01-07 15:59:09 -08:00
Nick Fitzgerald
3a3f35e158 Add release notes for Wasmtime 0.22.0 2021-01-07 15:17:02 -08:00
Pat Hickey
539058b329 fix windows 2021-01-07 14:57:18 -08:00
Pat Hickey
82128cbc5b trap proc_exit and unsupported funcs 2021-01-07 14:56:22 -08:00
Nick Fitzgerald
5ad82de3c5 Bump Wasmtime to 0.22.0; Cranelift to 0.69.0 2021-01-07 14:51:12 -08:00
Pat Hickey
c2a715ca54 wiggle traps 2021-01-07 14:43:56 -08:00
Pat Hickey
13cd7a4a8e Merge branch 'pch/wiggle_trapping' into pch/wasi_common_cap_std 2021-01-07 14:10:59 -08:00
Pat Hickey
c2004001cb Merge remote-tracking branch 'origin/main' into pch/wasi_common_cap_std 2021-01-07 14:10:43 -08:00
Pat Hickey
b149a03d5d wasi-common: instead of panicking, use an Error::Unsupported that Traps 2021-01-07 14:05:49 -08:00
Nick Fitzgerald
ee7131bc0b Merge pull request #2555 from alexcrichton/doc-module-linking
Document that the module linking proposal is implemented
2021-01-07 13:21:49 -08:00
Nick Fitzgerald
79aaeb5eda docs: Add wasm-{smith,encoder} crates to Wasm proposal checklist (#2554) 2021-01-07 14:11:42 -06:00
Pat Hickey
030f01345a cli exit tests: valid wasi commands must export a memory
wiggle enforces this but the specially-overridden proc_exit
function did not. Now that we proc_exit through wiggle, wiggle
will trap if it cannot import the instance's memory
2021-01-07 11:45:35 -08:00
Pat Hickey
07c9b65fa4 fix 2021-01-07 11:45:11 -08:00
Pat Hickey
ec1bfeefb3 fix tests 2021-01-07 11:45:11 -08:00
Pat Hickey
cd3adb1abd Trap::I32Exit is a better name 2021-01-07 11:45:11 -08:00
Pat Hickey
1dab7c8f94 wasi submodule: noreturn annotations are merged into main 2021-01-07 11:45:11 -08:00
Pat Hickey
2483ad4c1c wasi-nn: UserErrorConversion error is now a wiggle::Trap 2021-01-07 11:45:11 -08:00
Pat Hickey
745c592863 readme: expand wiggle docs 2021-01-07 11:45:11 -08:00
Pat Hickey
4a574c14eb wasi-common: port to use wiggle::Trap 2021-01-07 11:45:11 -08:00
Pat Hickey
1c7c18b026 WASI submodule: mark proc_exit funcs as noreturn in the witx 2021-01-07 11:45:11 -08:00
Pat Hickey
f8f9b14c6f wiggle: introduce wiggle::Trap, which can be either a String or I32
also, make noreturn functions always return a Trap

wasmtime-wiggle can trivially turn a wiggle::Trap into a wasmtime::Trap.
lucet will have to do the same.
2021-01-07 11:45:11 -08:00
Alex Crichton
6354edc7bd Document that the module linking proposal is implemented
Forgot to do this earlier!
2021-01-07 11:41:23 -08:00
Léo Gaspard
c0c4834c64 wasi-nn: rebuild if the witx files change 2021-01-06 15:56:46 -08:00
Pat Hickey
4018a06da2 Merge pull request #2549 from bytecodealliance/pch/wiggle_missing_memory_is_trap
wasmtime-wiggle: missing memory can just Trap
2021-01-06 11:39:58 -08:00
Pat Hickey
d4aaae3e86 wasi-nn: remove missing_memory from wasmtime_integration 2021-01-06 10:59:29 -08:00
Chris Fallin
f579d088ba Merge pull request #2538 from cfallin/multi-reg-framework
Multi-register value support: framework for Values wider than machine registers.
2021-01-06 09:58:45 -08:00
Chris Fallin
6eea015d6c Multi-register value support: framework for Values wider than machine regs.
This will allow for support for `I128` values everywhere, and `I64`
values on 32-bit targets (e.g., ARM32 and x86-32). It does not alter the
machine backends to build such support; it just adds the framework for
the MachInst backends to *reason* about a `Value` residing in more than
one register.
2021-01-05 17:45:02 -08:00
Pat Hickey
bf2371c8af wasi: get rid of missing_memory config 2021-01-05 17:29:34 -08:00
Pat Hickey
46b1864c9e wiggle-wasmtime: get rid of "missing_memory" error code, we can Trap now
the missing memory behavior was always a silly thing, that we generate a
function for wasmtime which is Result<_, Trap> we can just Err(Trap)
when the memory export is missing.
2021-01-05 17:28:03 -08:00
Pat Hickey
fb37751a92 fix warning 2021-01-05 17:27:06 -08:00
Nick Fitzgerald
6317290a1d Merge pull request #2548 from cfallin/fix-aarch64-sp
aarch64: fix reg/imm `sub` insts that read `SP`, not the zero register.
2021-01-05 16:38:25 -08:00
Chris Fallin
aac3751025 aarch64: fix reg/imm sub insts that read SP, not the zero register.
On AArch64, the zero register (xzr) and the stack pointer (xsp) are
alternately named by the same index `31` in machine code depending on
context. In particular, in the reg-reg-immediate ALU instruction form,
add/subtract will use the stack pointer, not the zero register, if index
31 is given for the first (register) source arg.

In a few places, we were emitting subtract instructions with the zero
register as an argument and a reg/immediate as the second argument. When
an immediate could be incorporated directly (we have the `iconst`
definition visible), this would result in incorrect code being
generated.

This issue was found in `ineg` and in the sequence for vector
right-shifts.

Reported by Ian Cullinan; thanks!
2021-01-05 15:48:07 -08:00
Chris Fallin
ec3de5e0bb Merge pull request #2546 from cfallin/fix-b1
x64: handle tests of b1 values correctly (only LSB is defined).
2021-01-05 15:32:23 -08:00
Chris Fallin
dbd2241b60 x64: handle tests of b1 values correctly (only LSB is defined).
Previously, `select` and `brz`/`brnz` instructions, when given a `b1`
boolean argument, would test whether that boolean argument was nonzero,
rather than whether its LSB was nonzero. Since our invariant for mapping
CLIF state to machine state is that bits beyond the width of a value are
undefined, the proper lowering is to test only the LSB.

(aarch64 does not have the same issue because its `Extend` pseudoinst
already properly handles masking of b1 values when a zero-extend is
requested, as it is for select/brz/brnz.)

Found by Nathan Ringo on Zulip [1] (thanks!).

[1]
https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/bnot.20on.20b1s
2021-01-05 14:45:46 -08:00
Pat Hickey
31c5328971 incorporate dan's suggestions on readdir 2021-01-05 14:36:32 -08:00
Pat Hickey
56788be629 sorta fix set_times on paths and dirfds 2021-01-05 14:28:26 -08:00
Pat Hickey
ce13cd9e77 dir: add set times 2021-01-05 14:24:02 -08:00
Pat Hickey
16eff680e2 summarize failures with a TODO list! 2021-01-05 13:57:12 -08:00
Pat Hickey
8ace7f00d9 delete file::get/set_oflags 2021-01-05 13:53:25 -08:00
Pat Hickey
fb32f65118 get path filestat on a dir 2021-01-05 13:51:55 -08:00
Pat Hickey
07a9584a08 add hard_link to dir 2021-01-05 12:19:56 -08:00
Pat Hickey
21cd55b0a7 add directory rename 2021-01-05 12:14:07 -08:00
Pat Hickey
94d2280187 better docs 2021-01-05 11:01:52 -08:00
Pat Hickey
d51ffe8d4e add . and .. to the readdir iterator 2021-01-04 17:27:32 -08:00