forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a WebAssembly filetests directory.
Start adding little 'test compile' test cases which check that the full compilation pipeline works for each WebAssembly instruction.
- Loading branch information
Jakob Stoklund Olesen
committed
Jul 12, 2017
1 parent
6cc729a
commit 3d738d0
Showing
1 changed file
with
62 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
; Test basic code generation for i32 arithmetic WebAssembly instructions. | ||
test compile | ||
|
||
set is_64bit | ||
isa intel | ||
|
||
; Constants. | ||
|
||
function %i32_const() -> i32 { | ||
ebb0: | ||
v0 = iconst.i32 0x8765_4321 | ||
return v0 | ||
} | ||
|
||
; Unary operations. | ||
|
||
; function %i32_clz(i32) -> i32 | ||
; function %i32_ctz(i32) -> i32 | ||
; function %i32_popcnt(i32) -> i32 | ||
|
||
; Binary operations. | ||
|
||
function %i32_add(i32, i32) -> i32 { | ||
ebb0(v0: i32, v1: i32): | ||
v2 = iadd v0, v1 | ||
return v2 | ||
} | ||
|
||
function %i32_sub(i32, i32) -> i32 { | ||
ebb0(v0: i32, v1: i32): | ||
v2 = isub v0, v1 | ||
return v2 | ||
} | ||
|
||
; function %i32_mul(i32, i32) -> i32 | ||
; function %i32_div(i32, i32) -> i32 | ||
; function %i32_rem_s(i32, i32) -> i32 | ||
; function %i32_rem_u(i32, i32) -> i32 | ||
|
||
function %i32_and(i32, i32) -> i32 { | ||
ebb0(v0: i32, v1: i32): | ||
v2 = band v0, v1 | ||
return v2 | ||
} | ||
|
||
function %i32_or(i32, i32) -> i32 { | ||
ebb0(v0: i32, v1: i32): | ||
v2 = bor v0, v1 | ||
return v2 | ||
} | ||
|
||
function %i32_xor(i32, i32) -> i32 { | ||
ebb0(v0: i32, v1: i32): | ||
v2 = bxor v0, v1 | ||
return v2 | ||
} | ||
|
||
; function %i32_shl(i32, i32) -> i32 | ||
; function %i32_shr_s(i32, i32) -> i32 | ||
; function %i32_shr_u(i32, i32) -> i32 | ||
; function %i32_rotl(i32, i32) -> i32 | ||
; function %i32_rotr(i32, i32) -> i32 |