@@ -150,13 +150,13 @@ pub extern "wasm" fn ptr2float_array(ptr : Int) -> FixedArray[Float] =
150
150
#|(func (param i32) (result i32) local.get 0 i32.const 4 i32.sub i32.const 241 i32.store8 local.get 0 i32.const 8 i32.sub)
151
151
152
152
pub extern "wasm" fn ptr2uint64_array(ptr : Int) -> FixedArray[UInt64] =
153
- #|(func (param i32) (result i32) local.get 0 i32.const 4 i32.sub i32.load i32.const 2 i32.lsr i32.const 241 i32.lor local.get 0 i32.const 4 i32.sub i32.store local.get 0 i32.const 8 i32.sub)
153
+ #|(func (param i32) (result i32) local.get 0 i32.const 4 i32.sub i32.load i32.const 1 i32.shr_u i32.const 241 i32.or local.get 0 i32.const 4 i32.sub i32.store local.get 0 i32.const 8 i32.sub)
154
154
155
155
pub extern "wasm" fn ptr2int64_array(ptr : Int) -> FixedArray[Int64] =
156
- #|(func (param i32) (result i32) local.get 0 i32.const 4 i32.sub i32.load i32.const 2 i32.lsr i32.const 241 i32.lor local.get 0 i32.const 4 i32.sub i32.store local.get 0 i32.const 8 i32.sub)
156
+ #|(func (param i32) (result i32) local.get 0 i32.const 4 i32.sub i32.load i32.const 1 i32.shr_u i32.const 241 i32.or local.get 0 i32.const 4 i32.sub i32.store local.get 0 i32.const 8 i32.sub)
157
157
158
158
pub extern "wasm" fn ptr2double_array(ptr : Int) -> FixedArray[Double] =
159
- #|(func (param i32) (result i32) local.get 0 i32.const 4 i32.sub i32.load i32.const 2 i32.lsr i32.const 241 i32.lor local.get 0 i32.const 4 i32.sub i32.store local.get 0 i32.const 8 i32.sub)
159
+ #|(func (param i32) (result i32) local.get 0 i32.const 4 i32.sub i32.load i32.const 1 i32.shr_u i32.const 241 i32.or local.get 0 i32.const 4 i32.sub i32.store local.get 0 i32.const 8 i32.sub)
160
160
161
161
pub trait Any {}
162
162
pub struct Cleanup {
@@ -1629,9 +1629,8 @@ impl Bindgen for FunctionBindgen<'_, '_> {
1629
1629
Instruction :: I32FromS8 => {
1630
1630
results. push ( format ! ( "{ffi_qualifier}extend8({})" , operands[ 0 ] ) )
1631
1631
}
1632
- Instruction :: S8FromI32 => results. push ( format ! ( "({}.land(0xFF))" , operands[ 0 ] ) ) ,
1633
-
1634
- Instruction :: S16FromI32 => results. push ( format ! ( "({}.land(0xFFFF))" , operands[ 0 ] ) ) ,
1632
+ Instruction :: S8FromI32 => results. push ( format ! ( "({} - 0x100)" , operands[ 0 ] ) ) ,
1633
+ Instruction :: S16FromI32 => results. push ( format ! ( "({} - 0x10000)" , operands[ 0 ] ) ) ,
1635
1634
Instruction :: I32FromS16 => {
1636
1635
results. push ( format ! ( "{ffi_qualifier}extend16({})" , operands[ 0 ] ) )
1637
1636
}
0 commit comments