Improve documentation of the filetest run command (#1645)
* Improve output display of RunCommand The previous use of Debug for displaying `print` and `run` results was less than clear. * Avoid checking the types of vectors during trampoline construction Because DataValue only understands `V128` vectors, we avoid type-checking vector values when constructing the trampoline arguments. * Improve the documentation of the filetest `run` command Adds an up-to-date example of how to use the `run` and `print` directives and includes an actual use of the new directives in a SIMD arithmetic filetest.
This commit is contained in:
@@ -2,37 +2,21 @@ test run
|
||||
set enable_simd
|
||||
target x86_64 skylake
|
||||
|
||||
function %iadd_i32x4() -> b1 {
|
||||
block0:
|
||||
v0 = vconst.i32x4 [1 1 1 1]
|
||||
v1 = vconst.i32x4 [1 2 3 4]
|
||||
function %iadd_i32x4(i32x4, i32x4) -> i32x4 {
|
||||
block0(v0:i32x4, v1:i32x4):
|
||||
v2 = iadd v0, v1
|
||||
|
||||
v3 = extractlane v2, 0
|
||||
v4 = icmp_imm eq v3, 2
|
||||
|
||||
v5 = extractlane v2, 3
|
||||
v6 = icmp_imm eq v5, 5
|
||||
; TODO replace extractlanes with vector comparison
|
||||
|
||||
v7 = band v4, v6
|
||||
return v7
|
||||
return v2
|
||||
}
|
||||
; run
|
||||
; run: %iadd_i32x4([1 1 1 1], [1 2 3 4]) == [2 3 4 5]
|
||||
|
||||
function %iadd_i8x16_with_overflow() -> b1 {
|
||||
function %iadd_i8x16_with_overflow() -> i8x16 {
|
||||
block0:
|
||||
v0 = vconst.i8x16 [255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255]
|
||||
v1 = vconst.i8x16 [2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2]
|
||||
v2 = iadd v0, v1
|
||||
|
||||
v3 = extractlane v2, 0
|
||||
v4 = icmp_imm eq v3, 1
|
||||
; TODO replace extractlane with vector comparison
|
||||
|
||||
return v4
|
||||
return v2
|
||||
}
|
||||
; run
|
||||
; run: %iadd_i8x16_with_overflow() == [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]
|
||||
|
||||
function %isub_i32x4_rex() -> b1 {
|
||||
block0:
|
||||
|
||||
Reference in New Issue
Block a user