Repository: bytecodealliance/wasmtime
Pull request #7773 (2024-01-12 15:19:19)

Winch: Float conversion instructions
<!--
Please make sure you include the following information:

- If this work has been discussed elsewhere, please include a link to that
  conversation. If it was discussed in an issue, just mention "issue #...".

- Explain why this change is needed. If the details are in an issue already,
  this can be brief.

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
Part of #6528. Adds support for the following instructions to Winch:
- `i32.trunc_f32_s`
- `i32.trunc_f32_u`
- `i32.trunc_f64_s`
- `i32.trunc_f64_u`
- `i64.trunc_f32_s`
- `i64.trunc_f32_u`
- `i64.trunc_f64_s`
- `i64.trunc_f64_u`
- `i32.reinterpret_f32`
- `i64.reinterpret_f64`
- `f32.convert_i32_s`
- `f32.convert_i32_u`
- `f32.convert_i64_s`
- `f32.convert_i64_u`
- `f64.convert_i32_s`
- `f64.convert_i32_u`
- `f64.convert_i64_s`
- `f64.convert_i64_u`
- `f32.reinterpret_i32`
- `f64.reinterpret_i64`
- `f32.demote_f64`
- `f64.promote_f32`

jeffcharles: Not sure why https://github.com/bytecodealliance/wasmtime/actions/runs/7504830983/job/20432782059 failed. Running `cargo test --target=x86_64-apple-darwin -- wast::Winch --nocapture` locally shows everything as passing.
saulecabrera: It's because the conversion spec tests assert for traps https://github.com/bytecodealliance/wasmtime/pull/7773/files#diff-823efed0acf795e9245a551aadae26695321f840cbe4b51b12410b26bde35c45R70 and currently since Winch doesn't fully encode unwind information, any tests that trap will fail on Windows. You need to add the conversion suites that trap here https://github.com/bytecodealliance/wasmtime/blob/main/build.rs#L210

Patch:
diff --git a/build.rs b/build.rs
index 5e8ef0a78..eb3ea2db9 100644
--- a/build.rs
+++ b/build.rs
@@ -211,6 +211,7 @@ fn ignore(testsuite: &str, testname: &str, strategy: &str) -> bool {
             "i32",
             "i64",
             "call_indirect",
+            "conversions",
             "table_fill",
             "table_init",
             "table_copy",
diff --git a/fuzz/fuzz_targets/differential.rs b/fuzz/fuzz_targets/differential.rs
index fef388c85..f9f5e2d58 100644
--- a/fuzz/fuzz_targets/differential.rs
+++ b/fuzz/fuzz_targets/differential.rs
@@ -375,6 +375,16 @@ fn winch_supports_module(module: &[u8]) -> bool {
                         | I64Extend8S { .. }
                         | I64Extend16S { .. }
                         | I64Extend32S { .. }
+                        | I32TruncF32S { .. }
+                        | I32TruncF32U { .. }
+                        | I32TruncF64S { .. }
+                        | I32TruncF64U { .. }
+                        | I64TruncF32S { .. }
+                        | I64TruncF32U { .. }
+                        | I64TruncF64S { .. }
+                        | I64TruncF64U { .. }
+                        | I32ReinterpretF32 { .. }
+                        | I64ReinterpretF64 { .. }
                         | LocalGet { .. }
                         | LocalSet { .. }
                         | LocalTee { .. }
@@ -426,6 +436,18 @@ fn winch_supports_module(module: &[u8]) -> bool {
                         | F64Le { .. }
                         | F32Ge { .. }
                         | F64Ge { .. }
+                        | F32ConvertI32S { .. }
+                        | F32ConvertI32U { .. }
+                        | F32ConvertI64S { .. }
+                        | F32ConvertI64U { .. }
+                        | F64ConvertI32S { .. }
+                        | F64ConvertI32U { .. }
+                        | F64ConvertI64S { .. }
+                        | F64ConvertI64U { .. }
+                        | F32ReinterpretI32 { .. }
+                        | F64ReinterpretI64 { .. }
+                        | F32DemoteF64 { .. }
+                        | F64PromoteF32 { .. }
                         | CallIndirect { .. }
                         | ElemDrop { .. }
                         | TableCopy { .. }
diff --git a/winch/codegen/src/codegen/context.rs b/winch/codegen/src/codegen/context.rs
index b6fd06b00..c8ee909c3 100644
--- a/winch/codegen/src/codegen/context.rs
+++ b/winch/codegen/src/codegen/context.rs
@@ -322,6 +322,48 @@ impl<'a, 'builtins> CodeGenContext<'a, 'builtins> {
         };
     }
 
+    /// Prepares arguments for emitting a convert operation.
+    pub fn convert_op<F, M>(&mut self, masm: &mut M, dst_ty: WasmType, mut emit: F)
+    where
+        F: FnMut(&mut M, Reg, Reg, OperandSize),
+        M: MacroAssembler,
+    {
+        let src = self.pop_to_reg(masm, None);
+        let dst = self.reg_for_type(dst_ty, masm);
+        let dst_size = match dst_ty {
+            WasmType::I32 => OperandSize::S32,
+            WasmType::I64 => OperandSize::S64,
+            WasmType::F32 => OperandSize::S32,
+            WasmType::F64 => OperandSize::S64,
+            WasmType::V128 => unreachable!(),
+            WasmType::Ref(_) => unreachable!(),
+        };
+
+        emit(masm, dst, src.into(), dst_size);
+
+        self.free_reg(src);
+        self.stack.push(TypedReg::new(dst_ty, dst).into());
+    }
+
+    /// Prepares arguments for emitting a convert operation with a temporary
+    /// register.
+    pub fn convert_op_with_tmp_reg<F, M>(
+        &mut self,
+        masm: &mut M,
+        dst_ty: WasmType,
+        tmp_reg_class: RegClass,
+        mut emit: F,
+    ) where
+        F: FnMut(&mut M, Reg, Reg, Reg, OperandSize),
+        M: MacroAssembler,
+    {
+        let tmp_gpr = self.reg_for_class(tmp_reg_class, masm);
+        self.convert_op(masm, dst_ty, |masm, dst, src, dst_size| {
+            emit(masm, dst, src, tmp_gpr, dst_size);
+        });
+        self.free_reg(tmp_gpr);
+    }
+
     /// Drops the last `n` elements of the stack, calling the provided
     /// function for each `n` stack value.
     /// The values are dropped in top-to-bottom order.
diff --git a/winch/codegen/src/isa/aarch64/masm.rs b/winch/codegen/src/isa/aarch64/masm.rs
index 714913489..8c5a41d12 100644
--- a/winch/codegen/src/isa/aarch64/masm.rs
+++ b/winch/codegen/src/isa/aarch64/masm.rs
@@ -344,6 +344,64 @@ impl Masm for MacroAssembler {
         todo!()
     }
 
+    fn signed_truncate(
+        &mut self,
+        _src: Reg,
+        _dst: Reg,
+        _src_size: OperandSize,
+        _dst_size: OperandSize,
+    ) {
+        todo!()
+    }
+
+    fn unsigned_truncate(
+        &mut self,
+        _src: Reg,
+        _dst: Reg,
+        _tmp_fpr: Reg,
+        _src_size: OperandSize,
+        _dst_size: OperandSize,
+    ) {
+        todo!()
+    }
+
+    fn signed_convert(
+        &mut self,
+        _src: Reg,
+        _dst: Reg,
+        _src_size: OperandSize,
+        _dst_size: OperandSize,
+    ) {
+        todo!()
+    }
+
+    fn unsigned_convert(
+        &mut self,
+        _src: Reg,
+        _dst: Reg,
+        _tmp_gpr: Reg,
+        _src_size: OperandSize,
+        _dst_size: OperandSize,
+    ) {
+        todo!()
+    }
+
+    fn reinterpret_float_as_int(&mut self, _src: Reg, _dst: Reg, _size: OperandSize) {
+        todo!()
+    }
+
+    fn reinterpret_int_as_float(&mut self, _src: Reg, _dst: Reg, _size: OperandSize) {
+        todo!()
+    }
+
+    fn demote(&mut self, _src: Reg, _dst: Reg) {
+        todo!()
+    }
+
+    fn promote(&mut self, _src: Reg, _dst: Reg) {
+        todo!()
+    }
+
     fn push(&mut self, reg: Reg, _size: OperandSize) -> StackSlot {
         let size = <Self::ABI as abi::ABI>::word_bytes();
         self.reserve_stack(size);
diff --git a/winch/codegen/src/isa/x64/asm.rs b/winch/codegen/src/isa/x64/asm.rs
index 9fa1d1cb5..256d4fb9f 100644
--- a/winch/codegen/src/isa/x64/asm.rs
+++ b/winch/codegen/src/isa/x64/asm.rs
@@ -514,6 +514,126 @@ impl Assembler {
         })
     }
 
+    pub fn xmm_to_gpr(&mut self, src: Reg, dst: Reg, size: OperandSize) {
+        let op = match size {
+            OperandSize::S32 => SseOpcode::Movd,
+            OperandSize::S64 => SseOpcode::Movq,
+            OperandSize::S128 => unreachable!(),
+        };
+
+        self.emit(Inst::XmmToGpr {
+            op,
+            src: src.into(),
+            dst: dst.into(),
+            dst_size: size.into(),
+        });
+    }
+
+    /// Convert float to signed int.
+    pub fn cvt_float_to_sint_seq(
+        &mut self,
+        src: Reg,
+        dst: Reg,
+        tmp_gpr: Reg,
+        tmp_xmm: Reg,
+        src_size: OperandSize,
+        dst_size: OperandSize,
+    ) {
+        self.emit(Inst::CvtFloatToSintSeq {
+            dst_size: dst_size.into(),
+            src_size: src_size.into(),
+            is_saturating: false,
+            src: src.into(),
+            dst: dst.into(),
+            tmp_gpr: tmp_gpr.into(),
+            tmp_xmm: tmp_xmm.into(),
+        });
+    }
+
+    /// Convert float to unsigned int.
+    pub fn cvt_float_to_uint_seq(
+        &mut self,
+        src: Reg,
+        dst: Reg,
+        tmp_gpr: Reg,
+        tmp_xmm: Reg,
+        tmp_xmm2: Reg,
+        src_size: OperandSize,
+        dst_size: OperandSize,
+    ) {
+        self.emit(Inst::CvtFloatToUintSeq {
+            dst_size: dst_size.into(),
+            src_size: src_size.into(),
+            is_saturating: false,
+            src: src.into(),
+            dst: dst.into(),
+            tmp_gpr: tmp_gpr.into(),
+            tmp_xmm: tmp_xmm.into(),
+            tmp_xmm2: tmp_xmm2.into(),
+        });
+    }
+
+    /// Convert signed int to float.
+    pub fn cvt_sint_to_float(
+        &mut self,
+        src: Reg,
+        dst: Reg,
+        src_size: OperandSize,
+        dst_size: OperandSize,
+    ) {
+        let op = match dst_size {
+            OperandSize::S32 => SseOpcode::Cvtsi2ss,
+            OperandSize::S64 => SseOpcode::Cvtsi2sd,
+            OperandSize::S128 => unreachable!(),
+        };
+        self.emit(Inst::CvtIntToFloat {
+            op,
+            src1: dst.into(),
+            src2: src.into(),
+            dst: dst.into(),
+            src2_size: src_size.into(),
+        });
+    }
+
+    /// Convert unsigned 64-bit int to float.
+    pub fn cvt_uint64_to_float_seq(
+        &mut self,
+        src: Reg,
+        dst: Reg,
+        tmp_gpr1: Reg,
+        tmp_gpr2: Reg,
+        dst_size: OperandSize,
+    ) {
+        self.emit(Inst::CvtUint64ToFloatSeq {
+            dst_size: dst_size.into(),
+            src: src.into(),
+            dst: dst.into(),
+            tmp_gpr1: tmp_gpr1.into(),
+            tmp_gpr2: tmp_gpr2.into(),
+        });
+    }
+
+    /// Change precision of float.
+    pub fn cvt_float_to_float(
+        &mut self,
+        src: Reg,
+        dst: Reg,
+        src_size: OperandSize,
+        dst_size: OperandSize,
+    ) {
+        let op = match (src_size, dst_size) {
+            (OperandSize::S32, OperandSize::S64) => SseOpcode::Cvtss2sd,
+            (OperandSize::S64, OperandSize::S32) => SseOpcode::Cvtsd2ss,
+            _ => unimplemented!(),
+        };
+
+        self.emit(Inst::XmmUnaryRmRUnaligned {
+            op,
+            src: Xmm::new(src.into()).expect("valid xmm unaligned").into(),
+            dst: dst.into(),
+        });
+    }
+
     pub fn or_rr(&mut self, src: Reg, dst: Reg, size: OperandSize) {
         self.emit(Inst::AluRmiR {
             size: size.into(),
diff --git a/winch/codegen/src/isa/x64/masm.rs b/winch/codegen/src/isa/x64/masm.rs
index 459a64964..453de2416 100644
--- a/winch/codegen/src/isa/x64/masm.rs
+++ b/winch/codegen/src/isa/x64/masm.rs
@@ -954,6 +954,81 @@ impl Masm for MacroAssembler {
         }
     }
 
+    fn signed_truncate(
+        &mut self,
+        src: Reg,
+        dst: Reg,
+        src_size: OperandSize,
+        dst_size: OperandSize,
+    ) {
+        self.asm.cvt_float_to_sint_seq(
+            src,
+            dst,
+            regs::scratch(),
+            regs::scratch_xmm(),
+            src_size,
+            dst_size,
+        );
+    }
+
+    fn unsigned_truncate(
+        &mut self,
+        src: Reg,
+        dst: Reg,
+        tmp_fpr: Reg,
+        src_size: OperandSize,
+        dst_size: OperandSize,
+    ) {
+        self.asm.cvt_float_to_uint_seq(
+            src,
+            dst,
+            regs::scratch(),
+            regs::scratch_xmm(),
+            tmp_fpr,
+            src_size,
+            dst_size,
+        );
+    }
+
+    fn signed_convert(&mut self, src: Reg, dst: Reg, src_size: OperandSize, dst_size: OperandSize) {
+        self.asm.cvt_sint_to_float(src, dst, src_size, dst_size);
+    }
+
+    fn unsigned_convert(
+        &mut self,
+        src: Reg,
+        dst: Reg,
+        tmp_gpr: Reg,
+        src_size: OperandSize,
+        dst_size: OperandSize,
+    ) {
+        // Need to convert unsigned uint32 to uint64 for conversion instruction sequence.
+        if let OperandSize::S32 = src_size {
+            self.extend(src, src, ExtendKind::I64ExtendI32U);
+        }
+
+        self.asm
+            .cvt_uint64_to_float_seq(src, dst, regs::scratch(), tmp_gpr, dst_size);
+    }
+
+    fn reinterpret_float_as_int(&mut self, src: Reg, dst: Reg, size: OperandSize) {
+        self.asm.xmm_to_gpr(src, dst, size);
+    }
+
+    fn reinterpret_int_as_float(&mut self, src: Reg, dst: Reg, size: OperandSize) {
+        self.asm.gpr_to_xmm(src.into(), dst, size);
+    }
+
+    fn demote(&mut self, src: Reg, dst: Reg) {
+        self.asm
+            .cvt_float_to_float(src.into(), dst.into(), OperandSize::S64, OperandSize::S32);
+    }
+
+    fn promote(&mut self, src: Reg, dst: Reg) {
+        self.asm
+            .cvt_float_to_float(src.into(), dst.into(), OperandSize::S32, OperandSize::S64);
+    }
+
     fn unreachable(&mut self) {
         self.asm.trap(TrapCode::UnreachableCodeReached)
     }
diff --git a/winch/codegen/src/masm.rs b/winch/codegen/src/masm.rs
index a2e09b009..68d399591 100644
--- a/winch/codegen/src/masm.rs
+++ b/winch/codegen/src/masm.rs
@@ -625,6 +625,48 @@ pub(crate) trait MacroAssembler {
     /// Extends an integer of a given size to a larger size.
     fn extend(&mut self, src: Reg, dst: Reg, kind: ExtendKind);
 
+    /// Emits one or more instructions to perform a signed truncation of a
+    /// float into an integer.
+    fn signed_truncate(&mut self, src: Reg, dst: Reg, src_size: OperandSize, dst_size: OperandSize);
+
+    /// Emits one or more instructions to perform an unsigned truncation of a
+    /// float into an integer.
+    fn unsigned_truncate(
+        &mut self,
+        src: Reg,
+        dst: Reg,
+        tmp_fpr: Reg,
+        src_size: OperandSize,
+        dst_size: OperandSize,
+    );
+
+    /// Emits one or more instructions to perform a signed convert of an
+    /// integer into a float.
+    fn signed_convert(&mut self, src: Reg, dst: Reg, src_size: OperandSize, dst_size: OperandSize);
+
+    /// Emits one or more instructions to perform an unsigned convert of an
+    /// integer into a float.
+    fn unsigned_convert(
+        &mut self,
+        src: Reg,
+        dst: Reg,
+        tmp_gpr: Reg,
+        src_size: OperandSize,
+        dst_size: OperandSize,
+    );
+
+    /// Reinterpret a float as an integer.
+    fn reinterpret_float_as_int(&mut self, src: Reg, dst: Reg, size: OperandSize);
+
+    /// Reinterpret an integer as a float.
+    fn reinterpret_int_as_float(&mut self, src: Reg, dst: Reg, size: OperandSize);
+
+    /// Demote an f64 to an f32.
+    fn demote(&mut self, src: Reg, dst: Reg);
+
+    /// Promote an f32 to an f64.
+    fn promote(&mut self, src: Reg, dst: Reg);
+
     /// Zero a given memory range.
     ///
     /// The default implementation divides the given memory range
diff --git a/winch/codegen/src/visitor.rs b/winch/codegen/src/visitor.rs
index 280fb43cb..3a34a3bb5 100644
--- a/winch/codegen/src/visitor.rs
+++ b/winch/codegen/src/visitor.rs
@@ -12,6 +12,7 @@ use crate::masm::{
 };
 use crate::stack::{TypedReg, Val};
 use cranelift_codegen::ir::TrapCode;
+use regalloc2::RegClass;
 use smallvec::SmallVec;
 use wasmparser::BrTable;
 use wasmparser::{BlockType, Ieee32, Ieee64, VisitOperator};
@@ -85,6 +86,18 @@ macro_rules! def_unsupported {
     (emit F64Le $($rest:tt)*) => {};
     (emit F32Ge $($rest:tt)*) => {};
     (emit F64Ge $($rest:tt)*) => {};
+    (emit F32ConvertI32S $($rest:tt)*) => {};
+    (emit F32ConvertI32U $($rest:tt)*) => {};
+    (emit F32ConvertI64S $($rest:tt)*) => {};
+    (emit F32ConvertI64U $($rest:tt)*) => {};
+    (emit F64ConvertI32S $($rest:tt)*) => {};
+    (emit F64ConvertI32U $($rest:tt)*) => {};
+    (emit F64ConvertI64S $($rest:tt)*) => {};
+    (emit F64ConvertI64U $($rest:tt)*) => {};
+    (emit F32ReinterpretI32 $($rest:tt)*) => {};
+    (emit F64ReinterpretI64 $($rest:tt)*) => {};
+    (emit F32DemoteF64 $($rest:tt)*) => {};
+    (emit F64PromoteF32 $($rest:tt)*) => {};
     (emit I32Add $($rest:tt)*) => {};
     (emit I64Add $($rest:tt)*) => {};
     (emit I32Sub $($rest:tt)*) => {};
@@ -151,6 +164,16 @@ macro_rules! def_unsupported {
     (emit I64Extend8S $($rest:tt)*) => {};
     (emit I64Extend16S $($rest:tt)*) => {};
     (emit I64Extend32S $($rest:tt)*) => {};
+    (emit I32TruncF32S $($rest:tt)*) => {};
+    (emit I32TruncF32U $($rest:tt)*) => {};
+    (emit I32TruncF64S $($rest:tt)*) => {};
+    (emit I32TruncF64U $($rest:tt)*) => {};
+    (emit I64TruncF32S $($rest:tt)*) => {};
+    (emit I64TruncF32U $($rest:tt)*) => {};
+    (emit I64TruncF64S $($rest:tt)*) => {};
+    (emit I64TruncF64U $($rest:tt)*) => {};
+    (emit I32ReinterpretF32 $($rest:tt)*) => {};
+    (emit I64ReinterpretF64 $($rest:tt)*) => {};
     (emit LocalGet $($rest:tt)*) => {};
     (emit LocalSet $($rest:tt)*) => {};
     (emit Call $($rest:tt)*) => {};
@@ -573,6 +596,108 @@ where
         );
     }
 
+    fn visit_f32_convert_i32_s(&mut self) {
+        self.context
+            .convert_op(self.masm, WasmType::F32, |masm, dst, src, dst_size| {
+                masm.signed_convert(src, dst, OperandSize::S32, dst_size);
+            });
+    }
+
+    fn visit_f32_convert_i32_u(&mut self) {
+        self.context.convert_op_with_tmp_reg(
+            self.masm,
+            WasmType::F32,
+            RegClass::Int,
+            |masm, dst, src, tmp_gpr, dst_size| {
+                masm.unsigned_convert(src, dst, tmp_gpr, OperandSize::S32, dst_size);
+            },
+        );
+    }
+
+    fn visit_f32_convert_i64_s(&mut self) {
+        self.context
+            .convert_op(self.masm, WasmType::F32, |masm, dst, src, dst_size| {
+                masm.signed_convert(src, dst, OperandSize::S64, dst_size);
+            });
+    }
+
+    fn visit_f32_convert_i64_u(&mut self) {
+        self.context.convert_op_with_tmp_reg(
+            self.masm,
+            WasmType::F32,
+            RegClass::Int,
+            |masm, dst, src, tmp_gpr, dst_size| {
+                masm.unsigned_convert(src, dst, tmp_gpr, OperandSize::S64, dst_size);
+            },
+        );
+    }
+
+    fn visit_f64_convert_i32_s(&mut self) {
+        self.context
+            .convert_op(self.masm, WasmType::F64, |masm, dst, src, dst_size| {
+                masm.signed_convert(src, dst, OperandSize::S32, dst_size);
+            });
+    }
+
+    fn visit_f64_convert_i32_u(&mut self) {
+        self.context.convert_op_with_tmp_reg(
+            self.masm,
+            WasmType::F64,
+            RegClass::Int,
+            |masm, dst, src, tmp_gpr, dst_size| {
+                masm.unsigned_convert(src, dst, tmp_gpr, OperandSize::S32, dst_size);
+            },
+        );
+    }
+
+    fn visit_f64_convert_i64_s(&mut self) {
+        self.context
+            .convert_op(self.masm, WasmType::F64, |masm, dst, src, dst_size| {
+                masm.signed_convert(src, dst, OperandSize::S64, dst_size);
+            });
+    }
+
+    fn visit_f64_convert_i64_u(&mut self) {
+        self.context.convert_op_with_tmp_reg(
+            self.masm,
+            WasmType::F64,
+            RegClass::Int,
+            |masm, dst, src, tmp_gpr, dst_size| {
+                masm.unsigned_convert(src, dst, tmp_gpr, OperandSize::S64, dst_size);
+            },
+        );
+    }
+
+    fn visit_f32_reinterpret_i32(&mut self) {
+        self.context
+            .convert_op(self.masm, WasmType::F32, |masm, dst, src, size| {
+                masm.reinterpret_int_as_float(src.into(), dst, size);
+            });
+    }
+
+    fn visit_f64_reinterpret_i64(&mut self) {
+        self.context
+            .convert_op(self.masm, WasmType::F64, |masm, dst, src, size| {
+                masm.reinterpret_int_as_float(src.into(), dst, size);
+            });
+    }
+
+    fn visit_f32_demote_f64(&mut self) {
+        self.context
+            .unop(self.masm, OperandSize::S64, &mut |masm, reg, _size| {
+                masm.demote(reg, reg);
+                TypedReg::f32(reg)
+            });
+    }
+
+    fn visit_f64_promote_f32(&mut self) {
+        self.context
+            .unop(self.masm, OperandSize::S32, &mut |masm, reg, _size| {
+                masm.promote(reg, reg);
+                TypedReg::f64(reg)
+            });
+    }
+
     fn visit_i32_add(&mut self) {
         self.context.i32_binop(self.masm, |masm, dst, src, size| {
             masm.add(dst, dst, src, size);
@@ -1009,6 +1134,108 @@ where
         });
     }
 
+    fn visit_i32_trunc_f32_s(&mut self) {
+        use OperandSize::*;
+
+        self.context
+            .convert_op(self.masm, WasmType::I32, |masm, dst, src, dst_size| {
+                masm.signed_truncate(src, dst, S32, dst_size);
+            });
+    }
+
+    fn visit_i32_trunc_f32_u(&mut self) {
+        use OperandSize::*;
+
+        self.context.convert_op_with_tmp_reg(
+            self.masm,
+            WasmType::I32,
+            RegClass::Float,
+            |masm, dst, src, tmp_fpr, dst_size| {
+                masm.unsigned_truncate(src, dst, tmp_fpr, S32, dst_size);
+            },
+        );
+    }
+
+    fn visit_i32_trunc_f64_s(&mut self) {
+        use OperandSize::*;
+
+        self.context
+            .convert_op(self.masm, WasmType::I32, |masm, dst, src, dst_size| {
+                masm.signed_truncate(src, dst, S64, dst_size);
+            });
+    }
+
+    fn visit_i32_trunc_f64_u(&mut self) {
+        use OperandSize::*;
+
+        self.context.convert_op_with_tmp_reg(
+            self.masm,
+            WasmType::I32,
+            RegClass::Float,
+            |masm, dst, src, tmp_fpr, dst_size| {
+                masm.unsigned_truncate(src, dst, tmp_fpr, S64, dst_size);
+            },
+        );
+    }
+
+    fn visit_i64_trunc_f32_s(&mut self) {
+        use OperandSize::*;
+
+        self.context
+            .convert_op(self.masm, WasmType::I64, |masm, dst, src, dst_size| {
+                masm.signed_truncate(src, dst, S32, dst_size);
+            });
+    }
+
+    fn visit_i64_trunc_f32_u(&mut self) {
+        use OperandSize::*;
+
+        self.context.convert_op_with_tmp_reg(
+            self.masm,
+            WasmType::I64,
+            RegClass::Float,
+            |masm, dst, src, tmp_fpr, dst_size| {
+                masm.unsigned_truncate(src, dst, tmp_fpr, S32, dst_size);
+            },
+        );
+    }
+
+    fn visit_i64_trunc_f64_s(&mut self) {
+        use OperandSize::*;
+
+        self.context
+            .convert_op(self.masm, WasmType::I64, |masm, dst, src, dst_size| {
+                masm.signed_truncate(src, dst, S64, dst_size);
+            });
+    }
+
+    fn visit_i64_trunc_f64_u(&mut self) {
+        use OperandSize::*;
+
+        self.context.convert_op_with_tmp_reg(
+            self.masm,
+            WasmType::I64,
+            RegClass::Float,
+            |masm, dst, src, tmp_fpr, dst_size| {
+                masm.unsigned_truncate(src, dst, tmp_fpr, S64, dst_size);
+            },
+        );
+    }
+
+    fn visit_i32_reinterpret_f32(&mut self) {
+        self.context
+            .convert_op(self.masm, WasmType::I32, |masm, dst, src, size| {
+                masm.reinterpret_float_as_int(src.into(), dst, size);
+            });
+    }
+
+    fn visit_i64_reinterpret_f64(&mut self) {
+        self.context
+            .convert_op(self.masm, WasmType::I64, |masm, dst, src, size| {
+                masm.reinterpret_float_as_int(src.into(), dst, size);
+            });
+    }
+
     fn visit_local_get(&mut self, index: u32) {
         use WasmType::*;
         let context = &mut self.context;


Test patch:
diff --git a/tests/misc_testsuite/winch/conversions.wast b/tests/misc_testsuite/winch/conversions.wast
index 6f84e57d2..c6422d2e1 100644
--- a/tests/misc_testsuite/winch/conversions.wast
+++ b/tests/misc_testsuite/winch/conversions.wast
@@ -2,6 +2,28 @@
   (func (export "i64.extend_i32_s") (param $x i32) (result i64) (i64.extend_i32_s (local.get $x)))
   (func (export "i64.extend_i32_u") (param $x i32) (result i64) (i64.extend_i32_u (local.get $x)))
   (func (export "i32.wrap_i64") (param $x i64) (result i32) (i32.wrap_i64 (local.get $x)))
+  (func (export "i32.trunc_f32_s") (param $x f32) (result i32) (i32.trunc_f32_s (local.get $x)))
+  (func (export "i32.trunc_f32_u") (param $x f32) (result i32) (i32.trunc_f32_u (local.get $x)))
+  (func (export "i32.trunc_f64_s") (param $x f64) (result i32) (i32.trunc_f64_s (local.get $x)))
+  (func (export "i32.trunc_f64_u") (param $x f64) (result i32) (i32.trunc_f64_u (local.get $x)))
+  (func (export "i64.trunc_f32_s") (param $x f32) (result i64) (i64.trunc_f32_s (local.get $x)))
+  (func (export "i64.trunc_f32_u") (param $x f32) (result i64) (i64.trunc_f32_u (local.get $x)))
+  (func (export "i64.trunc_f64_s") (param $x f64) (result i64) (i64.trunc_f64_s (local.get $x)))
+  (func (export "i64.trunc_f64_u") (param $x f64) (result i64) (i64.trunc_f64_u (local.get $x)))
+  (func (export "f32.convert_i32_s") (param $x i32) (result f32) (f32.convert_i32_s (local.get $x)))
+  (func (export "f32.convert_i64_s") (param $x i64) (result f32) (f32.convert_i64_s (local.get $x)))
+  (func (export "f64.convert_i32_s") (param $x i32) (result f64) (f64.convert_i32_s (local.get $x)))
+  (func (export "f64.convert_i64_s") (param $x i64) (result f64) (f64.convert_i64_s (local.get $x)))
+  (func (export "f32.convert_i32_u") (param $x i32) (result f32) (f32.convert_i32_u (local.get $x)))
+  (func (export "f32.convert_i64_u") (param $x i64) (result f32) (f32.convert_i64_u (local.get $x)))
+  (func (export "f64.convert_i32_u") (param $x i32) (result f64) (f64.convert_i32_u (local.get $x)))
+  (func (export "f64.convert_i64_u") (param $x i64) (result f64) (f64.convert_i64_u (local.get $x)))
+  (func (export "f64.promote_f32") (param $x f32) (result f64) (f64.promote_f32 (local.get $x)))
+  (func (export "f32.demote_f64") (param $x f64) (result f32) (f32.demote_f64 (local.get $x)))
+  (func (export "f32.reinterpret_i32") (param $x i32) (result f32) (f32.reinterpret_i32 (local.get $x)))
+  (func (export "f64.reinterpret_i64") (param $x i64) (result f64) (f64.reinterpret_i64 (local.get $x)))
+  (func (export "i32.reinterpret_f32") (param $x f32) (result i32) (i32.reinterpret_f32 (local.get $x)))
+  (func (export "i64.reinterpret_f64") (param $x f64) (result i64) (i64.reinterpret_f64 (local.get $x)))
 )
 
 (assert_return (invoke "i64.extend_i32_s" (i32.const 0)) (i64.const 0))
@@ -31,8 +53,445 @@
 (assert_return (invoke "i32.wrap_i64" (i64.const 0x0000000100000000)) (i32.const 0x00000000))
 (assert_return (invoke "i32.wrap_i64" (i64.const 0x0000000100000001)) (i32.const 0x00000001))
 
+(assert_return (invoke "i32.trunc_f32_s" (f32.const 0.0)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f32_s" (f32.const -0.0)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f32_s" (f32.const 0x1p-149)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f32_s" (f32.const -0x1p-149)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f32_s" (f32.const 1.0)) (i32.const 1))
+(assert_return (invoke "i32.trunc_f32_s" (f32.const 0x1.19999ap+0)) (i32.const 1))
+(assert_return (invoke "i32.trunc_f32_s" (f32.const 1.5)) (i32.const 1))
+(assert_return (invoke "i32.trunc_f32_s" (f32.const -1.0)) (i32.const -1))
+(assert_return (invoke "i32.trunc_f32_s" (f32.const -0x1.19999ap+0)) (i32.const -1))
+(assert_return (invoke "i32.trunc_f32_s" (f32.const -1.5)) (i32.const -1))
+(assert_return (invoke "i32.trunc_f32_s" (f32.const -1.9)) (i32.const -1))
+(assert_return (invoke "i32.trunc_f32_s" (f32.const -2.0)) (i32.const -2))
+(assert_return (invoke "i32.trunc_f32_s" (f32.const 2147483520.0)) (i32.const 2147483520))
+(assert_return (invoke "i32.trunc_f32_s" (f32.const -2147483648.0)) (i32.const -2147483648))
+(assert_trap (invoke "i32.trunc_f32_s" (f32.const 2147483648.0)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f32_s" (f32.const -2147483904.0)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f32_s" (f32.const inf)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f32_s" (f32.const -inf)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f32_s" (f32.const nan)) "invalid conversion to integer")
+(assert_trap (invoke "i32.trunc_f32_s" (f32.const nan:0x200000)) "invalid conversion to integer")
+(assert_trap (invoke "i32.trunc_f32_s" (f32.const -nan)) "invalid conversion to integer")
+(assert_trap (invoke "i32.trunc_f32_s" (f32.const -nan:0x200000)) "invalid conversion to integer")
+
+(assert_return (invoke "i32.trunc_f32_u" (f32.const 0.0)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f32_u" (f32.const -0.0)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f32_u" (f32.const 0x1p-149)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f32_u" (f32.const -0x1p-149)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f32_u" (f32.const 1.0)) (i32.const 1))
+(assert_return (invoke "i32.trunc_f32_u" (f32.const 0x1.19999ap+0)) (i32.const 1))
+(assert_return (invoke "i32.trunc_f32_u" (f32.const 1.5)) (i32.const 1))
+(assert_return (invoke "i32.trunc_f32_u" (f32.const 1.9)) (i32.const 1))
+(assert_return (invoke "i32.trunc_f32_u" (f32.const 2.0)) (i32.const 2))
+(assert_return (invoke "i32.trunc_f32_u" (f32.const 2147483648)) (i32.const -2147483648)) ;; 0x1.00000p+31 -> 8000 0000
+(assert_return (invoke "i32.trunc_f32_u" (f32.const 4294967040.0)) (i32.const -256))
+(assert_return (invoke "i32.trunc_f32_u" (f32.const -0x1.ccccccp-1)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f32_u" (f32.const -0x1.fffffep-1)) (i32.const 0))
+(assert_trap (invoke "i32.trunc_f32_u" (f32.const 4294967296.0)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f32_u" (f32.const -1.0)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f32_u" (f32.const inf)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f32_u" (f32.const -inf)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f32_u" (f32.const nan)) "invalid conversion to integer")
+(assert_trap (invoke "i32.trunc_f32_u" (f32.const nan:0x200000)) "invalid conversion to integer")
+(assert_trap (invoke "i32.trunc_f32_u" (f32.const -nan)) "invalid conversion to integer")
+(assert_trap (invoke "i32.trunc_f32_u" (f32.const -nan:0x200000)) "invalid conversion to integer")
+
+(assert_return (invoke "i32.trunc_f64_s" (f64.const 0.0)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f64_s" (f64.const -0.0)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f64_s" (f64.const 0x0.0000000000001p-1022)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f64_s" (f64.const -0x0.0000000000001p-1022)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f64_s" (f64.const 1.0)) (i32.const 1))
+(assert_return (invoke "i32.trunc_f64_s" (f64.const 0x1.199999999999ap+0)) (i32.const 1))
+(assert_return (invoke "i32.trunc_f64_s" (f64.const 1.5)) (i32.const 1))
+(assert_return (invoke "i32.trunc_f64_s" (f64.const -1.0)) (i32.const -1))
+(assert_return (invoke "i32.trunc_f64_s" (f64.const -0x1.199999999999ap+0)) (i32.const -1))
+(assert_return (invoke "i32.trunc_f64_s" (f64.const -1.5)) (i32.const -1))
+(assert_return (invoke "i32.trunc_f64_s" (f64.const -1.9)) (i32.const -1))
+(assert_return (invoke "i32.trunc_f64_s" (f64.const -2.0)) (i32.const -2))
+(assert_return (invoke "i32.trunc_f64_s" (f64.const 2147483647.0)) (i32.const 2147483647))
+(assert_return (invoke "i32.trunc_f64_s" (f64.const -2147483648.0)) (i32.const -2147483648))
+(assert_return (invoke "i32.trunc_f64_s" (f64.const -2147483648.9)) (i32.const -2147483648))
+(assert_return (invoke "i32.trunc_f64_s" (f64.const  2147483647.9)) (i32.const  2147483647))
+(assert_trap (invoke "i32.trunc_f64_s" (f64.const 2147483648.0)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f64_s" (f64.const -2147483649.0)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f64_s" (f64.const inf)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f64_s" (f64.const -inf)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f64_s" (f64.const nan)) "invalid conversion to integer")
+(assert_trap (invoke "i32.trunc_f64_s" (f64.const nan:0x4000000000000)) "invalid conversion to integer")
+(assert_trap (invoke "i32.trunc_f64_s" (f64.const -nan)) "invalid conversion to integer")
+(assert_trap (invoke "i32.trunc_f64_s" (f64.const -nan:0x4000000000000)) "invalid conversion to integer")
+
+(assert_return (invoke "i32.trunc_f64_u" (f64.const 0.0)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f64_u" (f64.const -0.0)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f64_u" (f64.const 0x0.0000000000001p-1022)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f64_u" (f64.const -0x0.0000000000001p-1022)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f64_u" (f64.const 1.0)) (i32.const 1))
+(assert_return (invoke "i32.trunc_f64_u" (f64.const 0x1.199999999999ap+0)) (i32.const 1))
+(assert_return (invoke "i32.trunc_f64_u" (f64.const 1.5)) (i32.const 1))
+(assert_return (invoke "i32.trunc_f64_u" (f64.const 1.9)) (i32.const 1))
+(assert_return (invoke "i32.trunc_f64_u" (f64.const 2.0)) (i32.const 2))
+(assert_return (invoke "i32.trunc_f64_u" (f64.const 2147483648)) (i32.const -2147483648)) ;; 0x1.00000p+31 -> 8000 0000
+(assert_return (invoke "i32.trunc_f64_u" (f64.const 4294967295.0)) (i32.const -1))
+(assert_return (invoke "i32.trunc_f64_u" (f64.const -0x1.ccccccccccccdp-1)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f64_u" (f64.const -0x1.fffffffffffffp-1)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f64_u" (f64.const 1e8)) (i32.const 100000000))
+(assert_return (invoke "i32.trunc_f64_u" (f64.const -0.9)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f64_u" (f64.const 4294967295.9)) (i32.const 4294967295))
+(assert_trap (invoke "i32.trunc_f64_u" (f64.const 4294967296.0)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f64_u" (f64.const -1.0)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f64_u" (f64.const 1e16)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f64_u" (f64.const 1e30)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f64_u" (f64.const 9223372036854775808)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f64_u" (f64.const inf)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f64_u" (f64.const -inf)) "integer overflow")
+(assert_trap (invoke "i32.trunc_f64_u" (f64.const nan)) "invalid conversion to integer")
+(assert_trap (invoke "i32.trunc_f64_u" (f64.const nan:0x4000000000000)) "invalid conversion to integer")
+(assert_trap (invoke "i32.trunc_f64_u" (f64.const -nan)) "invalid conversion to integer")
+(assert_trap (invoke "i32.trunc_f64_u" (f64.const -nan:0x4000000000000)) "invalid conversion to integer")
+
+(assert_return (invoke "i64.trunc_f32_s" (f32.const 0.0)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f32_s" (f32.const -0.0)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f32_s" (f32.const 0x1p-149)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f32_s" (f32.const -0x1p-149)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f32_s" (f32.const 1.0)) (i64.const 1))
+(assert_return (invoke "i64.trunc_f32_s" (f32.const 0x1.19999ap+0)) (i64.const 1))
+(assert_return (invoke "i64.trunc_f32_s" (f32.const 1.5)) (i64.const 1))
+(assert_return (invoke "i64.trunc_f32_s" (f32.const -1.0)) (i64.const -1))
+(assert_return (invoke "i64.trunc_f32_s" (f32.const -0x1.19999ap+0)) (i64.const -1))
+(assert_return (invoke "i64.trunc_f32_s" (f32.const -1.5)) (i64.const -1))
+(assert_return (invoke "i64.trunc_f32_s" (f32.const -1.9)) (i64.const -1))
+(assert_return (invoke "i64.trunc_f32_s" (f32.const -2.0)) (i64.const -2))
+(assert_return (invoke "i64.trunc_f32_s" (f32.const 4294967296)) (i64.const 4294967296)) ;; 0x1.00000p+32 -> 1 0000 0000
+(assert_return (invoke "i64.trunc_f32_s" (f32.const -4294967296)) (i64.const -4294967296)) ;; -0x1.00000p+32 -> ffff ffff 0000 0000
+(assert_return (invoke "i64.trunc_f32_s" (f32.const 9223371487098961920.0)) (i64.const 9223371487098961920))
+(assert_return (invoke "i64.trunc_f32_s" (f32.const -9223372036854775808.0)) (i64.const -9223372036854775808))
+(assert_trap (invoke "i64.trunc_f32_s" (f32.const 9223372036854775808.0)) "integer overflow")
+(assert_trap (invoke "i64.trunc_f32_s" (f32.const -9223373136366403584.0)) "integer overflow")
+(assert_trap (invoke "i64.trunc_f32_s" (f32.const inf)) "integer overflow")
+(assert_trap (invoke "i64.trunc_f32_s" (f32.const -inf)) "integer overflow")
+(assert_trap (invoke "i64.trunc_f32_s" (f32.const nan)) "invalid conversion to integer")
+(assert_trap (invoke "i64.trunc_f32_s" (f32.const nan:0x200000)) "invalid conversion to integer")
+(assert_trap (invoke "i64.trunc_f32_s" (f32.const -nan)) "invalid conversion to integer")
+(assert_trap (invoke "i64.trunc_f32_s" (f32.const -nan:0x200000)) "invalid conversion to integer")
+
+(assert_return (invoke "i64.trunc_f32_u" (f32.const 0.0)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f32_u" (f32.const -0.0)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f32_u" (f32.const 0x1p-149)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f32_u" (f32.const -0x1p-149)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f32_u" (f32.const 1.0)) (i64.const 1))
+(assert_return (invoke "i64.trunc_f32_u" (f32.const 0x1.19999ap+0)) (i64.const 1))
+(assert_return (invoke "i64.trunc_f32_u" (f32.const 1.5)) (i64.const 1))
+(assert_return (invoke "i64.trunc_f32_u" (f32.const 4294967296)) (i64.const 4294967296))
+(assert_return (invoke "i64.trunc_f32_u" (f32.const 18446742974197923840.0)) (i64.const -1099511627776))
+(assert_return (invoke "i64.trunc_f32_u" (f32.const -0x1.ccccccp-1)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f32_u" (f32.const -0x1.fffffep-1)) (i64.const 0))
+(assert_trap (invoke "i64.trunc_f32_u" (f32.const 18446744073709551616.0)) "integer overflow")
+(assert_trap (invoke "i64.trunc_f32_u" (f32.const -1.0)) "integer overflow")
+(assert_trap (invoke "i64.trunc_f32_u" (f32.const inf)) "integer overflow")
+(assert_trap (invoke "i64.trunc_f32_u" (f32.const -inf)) "integer overflow")
+(assert_trap (invoke "i64.trunc_f32_u" (f32.const nan)) "invalid conversion to integer")
+(assert_trap (invoke "i64.trunc_f32_u" (f32.const nan:0x200000)) "invalid conversion to integer")
+(assert_trap (invoke "i64.trunc_f32_u" (f32.const -nan)) "invalid conversion to integer")
+(assert_trap (invoke "i64.trunc_f32_u" (f32.const -nan:0x200000)) "invalid conversion to integer")
+
+(assert_return (invoke "i64.trunc_f64_s" (f64.const 0.0)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f64_s" (f64.const -0.0)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f64_s" (f64.const 0x0.0000000000001p-1022)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f64_s" (f64.const -0x0.0000000000001p-1022)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f64_s" (f64.const 1.0)) (i64.const 1))
+(assert_return (invoke "i64.trunc_f64_s" (f64.const 0x1.199999999999ap+0)) (i64.const 1))
+(assert_return (invoke "i64.trunc_f64_s" (f64.const 1.5)) (i64.const 1))
+(assert_return (invoke "i64.trunc_f64_s" (f64.const -1.0)) (i64.const -1))
+(assert_return (invoke "i64.trunc_f64_s" (f64.const -0x1.199999999999ap+0)) (i64.const -1))
+(assert_return (invoke "i64.trunc_f64_s" (f64.const -1.5)) (i64.const -1))
+(assert_return (invoke "i64.trunc_f64_s" (f64.const -1.9)) (i64.const -1))
+(assert_return (invoke "i64.trunc_f64_s" (f64.const -2.0)) (i64.const -2))
+(assert_return (invoke "i64.trunc_f64_s" (f64.const 4294967296)) (i64.const 4294967296)) ;; 0x1.00000p+32 -> 1 0000 0000
+(assert_return (invoke "i64.trunc_f64_s" (f64.const -4294967296)) (i64.const -4294967296)) ;; -0x1.00000p+32 -> ffff ffff 0000 0000
+(assert_return (invoke "i64.trunc_f64_s" (f64.const 9223372036854774784.0)) (i64.const 9223372036854774784))
+(assert_return (invoke "i64.trunc_f64_s" (f64.const -9223372036854775808.0)) (i64.const -9223372036854775808))
+(assert_trap (invoke "i64.trunc_f64_s" (f64.const 9223372036854775808.0)) "integer overflow")
+(assert_trap (invoke "i64.trunc_f64_s" (f64.const -9223372036854777856.0)) "integer overflow")
+(assert_trap (invoke "i64.trunc_f64_s" (f64.const inf)) "integer overflow")
+(assert_trap (invoke "i64.trunc_f64_s" (f64.const -inf)) "integer overflow")
+(assert_trap (invoke "i64.trunc_f64_s" (f64.const nan)) "invalid conversion to integer")
+(assert_trap (invoke "i64.trunc_f64_s" (f64.const nan:0x4000000000000)) "invalid conversion to integer")
+(assert_trap (invoke "i64.trunc_f64_s" (f64.const -nan)) "invalid conversion to integer")
+(assert_trap (invoke "i64.trunc_f64_s" (f64.const -nan:0x4000000000000)) "invalid conversion to integer")
+
+(assert_return (invoke "i64.trunc_f64_u" (f64.const 0.0)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f64_u" (f64.const -0.0)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f64_u" (f64.const 0x0.0000000000001p-1022)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f64_u" (f64.const -0x0.0000000000001p-1022)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f64_u" (f64.const 1.0)) (i64.const 1))
+(assert_return (invoke "i64.trunc_f64_u" (f64.const 0x1.199999999999ap+0)) (i64.const 1))
+(assert_return (invoke "i64.trunc_f64_u" (f64.const 1.5)) (i64.const 1))
+(assert_return (invoke "i64.trunc_f64_u" (f64.const 4294967295)) (i64.const 0xffffffff))
+(assert_return (invoke "i64.trunc_f64_u" (f64.const 4294967296)) (i64.const 0x100000000))
+(assert_return (invoke "i64.trunc_f64_u" (f64.const 18446744073709549568.0)) (i64.const -2048))
+(assert_return (invoke "i64.trunc_f64_u" (f64.const -0x1.ccccccccccccdp-1)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f64_u" (f64.const -0x1.fffffffffffffp-1)) (i64.const 0))
+(assert_return (invoke "i64.trunc_f64_u" (f64.const 1e8)) (i64.const 100000000))
+(assert_return (invoke "i64.trunc_f64_u" (f64.const 1e16)) (i64.const 10000000000000000))
+(assert_return (invoke "i64.trunc_f64_u" (f64.const 9223372036854775808)) (i64.const -9223372036854775808))
+(assert_trap (invoke "i64.trunc_f64_u" (f64.const 18446744073709551616.0)) "integer overflow")
+(assert_trap (invoke "i64.trunc_f64_u" (f64.const -1.0)) "integer overflow")
+(assert_trap (invoke "i64.trunc_f64_u" (f64.const inf)) "integer overflow")
+(assert_trap (invoke "i64.trunc_f64_u" (f64.const -inf)) "integer overflow")
+(assert_trap (invoke "i64.trunc_f64_u" (f64.const nan)) "invalid conversion to integer")
+(assert_trap (invoke "i64.trunc_f64_u" (f64.const nan:0x4000000000000)) "invalid conversion to integer")
+(assert_trap (invoke "i64.trunc_f64_u" (f64.const -nan)) "invalid conversion to integer")
+(assert_trap (invoke "i64.trunc_f64_u" (f64.const -nan:0x4000000000000)) "invalid conversion to integer")
+
+(assert_return (invoke "f32.convert_i32_s" (i32.const 1)) (f32.const 1.0))
+(assert_return (invoke "f32.convert_i32_s" (i32.const -1)) (f32.const -1.0))
+(assert_return (invoke "f32.convert_i32_s" (i32.const 0)) (f32.const 0.0))
+(assert_return (invoke "f32.convert_i32_s" (i32.const 2147483647)) (f32.const 2147483648))
+(assert_return (invoke "f32.convert_i32_s" (i32.const -2147483648)) (f32.const -2147483648))
+(assert_return (invoke "f32.convert_i32_s" (i32.const 1234567890)) (f32.const 0x1.26580cp+30))
+
+(assert_return (invoke "f32.convert_i64_s" (i64.const 1)) (f32.const 1.0))
+(assert_return (invoke "f32.convert_i64_s" (i64.const -1)) (f32.const -1.0))
+(assert_return (invoke "f32.convert_i64_s" (i64.const 0)) (f32.const 0.0))
+(assert_return (invoke "f32.convert_i64_s" (i64.const 9223372036854775807)) (f32.const 9223372036854775807))
+(assert_return (invoke "f32.convert_i64_s" (i64.const -9223372036854775808)) (f32.const -9223372036854775808))
+(assert_return (invoke "f32.convert_i64_s" (i64.const 314159265358979)) (f32.const 0x1.1db9e8p+48)) ;; PI
+;; Test rounding directions.
+(assert_return (invoke "f32.convert_i64_s" (i64.const 16777217)) (f32.const 16777216.0))
+(assert_return (invoke "f32.convert_i64_s" (i64.const -16777217)) (f32.const -16777216.0))
+(assert_return (invoke "f32.convert_i64_s" (i64.const 16777219)) (f32.const 16777220.0))
+(assert_return (invoke "f32.convert_i64_s" (i64.const -16777219)) (f32.const -16777220.0))
+
+(assert_return (invoke "f32.convert_i64_s" (i64.const 0x7fffff4000000001)) (f32.const 0x1.fffffep+62))
+(assert_return (invoke "f32.convert_i64_s" (i64.const 0x8000004000000001)) (f32.const -0x1.fffffep+62))
+(assert_return (invoke "f32.convert_i64_s" (i64.const 0x0020000020000001)) (f32.const 0x1.000002p+53))
+(assert_return (invoke "f32.convert_i64_s" (i64.const 0xffdfffffdfffffff)) (f32.const -0x1.000002p+53))
+
+(assert_return (invoke "f64.convert_i32_s" (i32.const 1)) (f64.const 1.0))
+(assert_return (invoke "f64.convert_i32_s" (i32.const -1)) (f64.const -1.0))
+(assert_return (invoke "f64.convert_i32_s" (i32.const 0)) (f64.const 0.0))
+(assert_return (invoke "f64.convert_i32_s" (i32.const 2147483647)) (f64.const 2147483647))
+(assert_return (invoke "f64.convert_i32_s" (i32.const -2147483648)) (f64.const -2147483648))
+(assert_return (invoke "f64.convert_i32_s" (i32.const 987654321)) (f64.const 987654321))
+
+(assert_return (invoke "f64.convert_i64_s" (i64.const 1)) (f64.const 1.0))
+(assert_return (invoke "f64.convert_i64_s" (i64.const -1)) (f64.const -1.0))
+(assert_return (invoke "f64.convert_i64_s" (i64.const 0)) (f64.const 0.0))
+(assert_return (invoke "f64.convert_i64_s" (i64.const 9223372036854775807)) (f64.const 9223372036854775807))
+(assert_return (invoke "f64.convert_i64_s" (i64.const -9223372036854775808)) (f64.const -9223372036854775808))
+(assert_return (invoke "f64.convert_i64_s" (i64.const 4669201609102990)) (f64.const 4669201609102990)) ;; Feigenbaum
+;; Test rounding directions.
+(assert_return (invoke "f64.convert_i64_s" (i64.const 9007199254740993)) (f64.const 9007199254740992))
+(assert_return (invoke "f64.convert_i64_s" (i64.const -9007199254740993)) (f64.const -9007199254740992))
+(assert_return (invoke "f64.convert_i64_s" (i64.const 9007199254740995)) (f64.const 9007199254740996))
+(assert_return (invoke "f64.convert_i64_s" (i64.const -9007199254740995)) (f64.const -9007199254740996))
+
+(assert_return (invoke "f32.convert_i32_u" (i32.const 1)) (f32.const 1.0))
+(assert_return (invoke "f32.convert_i32_u" (i32.const 0)) (f32.const 0.0))
+(assert_return (invoke "f32.convert_i32_u" (i32.const 2147483647)) (f32.const 2147483648))
+(assert_return (invoke "f32.convert_i32_u" (i32.const -2147483648)) (f32.const 2147483648))
+(assert_return (invoke "f32.convert_i32_u" (i32.const 0x12345678)) (f32.const 0x1.234568p+28))
+(assert_return (invoke "f32.convert_i32_u" (i32.const 0xffffffff)) (f32.const 4294967296.0))
+(assert_return (invoke "f32.convert_i32_u" (i32.const 0x80000080)) (f32.const 0x1.000000p+31))
+(assert_return (invoke "f32.convert_i32_u" (i32.const 0x80000081)) (f32.const 0x1.000002p+31))
+(assert_return (invoke "f32.convert_i32_u" (i32.const 0x80000082)) (f32.const 0x1.000002p+31))
+(assert_return (invoke "f32.convert_i32_u" (i32.const 0xfffffe80)) (f32.const 0x1.fffffcp+31))
+(assert_return (invoke "f32.convert_i32_u" (i32.const 0xfffffe81)) (f32.const 0x1.fffffep+31))
+(assert_return (invoke "f32.convert_i32_u" (i32.const 0xfffffe82)) (f32.const 0x1.fffffep+31))
+;; Test rounding directions.
+(assert_return (invoke "f32.convert_i32_u" (i32.const 16777217)) (f32.const 16777216.0))
+(assert_return (invoke "f32.convert_i32_u" (i32.const 16777219)) (f32.const 16777220.0))
+
+(assert_return (invoke "f32.convert_i64_u" (i64.const 1)) (f32.const 1.0))
+(assert_return (invoke "f32.convert_i64_u" (i64.const 0)) (f32.const 0.0))
+(assert_return (invoke "f32.convert_i64_u" (i64.const 9223372036854775807)) (f32.const 9223372036854775807))
+(assert_return (invoke "f32.convert_i64_u" (i64.const -9223372036854775808)) (f32.const 9223372036854775808))
+(assert_return (invoke "f32.convert_i64_u" (i64.const 0xffffffffffffffff)) (f32.const 18446744073709551616.0))
+;; Test rounding directions.
+(assert_return (invoke "f32.convert_i64_u" (i64.const 16777217)) (f32.const 16777216.0))
+(assert_return (invoke "f32.convert_i64_u" (i64.const 16777219)) (f32.const 16777220.0))
+
+(assert_return (invoke "f32.convert_i64_u" (i64.const 0x0020000020000001)) (f32.const 0x1.000002p+53))
+(assert_return (invoke "f32.convert_i64_u" (i64.const 0x7fffffbfffffffff)) (f32.const 0x1.fffffep+62))
+(assert_return (invoke "f32.convert_i64_u" (i64.const 0x8000008000000001)) (f32.const 0x1.000002p+63))
+(assert_return (invoke "f32.convert_i64_u" (i64.const 0xfffffe8000000001)) (f32.const 0x1.fffffep+63))
+
+(assert_return (invoke "f64.convert_i32_u" (i32.const 1)) (f64.const 1.0))
+(assert_return (invoke "f64.convert_i32_u" (i32.const 0)) (f64.const 0.0))
+(assert_return (invoke "f64.convert_i32_u" (i32.const 2147483647)) (f64.const 2147483647))
+(assert_return (invoke "f64.convert_i32_u" (i32.const -2147483648)) (f64.const 2147483648))
+(assert_return (invoke "f64.convert_i32_u" (i32.const 0xffffffff)) (f64.const 4294967295.0))
+
+(assert_return (invoke "f64.convert_i64_u" (i64.const 1)) (f64.const 1.0))
+(assert_return (invoke "f64.convert_i64_u" (i64.const 0)) (f64.const 0.0))
+(assert_return (invoke "f64.convert_i64_u" (i64.const 9223372036854775807)) (f64.const 9223372036854775807))
+(assert_return (invoke "f64.convert_i64_u" (i64.const -9223372036854775808)) (f64.const 9223372036854775808))
+(assert_return (invoke "f64.convert_i64_u" (i64.const 0xffffffffffffffff)) (f64.const 18446744073709551616.0))
+(assert_return (invoke "f64.convert_i64_u" (i64.const 0x8000000000000400)) (f64.const 0x1.0000000000000p+63))
+(assert_return (invoke "f64.convert_i64_u" (i64.const 0x8000000000000401)) (f64.const 0x1.0000000000001p+63))
+(assert_return (invoke "f64.convert_i64_u" (i64.const 0x8000000000000402)) (f64.const 0x1.0000000000001p+63))
+(assert_return (invoke "f64.convert_i64_u" (i64.const 0xfffffffffffff400)) (f64.const 0x1.ffffffffffffep+63))
+(assert_return (invoke "f64.convert_i64_u" (i64.const 0xfffffffffffff401)) (f64.const 0x1.fffffffffffffp+63))
+(assert_return (invoke "f64.convert_i64_u" (i64.const 0xfffffffffffff402)) (f64.const 0x1.fffffffffffffp+63))
+;; Test rounding directions.
+(assert_return (invoke "f64.convert_i64_u" (i64.const 9007199254740993)) (f64.const 9007199254740992))
+(assert_return (invoke "f64.convert_i64_u" (i64.const 9007199254740995)) (f64.const 9007199254740996))
+
+(assert_return (invoke "f64.promote_f32" (f32.const 0.0)) (f64.const 0.0))
+(assert_return (invoke "f64.promote_f32" (f32.const -0.0)) (f64.const -0.0))
+(assert_return (invoke "f64.promote_f32" (f32.const 0x1p-149)) (f64.const 0x1p-149))
+(assert_return (invoke "f64.promote_f32" (f32.const -0x1p-149)) (f64.const -0x1p-149))
+(assert_return (invoke "f64.promote_f32" (f32.const 1.0)) (f64.const 1.0))
+(assert_return (invoke "f64.promote_f32" (f32.const -1.0)) (f64.const -1.0))
+(assert_return (invoke "f64.promote_f32" (f32.const -0x1.fffffep+127)) (f64.const -0x1.fffffep+127))
+(assert_return (invoke "f64.promote_f32" (f32.const 0x1.fffffep+127)) (f64.const 0x1.fffffep+127))
+;; Generated randomly by picking a random int and reinterpret it to float.
+(assert_return (invoke "f64.promote_f32" (f32.const 0x1p-119)) (f64.const 0x1p-119))
+;; Generated randomly by picking a random float.
+(assert_return (invoke "f64.promote_f32" (f32.const 0x1.8f867ep+125)) (f64.const 6.6382536710104395e+37))
+(assert_return (invoke "f64.promote_f32" (f32.const inf)) (f64.const inf))
+(assert_return (invoke "f64.promote_f32" (f32.const -inf)) (f64.const -inf))
+(assert_return (invoke "f64.promote_f32" (f32.const nan)) (f64.const nan:canonical))
+(assert_return (invoke "f64.promote_f32" (f32.const nan:0x200000)) (f64.const nan:arithmetic))
+(assert_return (invoke "f64.promote_f32" (f32.const -nan)) (f64.const nan:canonical))
+(assert_return (invoke "f64.promote_f32" (f32.const -nan:0x200000)) (f64.const nan:arithmetic))
+
+(assert_return (invoke "f32.demote_f64" (f64.const 0.0)) (f32.const 0.0))
+(assert_return (invoke "f32.demote_f64" (f64.const -0.0)) (f32.const -0.0))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x0.0000000000001p-1022)) (f32.const 0.0))
+(assert_return (invoke "f32.demote_f64" (f64.const -0x0.0000000000001p-1022)) (f32.const -0.0))
+(assert_return (invoke "f32.demote_f64" (f64.const 1.0)) (f32.const 1.0))
+(assert_return (invoke "f32.demote_f64" (f64.const -1.0)) (f32.const -1.0))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.fffffe0000000p-127)) (f32.const 0x1p-126))
+(assert_return (invoke "f32.demote_f64" (f64.const -0x1.fffffe0000000p-127)) (f32.const -0x1p-126))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.fffffdfffffffp-127)) (f32.const 0x1.fffffcp-127))
+(assert_return (invoke "f32.demote_f64" (f64.const -0x1.fffffdfffffffp-127)) (f32.const -0x1.fffffcp-127))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1p-149)) (f32.const 0x1p-149))
+(assert_return (invoke "f32.demote_f64" (f64.const -0x1p-149)) (f32.const -0x1p-149))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.fffffd0000000p+127)) (f32.const 0x1.fffffcp+127))
+(assert_return (invoke "f32.demote_f64" (f64.const -0x1.fffffd0000000p+127)) (f32.const -0x1.fffffcp+127))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.fffffd0000001p+127)) (f32.const 0x1.fffffep+127))
+(assert_return (invoke "f32.demote_f64" (f64.const -0x1.fffffd0000001p+127)) (f32.const -0x1.fffffep+127))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127))
+(assert_return (invoke "f32.demote_f64" (f64.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.fffffefffffffp+127)) (f32.const 0x1.fffffep+127))
+(assert_return (invoke "f32.demote_f64" (f64.const -0x1.fffffefffffffp+127)) (f32.const -0x1.fffffep+127))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.ffffffp+127)) (f32.const inf))
+(assert_return (invoke "f32.demote_f64" (f64.const -0x1.ffffffp+127)) (f32.const -inf))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1p-119)) (f32.const 0x1p-119))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.8f867ep+125)) (f32.const 0x1.8f867ep+125))
+(assert_return (invoke "f32.demote_f64" (f64.const inf)) (f32.const inf))
+(assert_return (invoke "f32.demote_f64" (f64.const -inf)) (f32.const -inf))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000000000001p+0)) (f32.const 1.0))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.fffffffffffffp-1)) (f32.const 1.0))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000010000000p+0)) (f32.const 0x1.000000p+0))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000010000001p+0)) (f32.const 0x1.000002p+0))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.000002fffffffp+0)) (f32.const 0x1.000002p+0))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000030000000p+0)) (f32.const 0x1.000004p+0))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000050000000p+0)) (f32.const 0x1.000004p+0))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000010000000p+24)) (f32.const 0x1.0p+24))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000010000001p+24)) (f32.const 0x1.000002p+24))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.000002fffffffp+24)) (f32.const 0x1.000002p+24))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000030000000p+24)) (f32.const 0x1.000004p+24))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.4eae4f7024c7p+108)) (f32.const 0x1.4eae5p+108))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.a12e71e358685p-113)) (f32.const 0x1.a12e72p-113))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.cb98354d521ffp-127)) (f32.const 0x1.cb9834p-127))
+(assert_return (invoke "f32.demote_f64" (f64.const -0x1.6972b30cfb562p+1)) (f32.const -0x1.6972b4p+1))
+(assert_return (invoke "f32.demote_f64" (f64.const -0x1.bedbe4819d4c4p+112)) (f32.const -0x1.bedbe4p+112))
+(assert_return (invoke "f32.demote_f64" (f64.const nan)) (f32.const nan:canonical))
+(assert_return (invoke "f32.demote_f64" (f64.const nan:0x4000000000000)) (f32.const nan:arithmetic))
+(assert_return (invoke "f32.demote_f64" (f64.const -nan)) (f32.const nan:canonical))
+(assert_return (invoke "f32.demote_f64" (f64.const -nan:0x4000000000000)) (f32.const nan:arithmetic))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1p-1022)) (f32.const 0.0))
+(assert_return (invoke "f32.demote_f64" (f64.const -0x1p-1022)) (f32.const -0.0))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.0p-150)) (f32.const 0.0))
+(assert_return (invoke "f32.demote_f64" (f64.const -0x1.0p-150)) (f32.const -0.0))
+(assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000000000001p-150)) (f32.const 0x1p-149))
+(assert_return (invoke "f32.demote_f64" (f64.const -0x1.0000000000001p-150)) (f32.const -0x1p-149))
+
+(assert_return (invoke "f32.reinterpret_i32" (i32.const 0)) (f32.const 0.0))
+(assert_return (invoke "f32.reinterpret_i32" (i32.const 0x80000000)) (f32.const -0.0))
+(assert_return (invoke "f32.reinterpret_i32" (i32.const 1)) (f32.const 0x1p-149))
+(assert_return (invoke "f32.reinterpret_i32" (i32.const -1)) (f32.const -nan:0x7fffff))
+(assert_return (invoke "f32.reinterpret_i32" (i32.const 123456789)) (f32.const 0x1.b79a2ap-113))
+(assert_return (invoke "f32.reinterpret_i32" (i32.const -2147483647)) (f32.const -0x1p-149))
+(assert_return (invoke "f32.reinterpret_i32" (i32.const 0x7f800000)) (f32.const inf))
+(assert_return (invoke "f32.reinterpret_i32" (i32.const 0xff800000)) (f32.const -inf))
+(assert_return (invoke "f32.reinterpret_i32" (i32.const 0x7fc00000)) (f32.const nan))
+(assert_return (invoke "f32.reinterpret_i32" (i32.const 0xffc00000)) (f32.const -nan))
+(assert_return (invoke "f32.reinterpret_i32" (i32.const 0x7fa00000)) (f32.const nan:0x200000))
+(assert_return (invoke "f32.reinterpret_i32" (i32.const 0xffa00000)) (f32.const -nan:0x200000))
+
+(assert_return (invoke "f64.reinterpret_i64" (i64.const 0)) (f64.const 0.0))
+(assert_return (invoke "f64.reinterpret_i64" (i64.const 1)) (f64.const 0x0.0000000000001p-1022))
+(assert_return (invoke "f64.reinterpret_i64" (i64.const -1)) (f64.const -nan:0xfffffffffffff))
+(assert_return (invoke "f64.reinterpret_i64" (i64.const 0x8000000000000000)) (f64.const -0.0))
+(assert_return (invoke "f64.reinterpret_i64" (i64.const 1234567890)) (f64.const 0x0.00000499602d2p-1022))
+(assert_return (invoke "f64.reinterpret_i64" (i64.const -9223372036854775807)) (f64.const -0x0.0000000000001p-1022))
+(assert_return (invoke "f64.reinterpret_i64" (i64.const 0x7ff0000000000000)) (f64.const inf))
+(assert_return (invoke "f64.reinterpret_i64" (i64.const 0xfff0000000000000)) (f64.const -inf))
+(assert_return (invoke "f64.reinterpret_i64" (i64.const 0x7ff8000000000000)) (f64.const nan))
+(assert_return (invoke "f64.reinterpret_i64" (i64.const 0xfff8000000000000)) (f64.const -nan))
+(assert_return (invoke "f64.reinterpret_i64" (i64.const 0x7ff4000000000000)) (f64.const nan:0x4000000000000))
+(assert_return (invoke "f64.reinterpret_i64" (i64.const 0xfff4000000000000)) (f64.const -nan:0x4000000000000))
+
+(assert_return (invoke "i32.reinterpret_f32" (f32.const 0.0)) (i32.const 0))
+(assert_return (invoke "i32.reinterpret_f32" (f32.const -0.0)) (i32.const 0x80000000))
+(assert_return (invoke "i32.reinterpret_f32" (f32.const 0x1p-149)) (i32.const 1))
+(assert_return (invoke "i32.reinterpret_f32" (f32.const -nan:0x7fffff)) (i32.const -1))
+(assert_return (invoke "i32.reinterpret_f32" (f32.const -0x1p-149)) (i32.const 0x80000001))
+(assert_return (invoke "i32.reinterpret_f32" (f32.const 1.0)) (i32.const 1065353216))
+(assert_return (invoke "i32.reinterpret_f32" (f32.const 3.1415926)) (i32.const 1078530010))
+(assert_return (invoke "i32.reinterpret_f32" (f32.const 0x1.fffffep+127)) (i32.const 2139095039))
+(assert_return (invoke "i32.reinterpret_f32" (f32.const -0x1.fffffep+127)) (i32.const -8388609))
+(assert_return (invoke "i32.reinterpret_f32" (f32.const inf)) (i32.const 0x7f800000))
+(assert_return (invoke "i32.reinterpret_f32" (f32.const -inf)) (i32.const 0xff800000))
+(assert_return (invoke "i32.reinterpret_f32" (f32.const nan)) (i32.const 0x7fc00000))
+(assert_return (invoke "i32.reinterpret_f32" (f32.const -nan)) (i32.const 0xffc00000))
+(assert_return (invoke "i32.reinterpret_f32" (f32.const nan:0x200000)) (i32.const 0x7fa00000))
+(assert_return (invoke "i32.reinterpret_f32" (f32.const -nan:0x200000)) (i32.const 0xffa00000))
+
+(assert_return (invoke "i64.reinterpret_f64" (f64.const 0.0)) (i64.const 0))
+(assert_return (invoke "i64.reinterpret_f64" (f64.const -0.0)) (i64.const 0x8000000000000000))
+(assert_return (invoke "i64.reinterpret_f64" (f64.const 0x0.0000000000001p-1022)) (i64.const 1))
+(assert_return (invoke "i64.reinterpret_f64" (f64.const -nan:0xfffffffffffff)) (i64.const -1))
+(assert_return (invoke "i64.reinterpret_f64" (f64.const -0x0.0000000000001p-1022)) (i64.const 0x8000000000000001))
+(assert_return (invoke "i64.reinterpret_f64" (f64.const 1.0)) (i64.const 4607182418800017408))
+(assert_return (invoke "i64.reinterpret_f64" (f64.const 3.14159265358979)) (i64.const 4614256656552045841))
+(assert_return (invoke "i64.reinterpret_f64" (f64.const 0x1.fffffffffffffp+1023)) (i64.const 9218868437227405311))
+(assert_return (invoke "i64.reinterpret_f64" (f64.const -0x1.fffffffffffffp+1023)) (i64.const -4503599627370497))
+(assert_return (invoke "i64.reinterpret_f64" (f64.const inf)) (i64.const 0x7ff0000000000000))
+(assert_return (invoke "i64.reinterpret_f64" (f64.const -inf)) (i64.const 0xfff0000000000000))
+(assert_return (invoke "i64.reinterpret_f64" (f64.const nan)) (i64.const 0x7ff8000000000000))
+(assert_return (invoke "i64.reinterpret_f64" (f64.const -nan)) (i64.const 0xfff8000000000000))
+(assert_return (invoke "i64.reinterpret_f64" (f64.const nan:0x4000000000000)) (i64.const 0x7ff4000000000000))
+(assert_return (invoke "i64.reinterpret_f64" (f64.const -nan:0x4000000000000)) (i64.const 0xfff4000000000000))
+
 ;; Type check
 
 (assert_invalid (module (func (result i32) (i32.wrap_i64 (f32.const 0)))) "type mismatch")
+(assert_invalid (module (func (result i32) (i32.trunc_f32_s (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (result i32) (i32.trunc_f32_u (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (result i32) (i32.trunc_f64_s (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (result i32) (i32.reinterpret_f32 (i64.const 0)))) "type mismatch")
 (assert_invalid (module (func (result i64) (i64.extend_i32_s (f32.const 0)))) "type mismatch")
 (assert_invalid (module (func (result i64) (i64.extend_i32_u (f32.const 0)))) "type mismatch")
+(assert_invalid (module (func (result i64) (i64.trunc_f32_s (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (result i64) (i64.trunc_f32_u (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (result i64) (i64.trunc_f64_s (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (result i64) (i64.trunc_f64_u (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (result i64) (i64.reinterpret_f64 (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (result f32) (f32.convert_i32_s (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (result f32) (f32.convert_i32_u (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (result f32) (f32.convert_i64_s (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (result f32) (f32.convert_i64_u (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (result f32) (f32.demote_f64 (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (result f32) (f32.reinterpret_i32 (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (result f64) (f64.convert_i32_s (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (result f64) (f64.convert_i32_u (i64.const 0)))) "type mismatch")
+(assert_invalid (module (func (result f64) (f64.convert_i64_s (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (result f64) (f64.convert_i64_u (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (result f64) (f64.promote_f32 (i32.const 0)))) "type mismatch")
+(assert_invalid (module (func (result f64) (f64.reinterpret_i64 (i32.const 0)))) "type mismatch")
diff --git a/winch/filetests/filetests/x64/f32_convert_i32_s/const.wat b/winch/filetests/filetests/x64/f32_convert_i32_s/const.wat
new file mode 100644
index 000000000..479c7f36f
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_convert_i32_s/const.wat
@@ -0,0 +1,17 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        (i32.const 1)
+        (f32.convert_i32_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 b801000000           	mov	eax, 1
+;;   11:	 f30f2ac0             	cvtsi2ss	xmm0, eax
+;;   15:	 4883c408             	add	rsp, 8
+;;   19:	 5d                   	pop	rbp
+;;   1a:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_convert_i32_s/locals.wat b/winch/filetests/filetests/x64/f32_convert_i32_s/locals.wat
new file mode 100644
index 000000000..e3d8558dd
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_convert_i32_s/locals.wat
@@ -0,0 +1,21 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        (local i32)  
+
+        (local.get 0)
+        (f32.convert_i32_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 8b44240c             	mov	eax, dword ptr [rsp + 0xc]
+;;   19:	 f30f2ac0             	cvtsi2ss	xmm0, eax
+;;   1d:	 4883c410             	add	rsp, 0x10
+;;   21:	 5d                   	pop	rbp
+;;   22:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_convert_i32_s/params.wat b/winch/filetests/filetests/x64/f32_convert_i32_s/params.wat
new file mode 100644
index 000000000..86b3b8f48
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_convert_i32_s/params.wat
@@ -0,0 +1,18 @@
+;;! target = "x86_64"
+
+(module
+    (func (param i32) (result f32)
+        (local.get 0)
+        (f32.convert_i32_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 897c240c             	mov	dword ptr [rsp + 0xc], edi
+;;    c:	 4c893424             	mov	qword ptr [rsp], r14
+;;   10:	 8b44240c             	mov	eax, dword ptr [rsp + 0xc]
+;;   14:	 f30f2ac0             	cvtsi2ss	xmm0, eax
+;;   18:	 4883c410             	add	rsp, 0x10
+;;   1c:	 5d                   	pop	rbp
+;;   1d:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_convert_i32_s/spilled.wat b/winch/filetests/filetests/x64/f32_convert_i32_s/spilled.wat
new file mode 100644
index 000000000..1b4032790
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_convert_i32_s/spilled.wat
@@ -0,0 +1,23 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        i32.const 1
+        f32.convert_i32_s
+        block
+        end
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 b801000000           	mov	eax, 1
+;;   11:	 f30f2ac0             	cvtsi2ss	xmm0, eax
+;;   15:	 4883ec04             	sub	rsp, 4
+;;   19:	 f30f110424           	movss	dword ptr [rsp], xmm0
+;;   1e:	 f30f100424           	movss	xmm0, dword ptr [rsp]
+;;   23:	 4883c404             	add	rsp, 4
+;;   27:	 4883c408             	add	rsp, 8
+;;   2b:	 5d                   	pop	rbp
+;;   2c:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_convert_i32_u/const.wat b/winch/filetests/filetests/x64/f32_convert_i32_u/const.wat
new file mode 100644
index 000000000..d9c25727b
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_convert_i32_u/const.wat
@@ -0,0 +1,28 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        (i32.const 1)
+        (f32.convert_i32_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 b901000000           	mov	ecx, 1
+;;   11:	 8bc9                 	mov	ecx, ecx
+;;   13:	 4883f900             	cmp	rcx, 0
+;;   17:	 0f8c0a000000         	jl	0x27
+;;   1d:	 f3480f2ac1           	cvtsi2ss	xmm0, rcx
+;;   22:	 e91a000000           	jmp	0x41
+;;   27:	 4989cb               	mov	r11, rcx
+;;   2a:	 49c1eb01             	shr	r11, 1
+;;   2e:	 4889c8               	mov	rax, rcx
+;;   31:	 4883e001             	and	rax, 1
+;;   35:	 4c09d8               	or	rax, r11
+;;   38:	 f3480f2ac0           	cvtsi2ss	xmm0, rax
+;;   3d:	 f30f58c0             	addss	xmm0, xmm0
+;;   41:	 4883c408             	add	rsp, 8
+;;   45:	 5d                   	pop	rbp
+;;   46:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_convert_i32_u/locals.wat b/winch/filetests/filetests/x64/f32_convert_i32_u/locals.wat
new file mode 100644
index 000000000..28b230012
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_convert_i32_u/locals.wat
@@ -0,0 +1,32 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        (local i32)  
+
+        (local.get 0)
+        (f32.convert_i32_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 8b4c240c             	mov	ecx, dword ptr [rsp + 0xc]
+;;   19:	 8bc9                 	mov	ecx, ecx
+;;   1b:	 4883f900             	cmp	rcx, 0
+;;   1f:	 0f8c0a000000         	jl	0x2f
+;;   25:	 f3480f2ac1           	cvtsi2ss	xmm0, rcx
+;;   2a:	 e91a000000           	jmp	0x49
+;;   2f:	 4989cb               	mov	r11, rcx
+;;   32:	 49c1eb01             	shr	r11, 1
+;;   36:	 4889c8               	mov	rax, rcx
+;;   39:	 4883e001             	and	rax, 1
+;;   3d:	 4c09d8               	or	rax, r11
+;;   40:	 f3480f2ac0           	cvtsi2ss	xmm0, rax
+;;   45:	 f30f58c0             	addss	xmm0, xmm0
+;;   49:	 4883c410             	add	rsp, 0x10
+;;   4d:	 5d                   	pop	rbp
+;;   4e:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_convert_i32_u/params.wat b/winch/filetests/filetests/x64/f32_convert_i32_u/params.wat
new file mode 100644
index 000000000..d6f3c0aaa
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_convert_i32_u/params.wat
@@ -0,0 +1,29 @@
+;;! target = "x86_64"
+
+(module
+    (func (param i32) (result f32)
+        (local.get 0)
+        (f32.convert_i32_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 897c240c             	mov	dword ptr [rsp + 0xc], edi
+;;    c:	 4c893424             	mov	qword ptr [rsp], r14
+;;   10:	 8b4c240c             	mov	ecx, dword ptr [rsp + 0xc]
+;;   14:	 8bc9                 	mov	ecx, ecx
+;;   16:	 4883f900             	cmp	rcx, 0
+;;   1a:	 0f8c0a000000         	jl	0x2a
+;;   20:	 f3480f2ac1           	cvtsi2ss	xmm0, rcx
+;;   25:	 e91a000000           	jmp	0x44
+;;   2a:	 4989cb               	mov	r11, rcx
+;;   2d:	 49c1eb01             	shr	r11, 1
+;;   31:	 4889c8               	mov	rax, rcx
+;;   34:	 4883e001             	and	rax, 1
+;;   38:	 4c09d8               	or	rax, r11
+;;   3b:	 f3480f2ac0           	cvtsi2ss	xmm0, rax
+;;   40:	 f30f58c0             	addss	xmm0, xmm0
+;;   44:	 4883c410             	add	rsp, 0x10
+;;   48:	 5d                   	pop	rbp
+;;   49:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_convert_i32_u/spilled.wat b/winch/filetests/filetests/x64/f32_convert_i32_u/spilled.wat
new file mode 100644
index 000000000..4adcebe3e
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_convert_i32_u/spilled.wat
@@ -0,0 +1,34 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        i32.const 1
+        f32.convert_i32_u
+        block
+        end
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 b901000000           	mov	ecx, 1
+;;   11:	 8bc9                 	mov	ecx, ecx
+;;   13:	 4883f900             	cmp	rcx, 0
+;;   17:	 0f8c0a000000         	jl	0x27
+;;   1d:	 f3480f2ac1           	cvtsi2ss	xmm0, rcx
+;;   22:	 e91a000000           	jmp	0x41
+;;   27:	 4989cb               	mov	r11, rcx
+;;   2a:	 49c1eb01             	shr	r11, 1
+;;   2e:	 4889c8               	mov	rax, rcx
+;;   31:	 4883e001             	and	rax, 1
+;;   35:	 4c09d8               	or	rax, r11
+;;   38:	 f3480f2ac0           	cvtsi2ss	xmm0, rax
+;;   3d:	 f30f58c0             	addss	xmm0, xmm0
+;;   41:	 4883ec04             	sub	rsp, 4
+;;   45:	 f30f110424           	movss	dword ptr [rsp], xmm0
+;;   4a:	 f30f100424           	movss	xmm0, dword ptr [rsp]
+;;   4f:	 4883c404             	add	rsp, 4
+;;   53:	 4883c408             	add	rsp, 8
+;;   57:	 5d                   	pop	rbp
+;;   58:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_convert_i64_s/const.wat b/winch/filetests/filetests/x64/f32_convert_i64_s/const.wat
new file mode 100644
index 000000000..7cd031627
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_convert_i64_s/const.wat
@@ -0,0 +1,17 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        (i64.const 1)
+        (f32.convert_i64_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 48c7c001000000       	mov	rax, 1
+;;   13:	 f3480f2ac0           	cvtsi2ss	xmm0, rax
+;;   18:	 4883c408             	add	rsp, 8
+;;   1c:	 5d                   	pop	rbp
+;;   1d:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_convert_i64_s/locals.wat b/winch/filetests/filetests/x64/f32_convert_i64_s/locals.wat
new file mode 100644
index 000000000..83eebb427
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_convert_i64_s/locals.wat
@@ -0,0 +1,21 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        (local i64)  
+
+        (local.get 0)
+        (f32.convert_i64_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 488b442408           	mov	rax, qword ptr [rsp + 8]
+;;   1a:	 f3480f2ac0           	cvtsi2ss	xmm0, rax
+;;   1f:	 4883c410             	add	rsp, 0x10
+;;   23:	 5d                   	pop	rbp
+;;   24:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_convert_i64_s/params.wat b/winch/filetests/filetests/x64/f32_convert_i64_s/params.wat
new file mode 100644
index 000000000..d37e0da01
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_convert_i64_s/params.wat
@@ -0,0 +1,18 @@
+;;! target = "x86_64"
+
+(module
+    (func (param i64) (result f32)
+        (local.get 0)
+        (f32.convert_i64_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48897c2408           	mov	qword ptr [rsp + 8], rdi
+;;    d:	 4c893424             	mov	qword ptr [rsp], r14
+;;   11:	 488b442408           	mov	rax, qword ptr [rsp + 8]
+;;   16:	 f3480f2ac0           	cvtsi2ss	xmm0, rax
+;;   1b:	 4883c410             	add	rsp, 0x10
+;;   1f:	 5d                   	pop	rbp
+;;   20:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_convert_i64_s/spilled.wat b/winch/filetests/filetests/x64/f32_convert_i64_s/spilled.wat
new file mode 100644
index 000000000..57bb3c712
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_convert_i64_s/spilled.wat
@@ -0,0 +1,23 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        i64.const 1
+        f32.convert_i64_s
+        block
+        end
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 48c7c001000000       	mov	rax, 1
+;;   13:	 f3480f2ac0           	cvtsi2ss	xmm0, rax
+;;   18:	 4883ec04             	sub	rsp, 4
+;;   1c:	 f30f110424           	movss	dword ptr [rsp], xmm0
+;;   21:	 f30f100424           	movss	xmm0, dword ptr [rsp]
+;;   26:	 4883c404             	add	rsp, 4
+;;   2a:	 4883c408             	add	rsp, 8
+;;   2e:	 5d                   	pop	rbp
+;;   2f:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_convert_i64_u/const.wat b/winch/filetests/filetests/x64/f32_convert_i64_u/const.wat
new file mode 100644
index 000000000..d9dffa802
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_convert_i64_u/const.wat
@@ -0,0 +1,27 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        (i64.const 1)
+        (f32.convert_i64_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 48c7c101000000       	mov	rcx, 1
+;;   13:	 4883f900             	cmp	rcx, 0
+;;   17:	 0f8c0a000000         	jl	0x27
+;;   1d:	 f3480f2ac1           	cvtsi2ss	xmm0, rcx
+;;   22:	 e91a000000           	jmp	0x41
+;;   27:	 4989cb               	mov	r11, rcx
+;;   2a:	 49c1eb01             	shr	r11, 1
+;;   2e:	 4889c8               	mov	rax, rcx
+;;   31:	 4883e001             	and	rax, 1
+;;   35:	 4c09d8               	or	rax, r11
+;;   38:	 f3480f2ac0           	cvtsi2ss	xmm0, rax
+;;   3d:	 f30f58c0             	addss	xmm0, xmm0
+;;   41:	 4883c408             	add	rsp, 8
+;;   45:	 5d                   	pop	rbp
+;;   46:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_convert_i64_u/locals.wat b/winch/filetests/filetests/x64/f32_convert_i64_u/locals.wat
new file mode 100644
index 000000000..76d32eee5
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_convert_i64_u/locals.wat
@@ -0,0 +1,31 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        (local i64)  
+
+        (local.get 0)
+        (f32.convert_i64_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 488b4c2408           	mov	rcx, qword ptr [rsp + 8]
+;;   1a:	 4883f900             	cmp	rcx, 0
+;;   1e:	 0f8c0a000000         	jl	0x2e
+;;   24:	 f3480f2ac1           	cvtsi2ss	xmm0, rcx
+;;   29:	 e91a000000           	jmp	0x48
+;;   2e:	 4989cb               	mov	r11, rcx
+;;   31:	 49c1eb01             	shr	r11, 1
+;;   35:	 4889c8               	mov	rax, rcx
+;;   38:	 4883e001             	and	rax, 1
+;;   3c:	 4c09d8               	or	rax, r11
+;;   3f:	 f3480f2ac0           	cvtsi2ss	xmm0, rax
+;;   44:	 f30f58c0             	addss	xmm0, xmm0
+;;   48:	 4883c410             	add	rsp, 0x10
+;;   4c:	 5d                   	pop	rbp
+;;   4d:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_convert_i64_u/params.wat b/winch/filetests/filetests/x64/f32_convert_i64_u/params.wat
new file mode 100644
index 000000000..16081572b
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_convert_i64_u/params.wat
@@ -0,0 +1,28 @@
+;;! target = "x86_64"
+
+(module
+    (func (param i64) (result f32)
+        (local.get 0)
+        (f32.convert_i64_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48897c2408           	mov	qword ptr [rsp + 8], rdi
+;;    d:	 4c893424             	mov	qword ptr [rsp], r14
+;;   11:	 488b4c2408           	mov	rcx, qword ptr [rsp + 8]
+;;   16:	 4883f900             	cmp	rcx, 0
+;;   1a:	 0f8c0a000000         	jl	0x2a
+;;   20:	 f3480f2ac1           	cvtsi2ss	xmm0, rcx
+;;   25:	 e91a000000           	jmp	0x44
+;;   2a:	 4989cb               	mov	r11, rcx
+;;   2d:	 49c1eb01             	shr	r11, 1
+;;   31:	 4889c8               	mov	rax, rcx
+;;   34:	 4883e001             	and	rax, 1
+;;   38:	 4c09d8               	or	rax, r11
+;;   3b:	 f3480f2ac0           	cvtsi2ss	xmm0, rax
+;;   40:	 f30f58c0             	addss	xmm0, xmm0
+;;   44:	 4883c410             	add	rsp, 0x10
+;;   48:	 5d                   	pop	rbp
+;;   49:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_convert_i64_u/spilled.wat b/winch/filetests/filetests/x64/f32_convert_i64_u/spilled.wat
new file mode 100644
index 000000000..4ab75f413
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_convert_i64_u/spilled.wat
@@ -0,0 +1,33 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        i64.const 1
+        f32.convert_i64_u
+        block
+        end
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 48c7c101000000       	mov	rcx, 1
+;;   13:	 4883f900             	cmp	rcx, 0
+;;   17:	 0f8c0a000000         	jl	0x27
+;;   1d:	 f3480f2ac1           	cvtsi2ss	xmm0, rcx
+;;   22:	 e91a000000           	jmp	0x41
+;;   27:	 4989cb               	mov	r11, rcx
+;;   2a:	 49c1eb01             	shr	r11, 1
+;;   2e:	 4889c8               	mov	rax, rcx
+;;   31:	 4883e001             	and	rax, 1
+;;   35:	 4c09d8               	or	rax, r11
+;;   38:	 f3480f2ac0           	cvtsi2ss	xmm0, rax
+;;   3d:	 f30f58c0             	addss	xmm0, xmm0
+;;   41:	 4883ec04             	sub	rsp, 4
+;;   45:	 f30f110424           	movss	dword ptr [rsp], xmm0
+;;   4a:	 f30f100424           	movss	xmm0, dword ptr [rsp]
+;;   4f:	 4883c404             	add	rsp, 4
+;;   53:	 4883c408             	add	rsp, 8
+;;   57:	 5d                   	pop	rbp
+;;   58:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_demote_f64/const.wat b/winch/filetests/filetests/x64/f32_demote_f64/const.wat
new file mode 100644
index 000000000..f4f1fd2b4
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_demote_f64/const.wat
@@ -0,0 +1,21 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        (f64.const 1.0)
+        (f32.demote_f64)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 f20f10050c000000     	movsd	xmm0, qword ptr [rip + 0xc]
+;;   14:	 f20f5ac0             	cvtsd2ss	xmm0, xmm0
+;;   18:	 4883c408             	add	rsp, 8
+;;   1c:	 5d                   	pop	rbp
+;;   1d:	 c3                   	ret	
+;;   1e:	 0000                 	add	byte ptr [rax], al
+;;   20:	 0000                 	add	byte ptr [rax], al
+;;   22:	 0000                 	add	byte ptr [rax], al
+;;   24:	 0000                 	add	byte ptr [rax], al
diff --git a/winch/filetests/filetests/x64/f32_demote_f64/locals.wat b/winch/filetests/filetests/x64/f32_demote_f64/locals.wat
new file mode 100644
index 000000000..ff93ed961
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_demote_f64/locals.wat
@@ -0,0 +1,21 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        (local f64)  
+
+        (local.get 0)
+        (f32.demote_f64)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 f20f10442408         	movsd	xmm0, qword ptr [rsp + 8]
+;;   1b:	 f20f5ac0             	cvtsd2ss	xmm0, xmm0
+;;   1f:	 4883c410             	add	rsp, 0x10
+;;   23:	 5d                   	pop	rbp
+;;   24:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_demote_f64/params.wat b/winch/filetests/filetests/x64/f32_demote_f64/params.wat
new file mode 100644
index 000000000..0c96da266
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_demote_f64/params.wat
@@ -0,0 +1,18 @@
+;;! target = "x86_64"
+
+(module
+    (func (param f64) (result f32)
+        (local.get 0)
+        (f32.demote_f64)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 f20f11442408         	movsd	qword ptr [rsp + 8], xmm0
+;;    e:	 4c893424             	mov	qword ptr [rsp], r14
+;;   12:	 f20f10442408         	movsd	xmm0, qword ptr [rsp + 8]
+;;   18:	 f20f5ac0             	cvtsd2ss	xmm0, xmm0
+;;   1c:	 4883c410             	add	rsp, 0x10
+;;   20:	 5d                   	pop	rbp
+;;   21:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_demote_f64/spilled.wat b/winch/filetests/filetests/x64/f32_demote_f64/spilled.wat
new file mode 100644
index 000000000..36dbd9929
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_demote_f64/spilled.wat
@@ -0,0 +1,26 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        f64.const 1.0
+        f32.demote_f64
+        block
+        end
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 f20f10051c000000     	movsd	xmm0, qword ptr [rip + 0x1c]
+;;   14:	 f20f5ac0             	cvtsd2ss	xmm0, xmm0
+;;   18:	 4883ec04             	sub	rsp, 4
+;;   1c:	 f30f110424           	movss	dword ptr [rsp], xmm0
+;;   21:	 f30f100424           	movss	xmm0, dword ptr [rsp]
+;;   26:	 4883c404             	add	rsp, 4
+;;   2a:	 4883c408             	add	rsp, 8
+;;   2e:	 5d                   	pop	rbp
+;;   2f:	 c3                   	ret	
+;;   30:	 0000                 	add	byte ptr [rax], al
+;;   32:	 0000                 	add	byte ptr [rax], al
+;;   34:	 0000                 	add	byte ptr [rax], al
diff --git a/winch/filetests/filetests/x64/f32_reinterpret_i32/const.wat b/winch/filetests/filetests/x64/f32_reinterpret_i32/const.wat
new file mode 100644
index 000000000..ce27e3564
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_reinterpret_i32/const.wat
@@ -0,0 +1,17 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        (i32.const 1)
+        (f32.reinterpret_i32)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 b801000000           	mov	eax, 1
+;;   11:	 660f6ec0             	movd	xmm0, eax
+;;   15:	 4883c408             	add	rsp, 8
+;;   19:	 5d                   	pop	rbp
+;;   1a:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_reinterpret_i32/locals.wat b/winch/filetests/filetests/x64/f32_reinterpret_i32/locals.wat
new file mode 100644
index 000000000..7d00cd5f8
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_reinterpret_i32/locals.wat
@@ -0,0 +1,21 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        (local i32)  
+
+        (local.get 0)
+        (f32.reinterpret_i32)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 8b44240c             	mov	eax, dword ptr [rsp + 0xc]
+;;   19:	 660f6ec0             	movd	xmm0, eax
+;;   1d:	 4883c410             	add	rsp, 0x10
+;;   21:	 5d                   	pop	rbp
+;;   22:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_reinterpret_i32/params.wat b/winch/filetests/filetests/x64/f32_reinterpret_i32/params.wat
new file mode 100644
index 000000000..37820a0d9
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_reinterpret_i32/params.wat
@@ -0,0 +1,18 @@
+;;! target = "x86_64"
+
+(module
+    (func (param i32) (result f32)
+        (local.get 0)
+        (f32.reinterpret_i32)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 897c240c             	mov	dword ptr [rsp + 0xc], edi
+;;    c:	 4c893424             	mov	qword ptr [rsp], r14
+;;   10:	 8b44240c             	mov	eax, dword ptr [rsp + 0xc]
+;;   14:	 660f6ec0             	movd	xmm0, eax
+;;   18:	 4883c410             	add	rsp, 0x10
+;;   1c:	 5d                   	pop	rbp
+;;   1d:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_reinterpret_i32/ret_int.wat b/winch/filetests/filetests/x64/f32_reinterpret_i32/ret_int.wat
new file mode 100644
index 000000000..bccccc613
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_reinterpret_i32/ret_int.wat
@@ -0,0 +1,20 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i32)
+        i32.const 1
+        f32.reinterpret_i32
+        drop
+        i32.const 1
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 b801000000           	mov	eax, 1
+;;   11:	 660f6ec0             	movd	xmm0, eax
+;;   15:	 b801000000           	mov	eax, 1
+;;   1a:	 4883c408             	add	rsp, 8
+;;   1e:	 5d                   	pop	rbp
+;;   1f:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f32_reinterpret_i32/spilled.wat b/winch/filetests/filetests/x64/f32_reinterpret_i32/spilled.wat
new file mode 100644
index 000000000..316d7aa2d
--- /dev/null
+++ b/winch/filetests/filetests/x64/f32_reinterpret_i32/spilled.wat
@@ -0,0 +1,23 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        i32.const 1
+        f32.reinterpret_i32
+        block
+        end
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 b801000000           	mov	eax, 1
+;;   11:	 660f6ec0             	movd	xmm0, eax
+;;   15:	 4883ec04             	sub	rsp, 4
+;;   19:	 f30f110424           	movss	dword ptr [rsp], xmm0
+;;   1e:	 f30f100424           	movss	xmm0, dword ptr [rsp]
+;;   23:	 4883c404             	add	rsp, 4
+;;   27:	 4883c408             	add	rsp, 8
+;;   2b:	 5d                   	pop	rbp
+;;   2c:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_convert_i32_s/const.wat b/winch/filetests/filetests/x64/f64_convert_i32_s/const.wat
new file mode 100644
index 000000000..d6bbb66c8
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_convert_i32_s/const.wat
@@ -0,0 +1,17 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        (i32.const 1)
+        (f64.convert_i32_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 b801000000           	mov	eax, 1
+;;   11:	 f20f2ac0             	cvtsi2sd	xmm0, eax
+;;   15:	 4883c408             	add	rsp, 8
+;;   19:	 5d                   	pop	rbp
+;;   1a:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_convert_i32_s/locals.wat b/winch/filetests/filetests/x64/f64_convert_i32_s/locals.wat
new file mode 100644
index 000000000..a3e7c113d
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_convert_i32_s/locals.wat
@@ -0,0 +1,21 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        (local i32)  
+
+        (local.get 0)
+        (f64.convert_i32_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 8b44240c             	mov	eax, dword ptr [rsp + 0xc]
+;;   19:	 f20f2ac0             	cvtsi2sd	xmm0, eax
+;;   1d:	 4883c410             	add	rsp, 0x10
+;;   21:	 5d                   	pop	rbp
+;;   22:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_convert_i32_s/params.wat b/winch/filetests/filetests/x64/f64_convert_i32_s/params.wat
new file mode 100644
index 000000000..d9f7d0b70
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_convert_i32_s/params.wat
@@ -0,0 +1,18 @@
+;;! target = "x86_64"
+
+(module
+    (func (param i32) (result f64)
+        (local.get 0)
+        (f64.convert_i32_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 897c240c             	mov	dword ptr [rsp + 0xc], edi
+;;    c:	 4c893424             	mov	qword ptr [rsp], r14
+;;   10:	 8b44240c             	mov	eax, dword ptr [rsp + 0xc]
+;;   14:	 f20f2ac0             	cvtsi2sd	xmm0, eax
+;;   18:	 4883c410             	add	rsp, 0x10
+;;   1c:	 5d                   	pop	rbp
+;;   1d:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_convert_i32_s/spilled.wat b/winch/filetests/filetests/x64/f64_convert_i32_s/spilled.wat
new file mode 100644
index 000000000..7984d64ec
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_convert_i32_s/spilled.wat
@@ -0,0 +1,23 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        i32.const 1
+        f64.convert_i32_s
+        block
+        end
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 b801000000           	mov	eax, 1
+;;   11:	 f20f2ac0             	cvtsi2sd	xmm0, eax
+;;   15:	 4883ec08             	sub	rsp, 8
+;;   19:	 f20f110424           	movsd	qword ptr [rsp], xmm0
+;;   1e:	 f20f100424           	movsd	xmm0, qword ptr [rsp]
+;;   23:	 4883c408             	add	rsp, 8
+;;   27:	 4883c408             	add	rsp, 8
+;;   2b:	 5d                   	pop	rbp
+;;   2c:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_convert_i32_u/const.wat b/winch/filetests/filetests/x64/f64_convert_i32_u/const.wat
new file mode 100644
index 000000000..d07f5d232
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_convert_i32_u/const.wat
@@ -0,0 +1,28 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        (i32.const 1)
+        (f64.convert_i32_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 b901000000           	mov	ecx, 1
+;;   11:	 8bc9                 	mov	ecx, ecx
+;;   13:	 4883f900             	cmp	rcx, 0
+;;   17:	 0f8c0a000000         	jl	0x27
+;;   1d:	 f2480f2ac1           	cvtsi2sd	xmm0, rcx
+;;   22:	 e91a000000           	jmp	0x41
+;;   27:	 4989cb               	mov	r11, rcx
+;;   2a:	 49c1eb01             	shr	r11, 1
+;;   2e:	 4889c8               	mov	rax, rcx
+;;   31:	 4883e001             	and	rax, 1
+;;   35:	 4c09d8               	or	rax, r11
+;;   38:	 f2480f2ac0           	cvtsi2sd	xmm0, rax
+;;   3d:	 f20f58c0             	addsd	xmm0, xmm0
+;;   41:	 4883c408             	add	rsp, 8
+;;   45:	 5d                   	pop	rbp
+;;   46:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_convert_i32_u/locals.wat b/winch/filetests/filetests/x64/f64_convert_i32_u/locals.wat
new file mode 100644
index 000000000..5c72f2a7b
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_convert_i32_u/locals.wat
@@ -0,0 +1,32 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        (local i32)  
+
+        (local.get 0)
+        (f64.convert_i32_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 8b4c240c             	mov	ecx, dword ptr [rsp + 0xc]
+;;   19:	 8bc9                 	mov	ecx, ecx
+;;   1b:	 4883f900             	cmp	rcx, 0
+;;   1f:	 0f8c0a000000         	jl	0x2f
+;;   25:	 f2480f2ac1           	cvtsi2sd	xmm0, rcx
+;;   2a:	 e91a000000           	jmp	0x49
+;;   2f:	 4989cb               	mov	r11, rcx
+;;   32:	 49c1eb01             	shr	r11, 1
+;;   36:	 4889c8               	mov	rax, rcx
+;;   39:	 4883e001             	and	rax, 1
+;;   3d:	 4c09d8               	or	rax, r11
+;;   40:	 f2480f2ac0           	cvtsi2sd	xmm0, rax
+;;   45:	 f20f58c0             	addsd	xmm0, xmm0
+;;   49:	 4883c410             	add	rsp, 0x10
+;;   4d:	 5d                   	pop	rbp
+;;   4e:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_convert_i32_u/params.wat b/winch/filetests/filetests/x64/f64_convert_i32_u/params.wat
new file mode 100644
index 000000000..42d76ed69
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_convert_i32_u/params.wat
@@ -0,0 +1,29 @@
+;;! target = "x86_64"
+
+(module
+    (func (param i32) (result f64)
+        (local.get 0)
+        (f64.convert_i32_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 897c240c             	mov	dword ptr [rsp + 0xc], edi
+;;    c:	 4c893424             	mov	qword ptr [rsp], r14
+;;   10:	 8b4c240c             	mov	ecx, dword ptr [rsp + 0xc]
+;;   14:	 8bc9                 	mov	ecx, ecx
+;;   16:	 4883f900             	cmp	rcx, 0
+;;   1a:	 0f8c0a000000         	jl	0x2a
+;;   20:	 f2480f2ac1           	cvtsi2sd	xmm0, rcx
+;;   25:	 e91a000000           	jmp	0x44
+;;   2a:	 4989cb               	mov	r11, rcx
+;;   2d:	 49c1eb01             	shr	r11, 1
+;;   31:	 4889c8               	mov	rax, rcx
+;;   34:	 4883e001             	and	rax, 1
+;;   38:	 4c09d8               	or	rax, r11
+;;   3b:	 f2480f2ac0           	cvtsi2sd	xmm0, rax
+;;   40:	 f20f58c0             	addsd	xmm0, xmm0
+;;   44:	 4883c410             	add	rsp, 0x10
+;;   48:	 5d                   	pop	rbp
+;;   49:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_convert_i32_u/spilled.wat b/winch/filetests/filetests/x64/f64_convert_i32_u/spilled.wat
new file mode 100644
index 000000000..851ab6a81
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_convert_i32_u/spilled.wat
@@ -0,0 +1,34 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        i32.const 1
+        f64.convert_i32_u
+        block
+        end
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 b901000000           	mov	ecx, 1
+;;   11:	 8bc9                 	mov	ecx, ecx
+;;   13:	 4883f900             	cmp	rcx, 0
+;;   17:	 0f8c0a000000         	jl	0x27
+;;   1d:	 f2480f2ac1           	cvtsi2sd	xmm0, rcx
+;;   22:	 e91a000000           	jmp	0x41
+;;   27:	 4989cb               	mov	r11, rcx
+;;   2a:	 49c1eb01             	shr	r11, 1
+;;   2e:	 4889c8               	mov	rax, rcx
+;;   31:	 4883e001             	and	rax, 1
+;;   35:	 4c09d8               	or	rax, r11
+;;   38:	 f2480f2ac0           	cvtsi2sd	xmm0, rax
+;;   3d:	 f20f58c0             	addsd	xmm0, xmm0
+;;   41:	 4883ec08             	sub	rsp, 8
+;;   45:	 f20f110424           	movsd	qword ptr [rsp], xmm0
+;;   4a:	 f20f100424           	movsd	xmm0, qword ptr [rsp]
+;;   4f:	 4883c408             	add	rsp, 8
+;;   53:	 4883c408             	add	rsp, 8
+;;   57:	 5d                   	pop	rbp
+;;   58:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_convert_i64_s/const.wat b/winch/filetests/filetests/x64/f64_convert_i64_s/const.wat
new file mode 100644
index 000000000..32d3423a6
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_convert_i64_s/const.wat
@@ -0,0 +1,17 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        (i64.const 1)
+        (f64.convert_i64_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 48c7c001000000       	mov	rax, 1
+;;   13:	 f2480f2ac0           	cvtsi2sd	xmm0, rax
+;;   18:	 4883c408             	add	rsp, 8
+;;   1c:	 5d                   	pop	rbp
+;;   1d:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_convert_i64_s/locals.wat b/winch/filetests/filetests/x64/f64_convert_i64_s/locals.wat
new file mode 100644
index 000000000..32abd1ffa
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_convert_i64_s/locals.wat
@@ -0,0 +1,21 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        (local i64)  
+
+        (local.get 0)
+        (f64.convert_i64_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 488b442408           	mov	rax, qword ptr [rsp + 8]
+;;   1a:	 f2480f2ac0           	cvtsi2sd	xmm0, rax
+;;   1f:	 4883c410             	add	rsp, 0x10
+;;   23:	 5d                   	pop	rbp
+;;   24:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_convert_i64_s/params.wat b/winch/filetests/filetests/x64/f64_convert_i64_s/params.wat
new file mode 100644
index 000000000..047fc774e
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_convert_i64_s/params.wat
@@ -0,0 +1,18 @@
+;;! target = "x86_64"
+
+(module
+    (func (param i64) (result f64)
+        (local.get 0)
+        (f64.convert_i64_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48897c2408           	mov	qword ptr [rsp + 8], rdi
+;;    d:	 4c893424             	mov	qword ptr [rsp], r14
+;;   11:	 488b442408           	mov	rax, qword ptr [rsp + 8]
+;;   16:	 f2480f2ac0           	cvtsi2sd	xmm0, rax
+;;   1b:	 4883c410             	add	rsp, 0x10
+;;   1f:	 5d                   	pop	rbp
+;;   20:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_convert_i64_s/spilled.wat b/winch/filetests/filetests/x64/f64_convert_i64_s/spilled.wat
new file mode 100644
index 000000000..c19eae252
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_convert_i64_s/spilled.wat
@@ -0,0 +1,23 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        i64.const 1
+        f64.convert_i64_s
+        block
+        end
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 48c7c001000000       	mov	rax, 1
+;;   13:	 f2480f2ac0           	cvtsi2sd	xmm0, rax
+;;   18:	 4883ec08             	sub	rsp, 8
+;;   1c:	 f20f110424           	movsd	qword ptr [rsp], xmm0
+;;   21:	 f20f100424           	movsd	xmm0, qword ptr [rsp]
+;;   26:	 4883c408             	add	rsp, 8
+;;   2a:	 4883c408             	add	rsp, 8
+;;   2e:	 5d                   	pop	rbp
+;;   2f:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_convert_i64_u/const.wat b/winch/filetests/filetests/x64/f64_convert_i64_u/const.wat
new file mode 100644
index 000000000..5833e9fbe
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_convert_i64_u/const.wat
@@ -0,0 +1,27 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        (i64.const 1)
+        (f64.convert_i64_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 48c7c101000000       	mov	rcx, 1
+;;   13:	 4883f900             	cmp	rcx, 0
+;;   17:	 0f8c0a000000         	jl	0x27
+;;   1d:	 f2480f2ac1           	cvtsi2sd	xmm0, rcx
+;;   22:	 e91a000000           	jmp	0x41
+;;   27:	 4989cb               	mov	r11, rcx
+;;   2a:	 49c1eb01             	shr	r11, 1
+;;   2e:	 4889c8               	mov	rax, rcx
+;;   31:	 4883e001             	and	rax, 1
+;;   35:	 4c09d8               	or	rax, r11
+;;   38:	 f2480f2ac0           	cvtsi2sd	xmm0, rax
+;;   3d:	 f20f58c0             	addsd	xmm0, xmm0
+;;   41:	 4883c408             	add	rsp, 8
+;;   45:	 5d                   	pop	rbp
+;;   46:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_convert_i64_u/locals.wat b/winch/filetests/filetests/x64/f64_convert_i64_u/locals.wat
new file mode 100644
index 000000000..0caa8faef
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_convert_i64_u/locals.wat
@@ -0,0 +1,31 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        (local i64)  
+
+        (local.get 0)
+        (f64.convert_i64_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 488b4c2408           	mov	rcx, qword ptr [rsp + 8]
+;;   1a:	 4883f900             	cmp	rcx, 0
+;;   1e:	 0f8c0a000000         	jl	0x2e
+;;   24:	 f2480f2ac1           	cvtsi2sd	xmm0, rcx
+;;   29:	 e91a000000           	jmp	0x48
+;;   2e:	 4989cb               	mov	r11, rcx
+;;   31:	 49c1eb01             	shr	r11, 1
+;;   35:	 4889c8               	mov	rax, rcx
+;;   38:	 4883e001             	and	rax, 1
+;;   3c:	 4c09d8               	or	rax, r11
+;;   3f:	 f2480f2ac0           	cvtsi2sd	xmm0, rax
+;;   44:	 f20f58c0             	addsd	xmm0, xmm0
+;;   48:	 4883c410             	add	rsp, 0x10
+;;   4c:	 5d                   	pop	rbp
+;;   4d:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_convert_i64_u/params.wat b/winch/filetests/filetests/x64/f64_convert_i64_u/params.wat
new file mode 100644
index 000000000..3f1e49629
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_convert_i64_u/params.wat
@@ -0,0 +1,28 @@
+;;! target = "x86_64"
+
+(module
+    (func (param i64) (result f64)
+        (local.get 0)
+        (f64.convert_i64_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48897c2408           	mov	qword ptr [rsp + 8], rdi
+;;    d:	 4c893424             	mov	qword ptr [rsp], r14
+;;   11:	 488b4c2408           	mov	rcx, qword ptr [rsp + 8]
+;;   16:	 4883f900             	cmp	rcx, 0
+;;   1a:	 0f8c0a000000         	jl	0x2a
+;;   20:	 f2480f2ac1           	cvtsi2sd	xmm0, rcx
+;;   25:	 e91a000000           	jmp	0x44
+;;   2a:	 4989cb               	mov	r11, rcx
+;;   2d:	 49c1eb01             	shr	r11, 1
+;;   31:	 4889c8               	mov	rax, rcx
+;;   34:	 4883e001             	and	rax, 1
+;;   38:	 4c09d8               	or	rax, r11
+;;   3b:	 f2480f2ac0           	cvtsi2sd	xmm0, rax
+;;   40:	 f20f58c0             	addsd	xmm0, xmm0
+;;   44:	 4883c410             	add	rsp, 0x10
+;;   48:	 5d                   	pop	rbp
+;;   49:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_convert_i64_u/spilled.wat b/winch/filetests/filetests/x64/f64_convert_i64_u/spilled.wat
new file mode 100644
index 000000000..23030150b
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_convert_i64_u/spilled.wat
@@ -0,0 +1,33 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        i64.const 1
+        f64.convert_i64_u
+        block
+        end
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 48c7c101000000       	mov	rcx, 1
+;;   13:	 4883f900             	cmp	rcx, 0
+;;   17:	 0f8c0a000000         	jl	0x27
+;;   1d:	 f2480f2ac1           	cvtsi2sd	xmm0, rcx
+;;   22:	 e91a000000           	jmp	0x41
+;;   27:	 4989cb               	mov	r11, rcx
+;;   2a:	 49c1eb01             	shr	r11, 1
+;;   2e:	 4889c8               	mov	rax, rcx
+;;   31:	 4883e001             	and	rax, 1
+;;   35:	 4c09d8               	or	rax, r11
+;;   38:	 f2480f2ac0           	cvtsi2sd	xmm0, rax
+;;   3d:	 f20f58c0             	addsd	xmm0, xmm0
+;;   41:	 4883ec08             	sub	rsp, 8
+;;   45:	 f20f110424           	movsd	qword ptr [rsp], xmm0
+;;   4a:	 f20f100424           	movsd	xmm0, qword ptr [rsp]
+;;   4f:	 4883c408             	add	rsp, 8
+;;   53:	 4883c408             	add	rsp, 8
+;;   57:	 5d                   	pop	rbp
+;;   58:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_promote_f32/const.wat b/winch/filetests/filetests/x64/f64_promote_f32/const.wat
new file mode 100644
index 000000000..28e079275
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_promote_f32/const.wat
@@ -0,0 +1,19 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        (f32.const 1.0)
+        (f64.promote_f32)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 f30f10050c000000     	movss	xmm0, dword ptr [rip + 0xc]
+;;   14:	 f30f5ac0             	cvtss2sd	xmm0, xmm0
+;;   18:	 4883c408             	add	rsp, 8
+;;   1c:	 5d                   	pop	rbp
+;;   1d:	 c3                   	ret	
+;;   1e:	 0000                 	add	byte ptr [rax], al
+;;   20:	 0000                 	add	byte ptr [rax], al
diff --git a/winch/filetests/filetests/x64/f64_promote_f32/locals.wat b/winch/filetests/filetests/x64/f64_promote_f32/locals.wat
new file mode 100644
index 000000000..438a9a8ea
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_promote_f32/locals.wat
@@ -0,0 +1,21 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        (local f32)  
+
+        (local.get 0)
+        (f64.promote_f32)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 f30f1044240c         	movss	xmm0, dword ptr [rsp + 0xc]
+;;   1b:	 f30f5ac0             	cvtss2sd	xmm0, xmm0
+;;   1f:	 4883c410             	add	rsp, 0x10
+;;   23:	 5d                   	pop	rbp
+;;   24:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_promote_f32/params.wat b/winch/filetests/filetests/x64/f64_promote_f32/params.wat
new file mode 100644
index 000000000..f8f2497ed
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_promote_f32/params.wat
@@ -0,0 +1,18 @@
+;;! target = "x86_64"
+
+(module
+    (func (param f32) (result f64)
+        (local.get 0)
+        (f64.promote_f32)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 f30f1144240c         	movss	dword ptr [rsp + 0xc], xmm0
+;;    e:	 4c893424             	mov	qword ptr [rsp], r14
+;;   12:	 f30f1044240c         	movss	xmm0, dword ptr [rsp + 0xc]
+;;   18:	 f30f5ac0             	cvtss2sd	xmm0, xmm0
+;;   1c:	 4883c410             	add	rsp, 0x10
+;;   20:	 5d                   	pop	rbp
+;;   21:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_promote_f32/spilled.wat b/winch/filetests/filetests/x64/f64_promote_f32/spilled.wat
new file mode 100644
index 000000000..ebac4b203
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_promote_f32/spilled.wat
@@ -0,0 +1,24 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        f32.const 1.0
+        f64.promote_f32
+        block
+        end
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 f30f10051c000000     	movss	xmm0, dword ptr [rip + 0x1c]
+;;   14:	 f30f5ac0             	cvtss2sd	xmm0, xmm0
+;;   18:	 4883ec08             	sub	rsp, 8
+;;   1c:	 f20f110424           	movsd	qword ptr [rsp], xmm0
+;;   21:	 f20f100424           	movsd	xmm0, qword ptr [rsp]
+;;   26:	 4883c408             	add	rsp, 8
+;;   2a:	 4883c408             	add	rsp, 8
+;;   2e:	 5d                   	pop	rbp
+;;   2f:	 c3                   	ret	
+;;   30:	 0000                 	add	byte ptr [rax], al
diff --git a/winch/filetests/filetests/x64/f64_reinterpret_i64/const.wat b/winch/filetests/filetests/x64/f64_reinterpret_i64/const.wat
new file mode 100644
index 000000000..4615a9fe2
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_reinterpret_i64/const.wat
@@ -0,0 +1,17 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        (i64.const 1)
+        (f64.reinterpret_i64)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 48c7c001000000       	mov	rax, 1
+;;   13:	 66480f6ec0           	movq	xmm0, rax
+;;   18:	 4883c408             	add	rsp, 8
+;;   1c:	 5d                   	pop	rbp
+;;   1d:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_reinterpret_i64/locals.wat b/winch/filetests/filetests/x64/f64_reinterpret_i64/locals.wat
new file mode 100644
index 000000000..af383e220
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_reinterpret_i64/locals.wat
@@ -0,0 +1,21 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        (local i64)  
+
+        (local.get 0)
+        (f64.reinterpret_i64)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 488b442408           	mov	rax, qword ptr [rsp + 8]
+;;   1a:	 66480f6ec0           	movq	xmm0, rax
+;;   1f:	 4883c410             	add	rsp, 0x10
+;;   23:	 5d                   	pop	rbp
+;;   24:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_reinterpret_i64/params.wat b/winch/filetests/filetests/x64/f64_reinterpret_i64/params.wat
new file mode 100644
index 000000000..b80a2ccc9
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_reinterpret_i64/params.wat
@@ -0,0 +1,18 @@
+;;! target = "x86_64"
+
+(module
+    (func (param i64) (result f64)
+        (local.get 0)
+        (f64.reinterpret_i64)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48897c2408           	mov	qword ptr [rsp + 8], rdi
+;;    d:	 4c893424             	mov	qword ptr [rsp], r14
+;;   11:	 488b442408           	mov	rax, qword ptr [rsp + 8]
+;;   16:	 66480f6ec0           	movq	xmm0, rax
+;;   1b:	 4883c410             	add	rsp, 0x10
+;;   1f:	 5d                   	pop	rbp
+;;   20:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_reinterpret_i64/ret_int.wat b/winch/filetests/filetests/x64/f64_reinterpret_i64/ret_int.wat
new file mode 100644
index 000000000..ef8e6230b
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_reinterpret_i64/ret_int.wat
@@ -0,0 +1,20 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i64)
+        i64.const 1
+        f64.reinterpret_i64
+        drop
+        i64.const 1
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 48c7c001000000       	mov	rax, 1
+;;   13:	 66480f6ec0           	movq	xmm0, rax
+;;   18:	 48c7c001000000       	mov	rax, 1
+;;   1f:	 4883c408             	add	rsp, 8
+;;   23:	 5d                   	pop	rbp
+;;   24:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/f64_reinterpret_i64/spilled.wat b/winch/filetests/filetests/x64/f64_reinterpret_i64/spilled.wat
new file mode 100644
index 000000000..1dd9880d8
--- /dev/null
+++ b/winch/filetests/filetests/x64/f64_reinterpret_i64/spilled.wat
@@ -0,0 +1,23 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        i64.const 1
+        f64.reinterpret_i64
+        block
+        end
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 48c7c001000000       	mov	rax, 1
+;;   13:	 66480f6ec0           	movq	xmm0, rax
+;;   18:	 4883ec08             	sub	rsp, 8
+;;   1c:	 f20f110424           	movsd	qword ptr [rsp], xmm0
+;;   21:	 f20f100424           	movsd	xmm0, qword ptr [rsp]
+;;   26:	 4883c408             	add	rsp, 8
+;;   2a:	 4883c408             	add	rsp, 8
+;;   2e:	 5d                   	pop	rbp
+;;   2f:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/i32_reinterpret_f32/const.wat b/winch/filetests/filetests/x64/i32_reinterpret_f32/const.wat
new file mode 100644
index 000000000..86f3842f0
--- /dev/null
+++ b/winch/filetests/filetests/x64/i32_reinterpret_f32/const.wat
@@ -0,0 +1,19 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i32)
+        (f32.const 1.0)
+        (i32.reinterpret_f32)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 f30f10050c000000     	movss	xmm0, dword ptr [rip + 0xc]
+;;   14:	 660f7ec0             	movd	eax, xmm0
+;;   18:	 4883c408             	add	rsp, 8
+;;   1c:	 5d                   	pop	rbp
+;;   1d:	 c3                   	ret	
+;;   1e:	 0000                 	add	byte ptr [rax], al
+;;   20:	 0000                 	add	byte ptr [rax], al
diff --git a/winch/filetests/filetests/x64/i32_reinterpret_f32/locals.wat b/winch/filetests/filetests/x64/i32_reinterpret_f32/locals.wat
new file mode 100644
index 000000000..9db5254c6
--- /dev/null
+++ b/winch/filetests/filetests/x64/i32_reinterpret_f32/locals.wat
@@ -0,0 +1,21 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i32)
+        (local f32)  
+
+        (local.get 0)
+        (i32.reinterpret_f32)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 f30f1044240c         	movss	xmm0, dword ptr [rsp + 0xc]
+;;   1b:	 660f7ec0             	movd	eax, xmm0
+;;   1f:	 4883c410             	add	rsp, 0x10
+;;   23:	 5d                   	pop	rbp
+;;   24:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/i32_reinterpret_f32/params.wat b/winch/filetests/filetests/x64/i32_reinterpret_f32/params.wat
new file mode 100644
index 000000000..bae68b19e
--- /dev/null
+++ b/winch/filetests/filetests/x64/i32_reinterpret_f32/params.wat
@@ -0,0 +1,18 @@
+;;! target = "x86_64"
+
+(module
+    (func (param f32) (result i32)
+        (local.get 0)
+        (i32.reinterpret_f32)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 f30f1144240c         	movss	dword ptr [rsp + 0xc], xmm0
+;;    e:	 4c893424             	mov	qword ptr [rsp], r14
+;;   12:	 f30f1044240c         	movss	xmm0, dword ptr [rsp + 0xc]
+;;   18:	 660f7ec0             	movd	eax, xmm0
+;;   1c:	 4883c410             	add	rsp, 0x10
+;;   20:	 5d                   	pop	rbp
+;;   21:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/i32_reinterpret_f32/ret_float.wat b/winch/filetests/filetests/x64/i32_reinterpret_f32/ret_float.wat
new file mode 100644
index 000000000..9fa09b73a
--- /dev/null
+++ b/winch/filetests/filetests/x64/i32_reinterpret_f32/ret_float.wat
@@ -0,0 +1,22 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f32)
+        f32.const 1.0
+        i32.reinterpret_f32
+        drop
+        f32.const 1.0
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 f30f100514000000     	movss	xmm0, dword ptr [rip + 0x14]
+;;   14:	 660f7ec0             	movd	eax, xmm0
+;;   18:	 f30f100508000000     	movss	xmm0, dword ptr [rip + 8]
+;;   20:	 4883c408             	add	rsp, 8
+;;   24:	 5d                   	pop	rbp
+;;   25:	 c3                   	ret	
+;;   26:	 0000                 	add	byte ptr [rax], al
+;;   28:	 0000                 	add	byte ptr [rax], al
diff --git a/winch/filetests/filetests/x64/i32_trunc_f32_s/const.wat b/winch/filetests/filetests/x64/i32_trunc_f32_s/const.wat
new file mode 100644
index 000000000..64052f39b
--- /dev/null
+++ b/winch/filetests/filetests/x64/i32_trunc_f32_s/const.wat
@@ -0,0 +1,35 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i32)
+        (f32.const 1.0)
+        (i32.trunc_f32_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 f30f10054c000000     	movss	xmm0, dword ptr [rip + 0x4c]
+;;   14:	 f30f2cc0             	cvttss2si	eax, xmm0
+;;   18:	 83f801               	cmp	eax, 1
+;;   1b:	 0f812d000000         	jno	0x4e
+;;   21:	 0f2ec0               	ucomiss	xmm0, xmm0
+;;   24:	 0f8a2a000000         	jp	0x54
+;;   2a:	 41bb000000cf         	mov	r11d, 0xcf000000
+;;   30:	 66450f6efb           	movd	xmm15, r11d
+;;   35:	 410f2ec7             	ucomiss	xmm0, xmm15
+;;   39:	 0f8217000000         	jb	0x56
+;;   3f:	 66450f57ff           	xorpd	xmm15, xmm15
+;;   44:	 440f2ef8             	ucomiss	xmm15, xmm0
+;;   48:	 0f820a000000         	jb	0x58
+;;   4e:	 4883c408             	add	rsp, 8
+;;   52:	 5d                   	pop	rbp
+;;   53:	 c3                   	ret	
+;;   54:	 0f0b                 	ud2	
+;;   56:	 0f0b                 	ud2	
+;;   58:	 0f0b                 	ud2	
+;;   5a:	 0000                 	add	byte ptr [rax], al
+;;   5c:	 0000                 	add	byte ptr [rax], al
+;;   5e:	 0000                 	add	byte ptr [rax], al
+;;   60:	 0000                 	add	byte ptr [rax], al
diff --git a/winch/filetests/filetests/x64/i32_trunc_f32_s/locals.wat b/winch/filetests/filetests/x64/i32_trunc_f32_s/locals.wat
new file mode 100644
index 000000000..f7a5695e3
--- /dev/null
+++ b/winch/filetests/filetests/x64/i32_trunc_f32_s/locals.wat
@@ -0,0 +1,35 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i32)
+        (local f32)  
+
+        (local.get 0)
+        (i32.trunc_f32_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 f30f1044240c         	movss	xmm0, dword ptr [rsp + 0xc]
+;;   1b:	 f30f2cc0             	cvttss2si	eax, xmm0
+;;   1f:	 83f801               	cmp	eax, 1
+;;   22:	 0f812d000000         	jno	0x55
+;;   28:	 0f2ec0               	ucomiss	xmm0, xmm0
+;;   2b:	 0f8a2a000000         	jp	0x5b
+;;   31:	 41bb000000cf         	mov	r11d, 0xcf000000
+;;   37:	 66450f6efb           	movd	xmm15, r11d
+;;   3c:	 410f2ec7             	ucomiss	xmm0, xmm15
+;;   40:	 0f8217000000         	jb	0x5d
+;;   46:	 66450f57ff           	xorpd	xmm15, xmm15
+;;   4b:	 440f2ef8             	ucomiss	xmm15, xmm0
+;;   4f:	 0f820a000000         	jb	0x5f
+;;   55:	 4883c410             	add	rsp, 0x10
+;;   59:	 5d                   	pop	rbp
+;;   5a:	 c3                   	ret	
+;;   5b:	 0f0b                 	ud2	
+;;   5d:	 0f0b                 	ud2	
+;;   5f:	 0f0b                 	ud2	
diff --git a/winch/filetests/filetests/x64/i32_trunc_f32_s/params.wat b/winch/filetests/filetests/x64/i32_trunc_f32_s/params.wat
new file mode 100644
index 000000000..c341e2258
--- /dev/null
+++ b/winch/filetests/filetests/x64/i32_trunc_f32_s/params.wat
@@ -0,0 +1,32 @@
+;;! target = "x86_64"
+
+(module
+    (func (param f32) (result i32)
+        (local.get 0)
+        (i32.trunc_f32_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 f30f1144240c         	movss	dword ptr [rsp + 0xc], xmm0
+;;    e:	 4c893424             	mov	qword ptr [rsp], r14
+;;   12:	 f30f1044240c         	movss	xmm0, dword ptr [rsp + 0xc]
+;;   18:	 f30f2cc0             	cvttss2si	eax, xmm0
+;;   1c:	 83f801               	cmp	eax, 1
+;;   1f:	 0f812d000000         	jno	0x52
+;;   25:	 0f2ec0               	ucomiss	xmm0, xmm0
+;;   28:	 0f8a2a000000         	jp	0x58
+;;   2e:	 41bb000000cf         	mov	r11d, 0xcf000000
+;;   34:	 66450f6efb           	movd	xmm15, r11d
+;;   39:	 410f2ec7             	ucomiss	xmm0, xmm15
+;;   3d:	 0f8217000000         	jb	0x5a
+;;   43:	 66450f57ff           	xorpd	xmm15, xmm15
+;;   48:	 440f2ef8             	ucomiss	xmm15, xmm0
+;;   4c:	 0f820a000000         	jb	0x5c
+;;   52:	 4883c410             	add	rsp, 0x10
+;;   56:	 5d                   	pop	rbp
+;;   57:	 c3                   	ret	
+;;   58:	 0f0b                 	ud2	
+;;   5a:	 0f0b                 	ud2	
+;;   5c:	 0f0b                 	ud2	
diff --git a/winch/filetests/filetests/x64/i32_trunc_f32_u/const.wat b/winch/filetests/filetests/x64/i32_trunc_f32_u/const.wat
new file mode 100644
index 000000000..25627158d
--- /dev/null
+++ b/winch/filetests/filetests/x64/i32_trunc_f32_u/const.wat
@@ -0,0 +1,36 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i32)
+        (f32.const 1.0)
+        (i32.trunc_f32_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 f30f100d54000000     	movss	xmm1, dword ptr [rip + 0x54]
+;;   14:	 41bb0000004f         	mov	r11d, 0x4f000000
+;;   1a:	 66450f6efb           	movd	xmm15, r11d
+;;   1f:	 410f2ecf             	ucomiss	xmm1, xmm15
+;;   23:	 0f8315000000         	jae	0x3e
+;;   29:	 0f8a30000000         	jp	0x5f
+;;   2f:	 f30f2cc1             	cvttss2si	eax, xmm1
+;;   33:	 83f800               	cmp	eax, 0
+;;   36:	 0f8d1d000000         	jge	0x59
+;;   3c:	 0f0b                 	ud2	
+;;   3e:	 0f28c1               	movaps	xmm0, xmm1
+;;   41:	 f3410f5cc7           	subss	xmm0, xmm15
+;;   46:	 f30f2cc0             	cvttss2si	eax, xmm0
+;;   4a:	 83f800               	cmp	eax, 0
+;;   4d:	 0f8c0e000000         	jl	0x61
+;;   53:	 81c000000080         	add	eax, 0x80000000
+;;   59:	 4883c408             	add	rsp, 8
+;;   5d:	 5d                   	pop	rbp
+;;   5e:	 c3                   	ret	
+;;   5f:	 0f0b                 	ud2	
+;;   61:	 0f0b                 	ud2	
+;;   63:	 0000                 	add	byte ptr [rax], al
+;;   65:	 0000                 	add	byte ptr [rax], al
+;;   67:	 0000                 	add	byte ptr [rax], al
diff --git a/winch/filetests/filetests/x64/i32_trunc_f32_u/locals.wat b/winch/filetests/filetests/x64/i32_trunc_f32_u/locals.wat
new file mode 100644
index 000000000..8083e4c91
--- /dev/null
+++ b/winch/filetests/filetests/x64/i32_trunc_f32_u/locals.wat
@@ -0,0 +1,37 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i32)
+        (local f32)  
+
+        (local.get 0)
+        (i32.trunc_f32_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 f30f104c240c         	movss	xmm1, dword ptr [rsp + 0xc]
+;;   1b:	 41bb0000004f         	mov	r11d, 0x4f000000
+;;   21:	 66450f6efb           	movd	xmm15, r11d
+;;   26:	 410f2ecf             	ucomiss	xmm1, xmm15
+;;   2a:	 0f8315000000         	jae	0x45
+;;   30:	 0f8a30000000         	jp	0x66
+;;   36:	 f30f2cc1             	cvttss2si	eax, xmm1
+;;   3a:	 83f800               	cmp	eax, 0
+;;   3d:	 0f8d1d000000         	jge	0x60
+;;   43:	 0f0b                 	ud2	
+;;   45:	 0f28c1               	movaps	xmm0, xmm1
+;;   48:	 f3410f5cc7           	subss	xmm0, xmm15
+;;   4d:	 f30f2cc0             	cvttss2si	eax, xmm0
+;;   51:	 83f800               	cmp	eax, 0
+;;   54:	 0f8c0e000000         	jl	0x68
+;;   5a:	 81c000000080         	add	eax, 0x80000000
+;;   60:	 4883c410             	add	rsp, 0x10
+;;   64:	 5d                   	pop	rbp
+;;   65:	 c3                   	ret	
+;;   66:	 0f0b                 	ud2	
+;;   68:	 0f0b                 	ud2	
diff --git a/winch/filetests/filetests/x64/i32_trunc_f32_u/params.wat b/winch/filetests/filetests/x64/i32_trunc_f32_u/params.wat
new file mode 100644
index 000000000..0833b2105
--- /dev/null
+++ b/winch/filetests/filetests/x64/i32_trunc_f32_u/params.wat
@@ -0,0 +1,34 @@
+;;! target = "x86_64"
+
+(module
+    (func (param f32) (result i32)
+        (local.get 0)
+        (i32.trunc_f32_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 f30f1144240c         	movss	dword ptr [rsp + 0xc], xmm0
+;;    e:	 4c893424             	mov	qword ptr [rsp], r14
+;;   12:	 f30f104c240c         	movss	xmm1, dword ptr [rsp + 0xc]
+;;   18:	 41bb0000004f         	mov	r11d, 0x4f000000
+;;   1e:	 66450f6efb           	movd	xmm15, r11d
+;;   23:	 410f2ecf             	ucomiss	xmm1, xmm15
+;;   27:	 0f8315000000         	jae	0x42
+;;   2d:	 0f8a30000000         	jp	0x63
+;;   33:	 f30f2cc1             	cvttss2si	eax, xmm1
+;;   37:	 83f800               	cmp	eax, 0
+;;   3a:	 0f8d1d000000         	jge	0x5d
+;;   40:	 0f0b                 	ud2	
+;;   42:	 0f28c1               	movaps	xmm0, xmm1
+;;   45:	 f3410f5cc7           	subss	xmm0, xmm15
+;;   4a:	 f30f2cc0             	cvttss2si	eax, xmm0
+;;   4e:	 83f800               	cmp	eax, 0
+;;   51:	 0f8c0e000000         	jl	0x65
+;;   57:	 81c000000080         	add	eax, 0x80000000
+;;   5d:	 4883c410             	add	rsp, 0x10
+;;   61:	 5d                   	pop	rbp
+;;   62:	 c3                   	ret	
+;;   63:	 0f0b                 	ud2	
+;;   65:	 0f0b                 	ud2	
diff --git a/winch/filetests/filetests/x64/i32_trunc_f64_s/const.wat b/winch/filetests/filetests/x64/i32_trunc_f64_s/const.wat
new file mode 100644
index 000000000..82ccb701c
--- /dev/null
+++ b/winch/filetests/filetests/x64/i32_trunc_f64_s/const.wat
@@ -0,0 +1,39 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i32)
+        (f64.const 1.0)
+        (i32.trunc_f64_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 f20f100554000000     	movsd	xmm0, qword ptr [rip + 0x54]
+;;   14:	 f20f2cc0             	cvttsd2si	eax, xmm0
+;;   18:	 83f801               	cmp	eax, 1
+;;   1b:	 0f8134000000         	jno	0x55
+;;   21:	 660f2ec0             	ucomisd	xmm0, xmm0
+;;   25:	 0f8a30000000         	jp	0x5b
+;;   2b:	 49bb000020000000e0c1 	
+;; 				movabs	r11, 0xc1e0000000200000
+;;   35:	 664d0f6efb           	movq	xmm15, r11
+;;   3a:	 66410f2ec7           	ucomisd	xmm0, xmm15
+;;   3f:	 0f8618000000         	jbe	0x5d
+;;   45:	 66450f57ff           	xorpd	xmm15, xmm15
+;;   4a:	 66440f2ef8           	ucomisd	xmm15, xmm0
+;;   4f:	 0f820a000000         	jb	0x5f
+;;   55:	 4883c408             	add	rsp, 8
+;;   59:	 5d                   	pop	rbp
+;;   5a:	 c3                   	ret	
+;;   5b:	 0f0b                 	ud2	
+;;   5d:	 0f0b                 	ud2	
+;;   5f:	 0f0b                 	ud2	
+;;   61:	 0000                 	add	byte ptr [rax], al
+;;   63:	 0000                 	add	byte ptr [rax], al
+;;   65:	 0000                 	add	byte ptr [rax], al
+;;   67:	 0000                 	add	byte ptr [rax], al
+;;   69:	 0000                 	add	byte ptr [rax], al
+;;   6b:	 0000                 	add	byte ptr [rax], al
+;;   6d:	 00f0                 	add	al, dh
diff --git a/winch/filetests/filetests/x64/i32_trunc_f64_s/locals.wat b/winch/filetests/filetests/x64/i32_trunc_f64_s/locals.wat
new file mode 100644
index 000000000..2046668bb
--- /dev/null
+++ b/winch/filetests/filetests/x64/i32_trunc_f64_s/locals.wat
@@ -0,0 +1,36 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i32)
+        (local f64)  
+
+        (local.get 0)
+        (i32.trunc_f64_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 f20f10442408         	movsd	xmm0, qword ptr [rsp + 8]
+;;   1b:	 f20f2cc0             	cvttsd2si	eax, xmm0
+;;   1f:	 83f801               	cmp	eax, 1
+;;   22:	 0f8134000000         	jno	0x5c
+;;   28:	 660f2ec0             	ucomisd	xmm0, xmm0
+;;   2c:	 0f8a30000000         	jp	0x62
+;;   32:	 49bb000020000000e0c1 	
+;; 				movabs	r11, 0xc1e0000000200000
+;;   3c:	 664d0f6efb           	movq	xmm15, r11
+;;   41:	 66410f2ec7           	ucomisd	xmm0, xmm15
+;;   46:	 0f8618000000         	jbe	0x64
+;;   4c:	 66450f57ff           	xorpd	xmm15, xmm15
+;;   51:	 66440f2ef8           	ucomisd	xmm15, xmm0
+;;   56:	 0f820a000000         	jb	0x66
+;;   5c:	 4883c410             	add	rsp, 0x10
+;;   60:	 5d                   	pop	rbp
+;;   61:	 c3                   	ret	
+;;   62:	 0f0b                 	ud2	
+;;   64:	 0f0b                 	ud2	
+;;   66:	 0f0b                 	ud2	
diff --git a/winch/filetests/filetests/x64/i32_trunc_f64_s/params.wat b/winch/filetests/filetests/x64/i32_trunc_f64_s/params.wat
new file mode 100644
index 000000000..a9d6bd9d8
--- /dev/null
+++ b/winch/filetests/filetests/x64/i32_trunc_f64_s/params.wat
@@ -0,0 +1,33 @@
+;;! target = "x86_64"
+
+(module
+    (func (param f64) (result i32)
+        (local.get 0)
+        (i32.trunc_f64_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 f20f11442408         	movsd	qword ptr [rsp + 8], xmm0
+;;    e:	 4c893424             	mov	qword ptr [rsp], r14
+;;   12:	 f20f10442408         	movsd	xmm0, qword ptr [rsp + 8]
+;;   18:	 f20f2cc0             	cvttsd2si	eax, xmm0
+;;   1c:	 83f801               	cmp	eax, 1
+;;   1f:	 0f8134000000         	jno	0x59
+;;   25:	 660f2ec0             	ucomisd	xmm0, xmm0
+;;   29:	 0f8a30000000         	jp	0x5f
+;;   2f:	 49bb000020000000e0c1 	
+;; 				movabs	r11, 0xc1e0000000200000
+;;   39:	 664d0f6efb           	movq	xmm15, r11
+;;   3e:	 66410f2ec7           	ucomisd	xmm0, xmm15
+;;   43:	 0f8618000000         	jbe	0x61
+;;   49:	 66450f57ff           	xorpd	xmm15, xmm15
+;;   4e:	 66440f2ef8           	ucomisd	xmm15, xmm0
+;;   53:	 0f820a000000         	jb	0x63
+;;   59:	 4883c410             	add	rsp, 0x10
+;;   5d:	 5d                   	pop	rbp
+;;   5e:	 c3                   	ret	
+;;   5f:	 0f0b                 	ud2	
+;;   61:	 0f0b                 	ud2	
+;;   63:	 0f0b                 	ud2	
diff --git a/winch/filetests/filetests/x64/i32_trunc_f64_u/const.wat b/winch/filetests/filetests/x64/i32_trunc_f64_u/const.wat
new file mode 100644
index 000000000..3daaaa4d6
--- /dev/null
+++ b/winch/filetests/filetests/x64/i32_trunc_f64_u/const.wat
@@ -0,0 +1,37 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i32)
+        (f64.const 1.0)
+        (i32.trunc_f64_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 f20f100d54000000     	movsd	xmm1, qword ptr [rip + 0x54]
+;;   14:	 49bb000000000000e041 	
+;; 				movabs	r11, 0x41e0000000000000
+;;   1e:	 664d0f6efb           	movq	xmm15, r11
+;;   23:	 66410f2ecf           	ucomisd	xmm1, xmm15
+;;   28:	 0f8315000000         	jae	0x43
+;;   2e:	 0f8a30000000         	jp	0x64
+;;   34:	 f20f2cc1             	cvttsd2si	eax, xmm1
+;;   38:	 83f800               	cmp	eax, 0
+;;   3b:	 0f8d1d000000         	jge	0x5e
+;;   41:	 0f0b                 	ud2	
+;;   43:	 0f28c1               	movaps	xmm0, xmm1
+;;   46:	 f2410f5cc7           	subsd	xmm0, xmm15
+;;   4b:	 f20f2cc0             	cvttsd2si	eax, xmm0
+;;   4f:	 83f800               	cmp	eax, 0
+;;   52:	 0f8c0e000000         	jl	0x66
+;;   58:	 81c000000080         	add	eax, 0x80000000
+;;   5e:	 4883c408             	add	rsp, 8
+;;   62:	 5d                   	pop	rbp
+;;   63:	 c3                   	ret	
+;;   64:	 0f0b                 	ud2	
+;;   66:	 0f0b                 	ud2	
+;;   68:	 0000                 	add	byte ptr [rax], al
+;;   6a:	 0000                 	add	byte ptr [rax], al
+;;   6c:	 0000                 	add	byte ptr [rax], al
diff --git a/winch/filetests/filetests/x64/i32_trunc_f64_u/locals.wat b/winch/filetests/filetests/x64/i32_trunc_f64_u/locals.wat
new file mode 100644
index 000000000..787f9280f
--- /dev/null
+++ b/winch/filetests/filetests/x64/i32_trunc_f64_u/locals.wat
@@ -0,0 +1,38 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i32)
+        (local f64)  
+
+        (local.get 0)
+        (i32.trunc_f64_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 f20f104c2408         	movsd	xmm1, qword ptr [rsp + 8]
+;;   1b:	 49bb000000000000e041 	
+;; 				movabs	r11, 0x41e0000000000000
+;;   25:	 664d0f6efb           	movq	xmm15, r11
+;;   2a:	 66410f2ecf           	ucomisd	xmm1, xmm15
+;;   2f:	 0f8315000000         	jae	0x4a
+;;   35:	 0f8a30000000         	jp	0x6b
+;;   3b:	 f20f2cc1             	cvttsd2si	eax, xmm1
+;;   3f:	 83f800               	cmp	eax, 0
+;;   42:	 0f8d1d000000         	jge	0x65
+;;   48:	 0f0b                 	ud2	
+;;   4a:	 0f28c1               	movaps	xmm0, xmm1
+;;   4d:	 f2410f5cc7           	subsd	xmm0, xmm15
+;;   52:	 f20f2cc0             	cvttsd2si	eax, xmm0
+;;   56:	 83f800               	cmp	eax, 0
+;;   59:	 0f8c0e000000         	jl	0x6d
+;;   5f:	 81c000000080         	add	eax, 0x80000000
+;;   65:	 4883c410             	add	rsp, 0x10
+;;   69:	 5d                   	pop	rbp
+;;   6a:	 c3                   	ret	
+;;   6b:	 0f0b                 	ud2	
+;;   6d:	 0f0b                 	ud2	
diff --git a/winch/filetests/filetests/x64/i32_trunc_f64_u/params.wat b/winch/filetests/filetests/x64/i32_trunc_f64_u/params.wat
new file mode 100644
index 000000000..d4ff42767
--- /dev/null
+++ b/winch/filetests/filetests/x64/i32_trunc_f64_u/params.wat
@@ -0,0 +1,35 @@
+;;! target = "x86_64"
+
+(module
+    (func (param f64) (result i32)
+        (local.get 0)
+        (i32.trunc_f64_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 f20f11442408         	movsd	qword ptr [rsp + 8], xmm0
+;;    e:	 4c893424             	mov	qword ptr [rsp], r14
+;;   12:	 f20f104c2408         	movsd	xmm1, qword ptr [rsp + 8]
+;;   18:	 49bb000000000000e041 	
+;; 				movabs	r11, 0x41e0000000000000
+;;   22:	 664d0f6efb           	movq	xmm15, r11
+;;   27:	 66410f2ecf           	ucomisd	xmm1, xmm15
+;;   2c:	 0f8315000000         	jae	0x47
+;;   32:	 0f8a30000000         	jp	0x68
+;;   38:	 f20f2cc1             	cvttsd2si	eax, xmm1
+;;   3c:	 83f800               	cmp	eax, 0
+;;   3f:	 0f8d1d000000         	jge	0x62
+;;   45:	 0f0b                 	ud2	
+;;   47:	 0f28c1               	movaps	xmm0, xmm1
+;;   4a:	 f2410f5cc7           	subsd	xmm0, xmm15
+;;   4f:	 f20f2cc0             	cvttsd2si	eax, xmm0
+;;   53:	 83f800               	cmp	eax, 0
+;;   56:	 0f8c0e000000         	jl	0x6a
+;;   5c:	 81c000000080         	add	eax, 0x80000000
+;;   62:	 4883c410             	add	rsp, 0x10
+;;   66:	 5d                   	pop	rbp
+;;   67:	 c3                   	ret	
+;;   68:	 0f0b                 	ud2	
+;;   6a:	 0f0b                 	ud2	
diff --git a/winch/filetests/filetests/x64/i64_reinterpret_f64/const.wat b/winch/filetests/filetests/x64/i64_reinterpret_f64/const.wat
new file mode 100644
index 000000000..2367c9886
--- /dev/null
+++ b/winch/filetests/filetests/x64/i64_reinterpret_f64/const.wat
@@ -0,0 +1,21 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i64)
+        (f64.const 1.0)
+        (i64.reinterpret_f64)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 f20f10050c000000     	movsd	xmm0, qword ptr [rip + 0xc]
+;;   14:	 66480f7ec0           	movq	rax, xmm0
+;;   19:	 4883c408             	add	rsp, 8
+;;   1d:	 5d                   	pop	rbp
+;;   1e:	 c3                   	ret	
+;;   1f:	 0000                 	add	byte ptr [rax], al
+;;   21:	 0000                 	add	byte ptr [rax], al
+;;   23:	 0000                 	add	byte ptr [rax], al
+;;   25:	 00f0                 	add	al, dh
diff --git a/winch/filetests/filetests/x64/i64_reinterpret_f64/locals.wat b/winch/filetests/filetests/x64/i64_reinterpret_f64/locals.wat
new file mode 100644
index 000000000..36a563864
--- /dev/null
+++ b/winch/filetests/filetests/x64/i64_reinterpret_f64/locals.wat
@@ -0,0 +1,21 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i64)
+        (local f64)  
+
+        (local.get 0)
+        (i64.reinterpret_f64)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 f20f10442408         	movsd	xmm0, qword ptr [rsp + 8]
+;;   1b:	 66480f7ec0           	movq	rax, xmm0
+;;   20:	 4883c410             	add	rsp, 0x10
+;;   24:	 5d                   	pop	rbp
+;;   25:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/i64_reinterpret_f64/params.wat b/winch/filetests/filetests/x64/i64_reinterpret_f64/params.wat
new file mode 100644
index 000000000..f67dbbeda
--- /dev/null
+++ b/winch/filetests/filetests/x64/i64_reinterpret_f64/params.wat
@@ -0,0 +1,18 @@
+;;! target = "x86_64"
+
+(module
+    (func (param f64) (result i64)
+        (local.get 0)
+        (i64.reinterpret_f64)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 f20f11442408         	movsd	qword ptr [rsp + 8], xmm0
+;;    e:	 4c893424             	mov	qword ptr [rsp], r14
+;;   12:	 f20f10442408         	movsd	xmm0, qword ptr [rsp + 8]
+;;   18:	 66480f7ec0           	movq	rax, xmm0
+;;   1d:	 4883c410             	add	rsp, 0x10
+;;   21:	 5d                   	pop	rbp
+;;   22:	 c3                   	ret	
diff --git a/winch/filetests/filetests/x64/i64_reinterpret_f64/ret_float.wat b/winch/filetests/filetests/x64/i64_reinterpret_f64/ret_float.wat
new file mode 100644
index 000000000..d56f3759c
--- /dev/null
+++ b/winch/filetests/filetests/x64/i64_reinterpret_f64/ret_float.wat
@@ -0,0 +1,24 @@
+;;! target = "x86_64"
+
+(module
+    (func (result f64)
+        f64.const 1.0
+        i64.reinterpret_f64
+        drop
+        f64.const 1.0
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 f20f100514000000     	movsd	xmm0, qword ptr [rip + 0x14]
+;;   14:	 66480f7ec0           	movq	rax, xmm0
+;;   19:	 f20f100507000000     	movsd	xmm0, qword ptr [rip + 7]
+;;   21:	 4883c408             	add	rsp, 8
+;;   25:	 5d                   	pop	rbp
+;;   26:	 c3                   	ret	
+;;   27:	 0000                 	add	byte ptr [rax], al
+;;   29:	 0000                 	add	byte ptr [rax], al
+;;   2b:	 0000                 	add	byte ptr [rax], al
+;;   2d:	 00f0                 	add	al, dh
diff --git a/winch/filetests/filetests/x64/i64_trunc_f32_s/const.wat b/winch/filetests/filetests/x64/i64_trunc_f32_s/const.wat
new file mode 100644
index 000000000..0f628f14e
--- /dev/null
+++ b/winch/filetests/filetests/x64/i64_trunc_f32_s/const.wat
@@ -0,0 +1,34 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i64)
+        (f32.const 1.0)
+        (i64.trunc_f32_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 f30f10054c000000     	movss	xmm0, dword ptr [rip + 0x4c]
+;;   14:	 f3480f2cc0           	cvttss2si	rax, xmm0
+;;   19:	 4883f801             	cmp	rax, 1
+;;   1d:	 0f812d000000         	jno	0x50
+;;   23:	 0f2ec0               	ucomiss	xmm0, xmm0
+;;   26:	 0f8a2a000000         	jp	0x56
+;;   2c:	 41bb000000df         	mov	r11d, 0xdf000000
+;;   32:	 66450f6efb           	movd	xmm15, r11d
+;;   37:	 410f2ec7             	ucomiss	xmm0, xmm15
+;;   3b:	 0f8217000000         	jb	0x58
+;;   41:	 66450f57ff           	xorpd	xmm15, xmm15
+;;   46:	 440f2ef8             	ucomiss	xmm15, xmm0
+;;   4a:	 0f820a000000         	jb	0x5a
+;;   50:	 4883c408             	add	rsp, 8
+;;   54:	 5d                   	pop	rbp
+;;   55:	 c3                   	ret	
+;;   56:	 0f0b                 	ud2	
+;;   58:	 0f0b                 	ud2	
+;;   5a:	 0f0b                 	ud2	
+;;   5c:	 0000                 	add	byte ptr [rax], al
+;;   5e:	 0000                 	add	byte ptr [rax], al
+;;   60:	 0000                 	add	byte ptr [rax], al
diff --git a/winch/filetests/filetests/x64/i64_trunc_f32_s/locals.wat b/winch/filetests/filetests/x64/i64_trunc_f32_s/locals.wat
new file mode 100644
index 000000000..942cbce64
--- /dev/null
+++ b/winch/filetests/filetests/x64/i64_trunc_f32_s/locals.wat
@@ -0,0 +1,35 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i64)
+        (local f32)  
+
+        (local.get 0)
+        (i64.trunc_f32_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 f30f1044240c         	movss	xmm0, dword ptr [rsp + 0xc]
+;;   1b:	 f3480f2cc0           	cvttss2si	rax, xmm0
+;;   20:	 4883f801             	cmp	rax, 1
+;;   24:	 0f812d000000         	jno	0x57
+;;   2a:	 0f2ec0               	ucomiss	xmm0, xmm0
+;;   2d:	 0f8a2a000000         	jp	0x5d
+;;   33:	 41bb000000df         	mov	r11d, 0xdf000000
+;;   39:	 66450f6efb           	movd	xmm15, r11d
+;;   3e:	 410f2ec7             	ucomiss	xmm0, xmm15
+;;   42:	 0f8217000000         	jb	0x5f
+;;   48:	 66450f57ff           	xorpd	xmm15, xmm15
+;;   4d:	 440f2ef8             	ucomiss	xmm15, xmm0
+;;   51:	 0f820a000000         	jb	0x61
+;;   57:	 4883c410             	add	rsp, 0x10
+;;   5b:	 5d                   	pop	rbp
+;;   5c:	 c3                   	ret	
+;;   5d:	 0f0b                 	ud2	
+;;   5f:	 0f0b                 	ud2	
+;;   61:	 0f0b                 	ud2	
diff --git a/winch/filetests/filetests/x64/i64_trunc_f32_s/params.wat b/winch/filetests/filetests/x64/i64_trunc_f32_s/params.wat
new file mode 100644
index 000000000..15b3174a8
--- /dev/null
+++ b/winch/filetests/filetests/x64/i64_trunc_f32_s/params.wat
@@ -0,0 +1,32 @@
+;;! target = "x86_64"
+
+(module
+    (func (param f32) (result i64)
+        (local.get 0)
+        (i64.trunc_f32_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 f30f1144240c         	movss	dword ptr [rsp + 0xc], xmm0
+;;    e:	 4c893424             	mov	qword ptr [rsp], r14
+;;   12:	 f30f1044240c         	movss	xmm0, dword ptr [rsp + 0xc]
+;;   18:	 f3480f2cc0           	cvttss2si	rax, xmm0
+;;   1d:	 4883f801             	cmp	rax, 1
+;;   21:	 0f812d000000         	jno	0x54
+;;   27:	 0f2ec0               	ucomiss	xmm0, xmm0
+;;   2a:	 0f8a2a000000         	jp	0x5a
+;;   30:	 41bb000000df         	mov	r11d, 0xdf000000
+;;   36:	 66450f6efb           	movd	xmm15, r11d
+;;   3b:	 410f2ec7             	ucomiss	xmm0, xmm15
+;;   3f:	 0f8217000000         	jb	0x5c
+;;   45:	 66450f57ff           	xorpd	xmm15, xmm15
+;;   4a:	 440f2ef8             	ucomiss	xmm15, xmm0
+;;   4e:	 0f820a000000         	jb	0x5e
+;;   54:	 4883c410             	add	rsp, 0x10
+;;   58:	 5d                   	pop	rbp
+;;   59:	 c3                   	ret	
+;;   5a:	 0f0b                 	ud2	
+;;   5c:	 0f0b                 	ud2	
+;;   5e:	 0f0b                 	ud2	
diff --git a/winch/filetests/filetests/x64/i64_trunc_f32_u/const.wat b/winch/filetests/filetests/x64/i64_trunc_f32_u/const.wat
new file mode 100644
index 000000000..1b11ddad8
--- /dev/null
+++ b/winch/filetests/filetests/x64/i64_trunc_f32_u/const.wat
@@ -0,0 +1,37 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i64)
+        (f32.const 1.0)
+        (i64.trunc_f32_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 f30f100d5c000000     	movss	xmm1, dword ptr [rip + 0x5c]
+;;   14:	 41bb0000005f         	mov	r11d, 0x5f000000
+;;   1a:	 66450f6efb           	movd	xmm15, r11d
+;;   1f:	 410f2ecf             	ucomiss	xmm1, xmm15
+;;   23:	 0f8317000000         	jae	0x40
+;;   29:	 0f8a3b000000         	jp	0x6a
+;;   2f:	 f3480f2cc1           	cvttss2si	rax, xmm1
+;;   34:	 4883f800             	cmp	rax, 0
+;;   38:	 0f8d26000000         	jge	0x64
+;;   3e:	 0f0b                 	ud2	
+;;   40:	 0f28c1               	movaps	xmm0, xmm1
+;;   43:	 f3410f5cc7           	subss	xmm0, xmm15
+;;   48:	 f3480f2cc0           	cvttss2si	rax, xmm0
+;;   4d:	 4883f800             	cmp	rax, 0
+;;   51:	 0f8c15000000         	jl	0x6c
+;;   57:	 49bb0000000000000080 	
+;; 				movabs	r11, 0x8000000000000000
+;;   61:	 4c01d8               	add	rax, r11
+;;   64:	 4883c408             	add	rsp, 8
+;;   68:	 5d                   	pop	rbp
+;;   69:	 c3                   	ret	
+;;   6a:	 0f0b                 	ud2	
+;;   6c:	 0f0b                 	ud2	
+;;   6e:	 0000                 	add	byte ptr [rax], al
+;;   70:	 0000                 	add	byte ptr [rax], al
diff --git a/winch/filetests/filetests/x64/i64_trunc_f32_u/locals.wat b/winch/filetests/filetests/x64/i64_trunc_f32_u/locals.wat
new file mode 100644
index 000000000..c8bd1df5c
--- /dev/null
+++ b/winch/filetests/filetests/x64/i64_trunc_f32_u/locals.wat
@@ -0,0 +1,39 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i64)
+        (local f32)  
+
+        (local.get 0)
+        (i64.trunc_f32_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 f30f104c240c         	movss	xmm1, dword ptr [rsp + 0xc]
+;;   1b:	 41bb0000005f         	mov	r11d, 0x5f000000
+;;   21:	 66450f6efb           	movd	xmm15, r11d
+;;   26:	 410f2ecf             	ucomiss	xmm1, xmm15
+;;   2a:	 0f8317000000         	jae	0x47
+;;   30:	 0f8a3b000000         	jp	0x71
+;;   36:	 f3480f2cc1           	cvttss2si	rax, xmm1
+;;   3b:	 4883f800             	cmp	rax, 0
+;;   3f:	 0f8d26000000         	jge	0x6b
+;;   45:	 0f0b                 	ud2	
+;;   47:	 0f28c1               	movaps	xmm0, xmm1
+;;   4a:	 f3410f5cc7           	subss	xmm0, xmm15
+;;   4f:	 f3480f2cc0           	cvttss2si	rax, xmm0
+;;   54:	 4883f800             	cmp	rax, 0
+;;   58:	 0f8c15000000         	jl	0x73
+;;   5e:	 49bb0000000000000080 	
+;; 				movabs	r11, 0x8000000000000000
+;;   68:	 4c01d8               	add	rax, r11
+;;   6b:	 4883c410             	add	rsp, 0x10
+;;   6f:	 5d                   	pop	rbp
+;;   70:	 c3                   	ret	
+;;   71:	 0f0b                 	ud2	
+;;   73:	 0f0b                 	ud2	
diff --git a/winch/filetests/filetests/x64/i64_trunc_f32_u/params.wat b/winch/filetests/filetests/x64/i64_trunc_f32_u/params.wat
new file mode 100644
index 000000000..39db180d5
--- /dev/null
+++ b/winch/filetests/filetests/x64/i64_trunc_f32_u/params.wat
@@ -0,0 +1,36 @@
+;;! target = "x86_64"
+
+(module
+    (func (param f32) (result i64)
+        (local.get 0)
+        (i64.trunc_f32_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 f30f1144240c         	movss	dword ptr [rsp + 0xc], xmm0
+;;    e:	 4c893424             	mov	qword ptr [rsp], r14
+;;   12:	 f30f104c240c         	movss	xmm1, dword ptr [rsp + 0xc]
+;;   18:	 41bb0000005f         	mov	r11d, 0x5f000000
+;;   1e:	 66450f6efb           	movd	xmm15, r11d
+;;   23:	 410f2ecf             	ucomiss	xmm1, xmm15
+;;   27:	 0f8317000000         	jae	0x44
+;;   2d:	 0f8a3b000000         	jp	0x6e
+;;   33:	 f3480f2cc1           	cvttss2si	rax, xmm1
+;;   38:	 4883f800             	cmp	rax, 0
+;;   3c:	 0f8d26000000         	jge	0x68
+;;   42:	 0f0b                 	ud2	
+;;   44:	 0f28c1               	movaps	xmm0, xmm1
+;;   47:	 f3410f5cc7           	subss	xmm0, xmm15
+;;   4c:	 f3480f2cc0           	cvttss2si	rax, xmm0
+;;   51:	 4883f800             	cmp	rax, 0
+;;   55:	 0f8c15000000         	jl	0x70
+;;   5b:	 49bb0000000000000080 	
+;; 				movabs	r11, 0x8000000000000000
+;;   65:	 4c01d8               	add	rax, r11
+;;   68:	 4883c410             	add	rsp, 0x10
+;;   6c:	 5d                   	pop	rbp
+;;   6d:	 c3                   	ret	
+;;   6e:	 0f0b                 	ud2	
+;;   70:	 0f0b                 	ud2	
diff --git a/winch/filetests/filetests/x64/i64_trunc_f64_s/const.wat b/winch/filetests/filetests/x64/i64_trunc_f64_s/const.wat
new file mode 100644
index 000000000..cfdc0906b
--- /dev/null
+++ b/winch/filetests/filetests/x64/i64_trunc_f64_s/const.wat
@@ -0,0 +1,38 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i64)
+        (f64.const 1.0)
+        (i64.trunc_f64_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 f20f100554000000     	movsd	xmm0, qword ptr [rip + 0x54]
+;;   14:	 f2480f2cc0           	cvttsd2si	rax, xmm0
+;;   19:	 4883f801             	cmp	rax, 1
+;;   1d:	 0f8134000000         	jno	0x57
+;;   23:	 660f2ec0             	ucomisd	xmm0, xmm0
+;;   27:	 0f8a30000000         	jp	0x5d
+;;   2d:	 49bb000000000000e0c3 	
+;; 				movabs	r11, 0xc3e0000000000000
+;;   37:	 664d0f6efb           	movq	xmm15, r11
+;;   3c:	 66410f2ec7           	ucomisd	xmm0, xmm15
+;;   41:	 0f8218000000         	jb	0x5f
+;;   47:	 66450f57ff           	xorpd	xmm15, xmm15
+;;   4c:	 66440f2ef8           	ucomisd	xmm15, xmm0
+;;   51:	 0f820a000000         	jb	0x61
+;;   57:	 4883c408             	add	rsp, 8
+;;   5b:	 5d                   	pop	rbp
+;;   5c:	 c3                   	ret	
+;;   5d:	 0f0b                 	ud2	
+;;   5f:	 0f0b                 	ud2	
+;;   61:	 0f0b                 	ud2	
+;;   63:	 0000                 	add	byte ptr [rax], al
+;;   65:	 0000                 	add	byte ptr [rax], al
+;;   67:	 0000                 	add	byte ptr [rax], al
+;;   69:	 0000                 	add	byte ptr [rax], al
+;;   6b:	 0000                 	add	byte ptr [rax], al
+;;   6d:	 00f0                 	add	al, dh
diff --git a/winch/filetests/filetests/x64/i64_trunc_f64_s/locals.wat b/winch/filetests/filetests/x64/i64_trunc_f64_s/locals.wat
new file mode 100644
index 000000000..9d76842d2
--- /dev/null
+++ b/winch/filetests/filetests/x64/i64_trunc_f64_s/locals.wat
@@ -0,0 +1,36 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i64)
+        (local f64)  
+
+        (local.get 0)
+        (i64.trunc_f64_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 f20f10442408         	movsd	xmm0, qword ptr [rsp + 8]
+;;   1b:	 f2480f2cc0           	cvttsd2si	rax, xmm0
+;;   20:	 4883f801             	cmp	rax, 1
+;;   24:	 0f8134000000         	jno	0x5e
+;;   2a:	 660f2ec0             	ucomisd	xmm0, xmm0
+;;   2e:	 0f8a30000000         	jp	0x64
+;;   34:	 49bb000000000000e0c3 	
+;; 				movabs	r11, 0xc3e0000000000000
+;;   3e:	 664d0f6efb           	movq	xmm15, r11
+;;   43:	 66410f2ec7           	ucomisd	xmm0, xmm15
+;;   48:	 0f8218000000         	jb	0x66
+;;   4e:	 66450f57ff           	xorpd	xmm15, xmm15
+;;   53:	 66440f2ef8           	ucomisd	xmm15, xmm0
+;;   58:	 0f820a000000         	jb	0x68
+;;   5e:	 4883c410             	add	rsp, 0x10
+;;   62:	 5d                   	pop	rbp
+;;   63:	 c3                   	ret	
+;;   64:	 0f0b                 	ud2	
+;;   66:	 0f0b                 	ud2	
+;;   68:	 0f0b                 	ud2	
diff --git a/winch/filetests/filetests/x64/i64_trunc_f64_s/params.wat b/winch/filetests/filetests/x64/i64_trunc_f64_s/params.wat
new file mode 100644
index 000000000..b8bc6e3a7
--- /dev/null
+++ b/winch/filetests/filetests/x64/i64_trunc_f64_s/params.wat
@@ -0,0 +1,33 @@
+;;! target = "x86_64"
+
+(module
+    (func (param f64) (result i64)
+        (local.get 0)
+        (i64.trunc_f64_s)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 f20f11442408         	movsd	qword ptr [rsp + 8], xmm0
+;;    e:	 4c893424             	mov	qword ptr [rsp], r14
+;;   12:	 f20f10442408         	movsd	xmm0, qword ptr [rsp + 8]
+;;   18:	 f2480f2cc0           	cvttsd2si	rax, xmm0
+;;   1d:	 4883f801             	cmp	rax, 1
+;;   21:	 0f8134000000         	jno	0x5b
+;;   27:	 660f2ec0             	ucomisd	xmm0, xmm0
+;;   2b:	 0f8a30000000         	jp	0x61
+;;   31:	 49bb000000000000e0c3 	
+;; 				movabs	r11, 0xc3e0000000000000
+;;   3b:	 664d0f6efb           	movq	xmm15, r11
+;;   40:	 66410f2ec7           	ucomisd	xmm0, xmm15
+;;   45:	 0f8218000000         	jb	0x63
+;;   4b:	 66450f57ff           	xorpd	xmm15, xmm15
+;;   50:	 66440f2ef8           	ucomisd	xmm15, xmm0
+;;   55:	 0f820a000000         	jb	0x65
+;;   5b:	 4883c410             	add	rsp, 0x10
+;;   5f:	 5d                   	pop	rbp
+;;   60:	 c3                   	ret	
+;;   61:	 0f0b                 	ud2	
+;;   63:	 0f0b                 	ud2	
+;;   65:	 0f0b                 	ud2	
diff --git a/winch/filetests/filetests/x64/i64_trunc_f64_u/const.wat b/winch/filetests/filetests/x64/i64_trunc_f64_u/const.wat
new file mode 100644
index 000000000..2963de498
--- /dev/null
+++ b/winch/filetests/filetests/x64/i64_trunc_f64_u/const.wat
@@ -0,0 +1,42 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i64)
+        (f64.const 1.0)
+        (i64.trunc_f64_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec08             	sub	rsp, 8
+;;    8:	 4c893424             	mov	qword ptr [rsp], r14
+;;    c:	 f20f100d64000000     	movsd	xmm1, qword ptr [rip + 0x64]
+;;   14:	 49bb000000000000e043 	
+;; 				movabs	r11, 0x43e0000000000000
+;;   1e:	 664d0f6efb           	movq	xmm15, r11
+;;   23:	 66410f2ecf           	ucomisd	xmm1, xmm15
+;;   28:	 0f8317000000         	jae	0x45
+;;   2e:	 0f8a3b000000         	jp	0x6f
+;;   34:	 f2480f2cc1           	cvttsd2si	rax, xmm1
+;;   39:	 4883f800             	cmp	rax, 0
+;;   3d:	 0f8d26000000         	jge	0x69
+;;   43:	 0f0b                 	ud2	
+;;   45:	 0f28c1               	movaps	xmm0, xmm1
+;;   48:	 f2410f5cc7           	subsd	xmm0, xmm15
+;;   4d:	 f2480f2cc0           	cvttsd2si	rax, xmm0
+;;   52:	 4883f800             	cmp	rax, 0
+;;   56:	 0f8c15000000         	jl	0x71
+;;   5c:	 49bb0000000000000080 	
+;; 				movabs	r11, 0x8000000000000000
+;;   66:	 4c01d8               	add	rax, r11
+;;   69:	 4883c408             	add	rsp, 8
+;;   6d:	 5d                   	pop	rbp
+;;   6e:	 c3                   	ret	
+;;   6f:	 0f0b                 	ud2	
+;;   71:	 0f0b                 	ud2	
+;;   73:	 0000                 	add	byte ptr [rax], al
+;;   75:	 0000                 	add	byte ptr [rax], al
+;;   77:	 0000                 	add	byte ptr [rax], al
+;;   79:	 0000                 	add	byte ptr [rax], al
+;;   7b:	 0000                 	add	byte ptr [rax], al
+;;   7d:	 00f0                 	add	al, dh
diff --git a/winch/filetests/filetests/x64/i64_trunc_f64_u/locals.wat b/winch/filetests/filetests/x64/i64_trunc_f64_u/locals.wat
new file mode 100644
index 000000000..7179bd091
--- /dev/null
+++ b/winch/filetests/filetests/x64/i64_trunc_f64_u/locals.wat
@@ -0,0 +1,40 @@
+;;! target = "x86_64"
+
+(module
+    (func (result i64)
+        (local f64)  
+
+        (local.get 0)
+        (i64.trunc_f64_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 48c744240800000000   	
+;; 				mov	qword ptr [rsp + 8], 0
+;;   11:	 4c893424             	mov	qword ptr [rsp], r14
+;;   15:	 f20f104c2408         	movsd	xmm1, qword ptr [rsp + 8]
+;;   1b:	 49bb000000000000e043 	
+;; 				movabs	r11, 0x43e0000000000000
+;;   25:	 664d0f6efb           	movq	xmm15, r11
+;;   2a:	 66410f2ecf           	ucomisd	xmm1, xmm15
+;;   2f:	 0f8317000000         	jae	0x4c
+;;   35:	 0f8a3b000000         	jp	0x76
+;;   3b:	 f2480f2cc1           	cvttsd2si	rax, xmm1
+;;   40:	 4883f800             	cmp	rax, 0
+;;   44:	 0f8d26000000         	jge	0x70
+;;   4a:	 0f0b                 	ud2	
+;;   4c:	 0f28c1               	movaps	xmm0, xmm1
+;;   4f:	 f2410f5cc7           	subsd	xmm0, xmm15
+;;   54:	 f2480f2cc0           	cvttsd2si	rax, xmm0
+;;   59:	 4883f800             	cmp	rax, 0
+;;   5d:	 0f8c15000000         	jl	0x78
+;;   63:	 49bb0000000000000080 	
+;; 				movabs	r11, 0x8000000000000000
+;;   6d:	 4c01d8               	add	rax, r11
+;;   70:	 4883c410             	add	rsp, 0x10
+;;   74:	 5d                   	pop	rbp
+;;   75:	 c3                   	ret	
+;;   76:	 0f0b                 	ud2	
+;;   78:	 0f0b                 	ud2	
diff --git a/winch/filetests/filetests/x64/i64_trunc_f64_u/params.wat b/winch/filetests/filetests/x64/i64_trunc_f64_u/params.wat
new file mode 100644
index 000000000..0176aad6f
--- /dev/null
+++ b/winch/filetests/filetests/x64/i64_trunc_f64_u/params.wat
@@ -0,0 +1,37 @@
+;;! target = "x86_64"
+
+(module
+    (func (param f64) (result i64)
+        (local.get 0)
+        (i64.trunc_f64_u)
+    )
+)
+;;    0:	 55                   	push	rbp
+;;    1:	 4889e5               	mov	rbp, rsp
+;;    4:	 4883ec10             	sub	rsp, 0x10
+;;    8:	 f20f11442408         	movsd	qword ptr [rsp + 8], xmm0
+;;    e:	 4c893424             	mov	qword ptr [rsp], r14
+;;   12:	 f20f104c2408         	movsd	xmm1, qword ptr [rsp + 8]
+;;   18:	 49bb000000000000e043 	
+;; 				movabs	r11, 0x43e0000000000000
+;;   22:	 664d0f6efb           	movq	xmm15, r11
+;;   27:	 66410f2ecf           	ucomisd	xmm1, xmm15
+;;   2c:	 0f8317000000         	jae	0x49
+;;   32:	 0f8a3b000000         	jp	0x73
+;;   38:	 f2480f2cc1           	cvttsd2si	rax, xmm1
+;;   3d:	 4883f800             	cmp	rax, 0
+;;   41:	 0f8d26000000         	jge	0x6d
+;;   47:	 0f0b                 	ud2	
+;;   49:	 0f28c1               	movaps	xmm0, xmm1
+;;   4c:	 f2410f5cc7           	subsd	xmm0, xmm15
+;;   51:	 f2480f2cc0           	cvttsd2si	rax, xmm0
+;;   56:	 4883f800             	cmp	rax, 0
+;;   5a:	 0f8c15000000         	jl	0x75
+;;   60:	 49bb0000000000000080 	
+;; 				movabs	r11, 0x8000000000000000
+;;   6a:	 4c01d8               	add	rax, r11
+;;   6d:	 4883c410             	add	rsp, 0x10
+;;   71:	 5d                   	pop	rbp
+;;   72:	 c3                   	ret	
+;;   73:	 0f0b                 	ud2	
+;;   75:	 0f0b                 	ud2