Commit Graph

7815 Commits

Author SHA1 Message Date
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
Pat Hickey
222a57868e readlink: get rid of weird partial-buffer semantics carried over from posix
but follow posix in returning ERANGE when the result is too big
2021-01-04 16:41:24 -08:00
Pat Hickey
84318024ef no more clock test fail 2021-01-04 16:30:11 -08:00
Pat Hickey
41c06db2b4 finish implementing clocks correctly 2021-01-04 16:28:40 -08:00
Pat Hickey
add601fd6c use cap_rand instead of getrandom 2021-01-04 16:28:35 -08:00
Pat Hickey
10a84727fa Ilseq is the correct error when osstring cant be turned into string 2021-01-04 16:04:00 -08:00
Pat Hickey
c7fcc34487 add clocks! 2021-01-04 16:03:58 -08:00
Alex Crichton
2b325a1878 Try to fix CI (#2544)
This is an attempt to work around rust-lang/rust#80703 to get CI green
again.
2021-01-04 14:50:42 -06:00
Pat Hickey
50554d376b add, fix tests 2021-01-04 12:37:07 -08:00
Pat Hickey
48554a1a5c implement randomness 2021-01-04 12:20:42 -08:00
Pat Hickey
01d74ceb73 Merge remote-tracking branch 'origin/main' into pch/wasi_common_cap_std 2021-01-04 11:19:02 -08:00
hayasshi
4c7e66e58e Fix code in WASI-tutorial.md 2021-01-04 07:06:10 -08:00
Louis Pilfold
40887c655f Upgrade shellexpand dep (#2529)
The previous version depended on the deprecated `dirs` crate.
2021-01-04 09:05:42 -06:00
Yury Delendik
2964023a77 [SIMD][x86_64] Add encoding for PMADDWD (#2530)
* [SIMD][x86_64] Add encoding for PMADDWD

* also for "experimental_x64"
2020-12-24 07:52:50 -06:00
Pat Hickey
b50b9b4136 add notes describing why remaining wasi tests are failing 2020-12-18 17:04:02 -08:00
Pat Hickey
8deb3ed07c path_open: ENOTDIR when fd is a file 2020-12-18 16:57:43 -08:00
Pat Hickey
f663045563 better arg names 2020-12-18 16:57:15 -08:00
Pat Hickey
8672dce541 open_file requires the FdFlags 2020-12-18 16:56:58 -08:00
Pat Hickey
a33418c34a path_filestat: remove expectation that rights_inheriting describes subdirs
if inheriting rights are for files (not subdirs) then this is incorrect.

if inheriting rights are for subdirs too, then we need to change the
implementation.
2020-12-18 16:34:25 -08:00
Pat Hickey
c1919259dc implement fd_readdir 2020-12-18 16:13:29 -08:00
Pat Hickey
af0aa14ee8 get a FileStat of a Dir
and fill out some remaining DirCaps from Rights
2020-12-18 16:13:10 -08:00
Pat Hickey
8cc1ab7720 fixup filetype nonsense
tried to go my own way here, bad idea, stick to the design of wasi buddy
2020-12-18 12:30:40 -08:00
Alex Crichton
ce6e967eeb Add a CLI option for module linking (#2524)
* Add a CLI option for module linking

Forgot to add this earlier!

* Always apt-get update before install
2020-12-18 14:12:02 -06:00
Pat Hickey
82edae32b7 readlink 2020-12-18 11:33:28 -08:00
Pat Hickey
f6afd4c41c test-programs: sandbox escape is an EPERM now, not an ENOTCAPABLE 2020-12-17 18:12:29 -08:00
Pat Hickey
d8720cffe8 unexpected io error: do our best based on e.kind() 2020-12-17 18:12:15 -08:00
Pat Hickey
f9ff97aac1 virt pipes: return concrete errors, best effort at flags and filestat 2020-12-17 17:48:46 -08:00
Pat Hickey
4c3c9a9ecb Filestat: make times optional, default to 0 at wasi interface
this is DRY
2020-12-17 17:29:35 -08:00
Pat Hickey
8ac688287e fixup dir/file caps into rights 2020-12-17 17:29:00 -08:00
Pat Hickey
4bee07d6f9 Merge pull request #2520 from bytecodealliance/pch/prune_deps
Prune deps, comment deny.toml
2020-12-17 15:33:38 -08:00
Pat Hickey
8a09652d81 delete wasmparser exception from deny.toml 2020-12-17 14:53:04 -08:00