-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CL/aarch64: implement the wasm SIMD
v128.load{32,64}_zero
instructi…
…ons. This patch implements, for aarch64, the following wasm SIMD extensions. v128.load32_zero and v128.load64_zero instructions WebAssembly/simd#237 The changes are straightforward: * no new CLIF instructions. They are translated into an existing CLIF scalar load followed by a CLIF `scalar_to_vector`. * the comment/specification for CLIF `scalar_to_vector` has been changed to match the actual intended semantics, per consulation with Andrew Brown. * translation from `scalar_to_vector` to aarch64 `fmov` instruction. This has been generalised slightly so as to allow both 32- and 64-bit transfers. * special-case zero in `lower_constant_f128` in order to avoid a potentially slow call to `Inst::load_fp_constant128`. * Once "Allow loads to merge into other operations during instruction selection in MachInst backends" (#2340) lands, we can use that functionality to pattern match the two-CLIF pair and emit a single AArch64 instruction. * A simple filetest has been added. There is no comprehensive testcase in this commit, because that is a separate repo. The implementation has been tested, nevertheless.
- Loading branch information
1 parent
285edee
commit dd9bfce
Showing
9 changed files
with
144 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
cranelift/filetests/filetests/isa/aarch64/simd_load_zero.clif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
test compile | ||
target aarch64 | ||
|
||
function %f1() -> i64x2 { | ||
block0: | ||
v0 = iconst.i64 281474976710657 | ||
v1 = scalar_to_vector.i64x2 v0 | ||
return v1 | ||
} | ||
|
||
; check: stp fp, lr, [sp, #-16]! | ||
; nextln: mov fp, sp | ||
; nextln: movz x0, #1 | ||
; nextln: movk x0, #1, LSL #48 | ||
; nextln: fmov d0, x0 | ||
; nextln: mov sp, fp | ||
; nextln: ldp fp, lr, [sp], #16 | ||
; nextln: ret | ||
|
||
function %f2() -> i32x4 { | ||
block0: | ||
v0 = iconst.i32 42679 | ||
v1 = scalar_to_vector.i32x4 v0 | ||
return v1 | ||
} | ||
|
||
; check: stp fp, lr, [sp, #-16]! | ||
; nextln: mov fp, sp | ||
; nextln: movz x0, #42679 | ||
; nextln: fmov s0, w0 | ||
; nextln: mov sp, fp | ||
; nextln: ldp fp, lr, [sp], #16 | ||
; nextln: ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters