Intel encodings for fadd, fsub, fmul, fdiv.
This commit is contained in:
52
filetests/wasm/f32-arith.cton
Normal file
52
filetests/wasm/f32-arith.cton
Normal file
@@ -0,0 +1,52 @@
|
||||
; Test basic code generation for f32 arithmetic WebAssembly instructions.
|
||||
test compile
|
||||
|
||||
set is_64bit=0
|
||||
isa intel haswell
|
||||
|
||||
set is_64bit=1
|
||||
isa intel haswell
|
||||
|
||||
; Constants.
|
||||
|
||||
; function %f32_const() -> f32
|
||||
|
||||
; Unary operations
|
||||
|
||||
; function %f32_abs(f32) -> f32
|
||||
; function %f32_neg(f32) -> f32
|
||||
; function %f32_sqrt(f32) -> f32
|
||||
; function %f32_ceil(f32) -> f32
|
||||
; function %f32_floor(f32) -> f32
|
||||
; function %f32_trunc(f32) -> f32
|
||||
; function %f32_nearest (f32) -> f32
|
||||
|
||||
; Binary Operations
|
||||
|
||||
function %f32_add(f32, f32) -> f32 {
|
||||
ebb0(v0: f32, v1: f32):
|
||||
v2 = fadd v0, v1
|
||||
return v2
|
||||
}
|
||||
|
||||
function %f32_sub(f32, f32) -> f32 {
|
||||
ebb0(v0: f32, v1: f32):
|
||||
v2 = fsub v0, v1
|
||||
return v2
|
||||
}
|
||||
|
||||
function %f32_mul(f32, f32) -> f32 {
|
||||
ebb0(v0: f32, v1: f32):
|
||||
v2 = fmul v0, v1
|
||||
return v2
|
||||
}
|
||||
|
||||
function %f32_div(f32, f32) -> f32 {
|
||||
ebb0(v0: f32, v1: f32):
|
||||
v2 = fdiv v0, v1
|
||||
return v2
|
||||
}
|
||||
|
||||
; function %f32_min(f32, f32) -> f32
|
||||
; function %f32_max(f32, f32) -> f32
|
||||
; function %f32_copysign(f32, f32) -> f32
|
||||
52
filetests/wasm/f64-arith.cton
Normal file
52
filetests/wasm/f64-arith.cton
Normal file
@@ -0,0 +1,52 @@
|
||||
; Test basic code generation for f64 arithmetic WebAssembly instructions.
|
||||
test compile
|
||||
|
||||
set is_64bit=0
|
||||
isa intel haswell
|
||||
|
||||
set is_64bit=1
|
||||
isa intel haswell
|
||||
|
||||
; Constants.
|
||||
|
||||
; function %f64_const() -> f64
|
||||
|
||||
; Unary operations
|
||||
|
||||
; function %f64_abs(f64) -> f64
|
||||
; function %f64_neg(f64) -> f64
|
||||
; function %f64_sqrt(f64) -> f64
|
||||
; function %f64_ceil(f64) -> f64
|
||||
; function %f64_floor(f64) -> f64
|
||||
; function %f64_trunc(f64) -> f64
|
||||
; function %f64_nearest (f64) -> f64
|
||||
|
||||
; Binary Operations
|
||||
|
||||
function %f64_add(f64, f64) -> f64 {
|
||||
ebb0(v0: f64, v1: f64):
|
||||
v2 = fadd v0, v1
|
||||
return v2
|
||||
}
|
||||
|
||||
function %f64_sub(f64, f64) -> f64 {
|
||||
ebb0(v0: f64, v1: f64):
|
||||
v2 = fsub v0, v1
|
||||
return v2
|
||||
}
|
||||
|
||||
function %f64_mul(f64, f64) -> f64 {
|
||||
ebb0(v0: f64, v1: f64):
|
||||
v2 = fmul v0, v1
|
||||
return v2
|
||||
}
|
||||
|
||||
function %f64_div(f64, f64) -> f64 {
|
||||
ebb0(v0: f64, v1: f64):
|
||||
v2 = fdiv v0, v1
|
||||
return v2
|
||||
}
|
||||
|
||||
; function %f64_min(f64, f64) -> f64
|
||||
; function %f64_max(f64, f64) -> f64
|
||||
; function %f64_copysign(f64, f64) -> f64
|
||||
Reference in New Issue
Block a user