ceil: Wasm SIMD conversion instruction
The ceil SIMD conversion instruction rounds the value in each lane of a v128 value interpretation up to the nearest integer above.
Try it
(module
(import "console" "log" (func $log (param f32)))
(func $main
v128.const f32x4 1.9 2.5 0.5 12.1
f32x4.ceil
f32x4.extract_lane 3
call $log ;; log the result
)
(start $main)
)
WebAssembly.instantiateStreaming(fetch("{%wasm-url%}"), { console });
Syntax
value_type.ceil
value_type-
The type of value the instruction is being run on. The following
v128value interpretations supportceil:f32x4f64x2
ceil-
The
ceilinstruction. Must always be included after thevalue_typeand a period (.).
Type
[input] -> [output]
Binary encoding
| Instruction | Binary format | Example text => binary |
|---|---|---|
f32x4.ceil |
0xfd 103:u32 |
f32x4.ceil => 0xfd 0x67 |
f64x2.ceil |
0xfd 116:u32 |
f64x2.ceil => 0xfd 0x74 |