Commit Graph

67 Commits

Author SHA1 Message Date
Takeshi Yoneda
3aeeb0b01d asm/arm64: avoids using unnecessary map access (#1355)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2023-04-11 15:40:33 +09:00
Takeshi Yoneda
cee1e50ad2 compiler: avoids allocation in label resolution (#1326)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2023-03-30 22:26:18 -07:00
Takeshi Yoneda
bbae781978 compiler: avoid allocation in SetJumpTargetOnNext (#1325)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2023-03-31 13:03:26 +09:00
Takeshi Yoneda
a0a6331011 asm/amd64: avoids allocation in getting memory location (#1322)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2023-03-31 08:52:01 +09:00
Takeshi Yoneda
448c990ab6 asm/amd64: avoids allocations on forward jump resolution (#1315)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2023-03-30 17:46:09 +09:00
Takeshi Yoneda
76815dbd75 asm/amd64: avoids map allocation per node (#1307)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2023-03-29 16:27:54 +09:00
Takeshi Yoneda
15e393c7e9 asm: reuse StaticConstPool (#1304)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2023-03-29 13:30:16 +09:00
Takeshi Yoneda
376292fe53 asm: reuses the slice on SetBranchTargetOnNextNodes (#1303)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2023-03-29 12:20:50 +09:00
Takeshi Yoneda
a1706eb05c asm(arm64): fixes stack pointer add/sub for large consts (#962)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-12-26 16:26:23 +09:00
Takeshi Yoneda
69688468f8 asm(arm64): adds UDF instruction (#961)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-12-26 15:58:35 +09:00
Takeshi Yoneda
3d70c85032 asm(arm64): adds support for stack pointer manipulation (#960)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-12-26 10:07:13 +09:00
Crypt Keeper
796fca4689 cli: adds compile command and -cachedir option (#945)
This adds a `compile` command and a `-cachedir` option to expose our
compilation cache to end users. This allows substantial speedup
especially for large wasm.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2022-12-20 13:56:29 +08:00
Takeshi Yoneda
d63c747d53 asm,compiler: reduce allocations during compilation (#936)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-12-20 12:49:47 +09:00
Takeshi Yoneda
76ed3047cf arm64: adds support for large in-block jumps with ADR (#851)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-11-10 05:46:46 +01:00
Crypt Keeper
7e3cda8680 Adds more context for ADR offset overrun (#850)
See #847

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2022-11-09 08:27:10 +01:00
Crypt Keeper
329ccca6b1 Switches from gofmt to gofumpt (#848)
This switches to gofumpt and applies changes, as I've noticed working
in dapr (who uses this) that it finds some things that are annoying,
such as inconsistent block formatting in test tables.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2022-11-09 05:48:24 +01:00
Takeshi Yoneda
087ab9d9fc amd64: do not load/store higher bits of 32-bit int/float (#742)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-08-12 12:08:20 +08:00
Vladislav
ec1f595225 Optimize memory bulk operations: fill on x86 (#735)
Signed-off-by: Vladislav Oleshko <vladislav.oleshko@gmail.com>
2022-08-11 12:06:26 +08:00
Takeshi Yoneda
c5daf5a218 interpreter,compiler(arm64): clears higher bits in i32.load_8/16_s (#725)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-07-28 15:45:07 +09:00
Vladislav
63e438aa66 Optimize memory bulk operations: copy on x86 (#700)
Signed-off-by: Vladislav Oleshko <vladislav.oleshko@gmail.com>
Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2022-07-26 18:22:47 +09:00
Takeshi Yoneda
97e3216eb2 asm(arm64): fixes the source register of CMEQ(vector,zero) (#719)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-07-26 15:59:45 +09:00
Takeshi Yoneda
37d2c6d803 asm(arm64): fixes unaligned vector stores (#718)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-07-26 12:10:26 +09:00
Crypt Keeper
939403c10b Makes it possible to implement FunctionListener and Factory (#716)
This simplifies FunctionListener definition by making it possible to
implement both interfaces without intermediate state. Passing the
function definition to the before/after callbacks is the key.

This also continues efforts towards Go 1.19 doc formatting.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2022-07-25 12:53:41 +08:00
Anuraag Agrawal
66d43a2a52 Fix computation of offset in arm64 compiler (#677)
* Fix computation of offset in arm64 compiler

Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
2022-07-07 16:13:00 +09:00
Takeshi Yoneda
c5f1d84914 asm: backfills unit tests and fixes node formatting (#669)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-30 11:07:35 +09:00
Takeshi Yoneda
cbe6170473 compiler: always allocate register to save conditional values (#666)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-29 09:26:50 +09:00
Takeshi Yoneda
2fa67b83bf asm(amd64): resolve NOP padding TODO after golang-asm removal (#663)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-28 09:39:19 +09:00
Takeshi Yoneda
b8c94fd0b9 asm: remove integration tests with golang-asm (#659)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-28 09:19:21 +09:00
Takeshi Yoneda
fd318d4be9 asm: unexport arm64 pkg implementations (#657)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-26 20:26:22 +09:00
Takeshi Yoneda
1489a9f19f arm64: remove golang-asm integeration test (#655)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-24 14:49:50 +09:00
Takeshi Yoneda
70a69c24d0 arm64: remove CompileJumpToMemory (#654)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-24 12:14:56 +09:00
Takeshi Yoneda
c983e2c972 Delete debug assembler (#652)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-23 16:22:58 +09:00
Takeshi Yoneda
3b4544ee48 compiler: remove embedding of pointers of jump tables (#650)
This removes the embedding of pointers of jump tables (uintptr of []byte)
used by BrTable operations. That is the last usage of unsafe.Pointer in
compiler implementations.
Alternatively, we treat jump tables as asm.StaticConst and emit them
into the constPool already implemented and used by various places.

Notably, now the native code compiled by compilers can be reusable
across multiple processes, meaning that they are independent of
any runtime pointers.

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-23 13:42:46 +09:00
Takeshi Yoneda
4136a360ac amd64: removes embeddings of pointers of bit masks for FP arithmetic (#648)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-22 13:31:26 +09:00
Takeshi Yoneda
b0588a98c9 Completes arm64 backend for SIMD instructions (#644)
This completes the implementation of arm64 backend for SIMD instructions.
Notably, now the arm64 compiler passes 100% of WebAssemby 2.0 draft
specification tests.

Combined with the completion of the interpreter and amd64 backend (#624),
this finally resolves #484. Therefore, this also documents that wazero is
100% compatible with WebAssembly 1.0 and 2.0.

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-21 10:51:02 +09:00
Takeshi Yoneda
fdfcd47224 arm64: SIMD extadd, extmul, int-to-int/float-to-int conversions (#642)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-20 17:28:23 +09:00
Takeshi Yoneda
8a2776c2b4 arm64: implement SIMD Integer arithmetics (#641)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-20 15:04:20 +09:00
Takeshi Yoneda
2301afd94b arm64: FP SIMD arithmetic/rounding instructions (#634)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-20 09:08:08 +09:00
Takeshi Yoneda
cd00799b57 arm64: implement vector comparisons (#632)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-17 14:50:57 +09:00
Takeshi Yoneda
338652a182 arm64: bitwise, bit shift, boolean SIMD instructions (#628)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-17 12:31:23 +09:00
Takeshi Yoneda
3068d17c77 interpreter,compiler(amd64): complete SIMD instructions (#624)
This completes the implementation of SIMD proposal for both
the interpreter and compiler(amd64).
This also fixes #210 by adding the complete documentation
over all the wazeroir operations.

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
Co-authored-by: Crypt Keeper <64215+codefromthecrypt@users.noreply.github.com>
2022-06-15 11:52:47 +09:00
Takeshi Yoneda
94d1d31733 SIMD: implements comparison instructions (#617)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
Co-authored-by: Crypt Keeper <64215+codefromthecrypt@users.noreply.github.com>
2022-06-03 16:04:08 +09:00
Takeshi Yoneda
6e458acdbc SIMD: implements bitshift operations (#613)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-02 16:51:57 +09:00
Takeshi Yoneda
2e131a1a2c SIMD: implements boolean and bitwise instructions. (#611)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-01 16:42:35 +09:00
Takeshi Yoneda
41a3dd341c Backfill func validation unit tests for SIMD load, store, and lane manipulations (#609)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-01 12:18:08 +09:00
Takeshi Yoneda
0c303258c7 SIMD: implements v128 load, store and lane manipulations. (#588)
This implements various SIMD instructions related to
load, store, and lane manipulations for all engines.

Notablely, now our engines pass the following specification tests:

* simd_address.wast
* simd_const.wast
* simd_align.wast
* simd_laod16_lane.wast
* simd_laod32_lane.wast
* simd_laod64_lane.wast
* simd_laod8_lane.wast
* simd_lane.wast
* simd_load_extend.wast
* simd_load_splat.wast
* simd_load_zero.wast
* simd_store.wast
* simd_store16_lane.wast
* simd_store32_lane.wast
* simd_store64_lane.wast
* simd_store8_lane.wast

part of #484


Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
Co-authored-by: Adrian Cole <adrian@tetrate.io>
2022-06-01 09:30:05 +09:00
Anuraag Agrawal
4b0084217e Follows go style for arm64 constants. (#587)
* Follows go style for arm64 constants.

Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>

* ZERO -> RZR

Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
2022-05-23 16:30:08 +09:00
Anuraag Agrawal
296b5f56b7 Follows go style for amd64 constants. (#586)
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
2022-05-23 12:51:37 +09:00
Takeshi Yoneda
e42dac040a compiler(arm64): allow large type index during compilation (#584)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-05-23 10:25:32 +09:00
Anuraag Agrawal
ec3ada35a0 Use correct pattern for table tests everywhere (#582)
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
2022-05-20 16:55:01 +09:00