Skip to content

Commit

Permalink
Fix renamings in wave
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Jan 8, 2025
1 parent bdc9427 commit d92598e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
20 changes: 10 additions & 10 deletions crates/wasmtime/src/runtime/wave/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ impl WasmType for component::Type {
Self::U32 => WasmTypeKind::U32,
Self::S64 => WasmTypeKind::S64,
Self::U64 => WasmTypeKind::U64,
Self::Float32 => WasmTypeKind::Float32,
Self::Float64 => WasmTypeKind::Float64,
Self::Float32 => WasmTypeKind::F32,
Self::Float64 => WasmTypeKind::F64,
Self::Char => WasmTypeKind::Char,
Self::String => WasmTypeKind::String,
Self::List(_) => WasmTypeKind::List,
Expand Down Expand Up @@ -122,8 +122,8 @@ impl WasmValue for component::Val {
Self::U32(_) => WasmTypeKind::U32,
Self::S64(_) => WasmTypeKind::S64,
Self::U64(_) => WasmTypeKind::U64,
Self::Float32(_) => WasmTypeKind::Float32,
Self::Float64(_) => WasmTypeKind::Float64,
Self::Float32(_) => WasmTypeKind::F32,
Self::Float64(_) => WasmTypeKind::F64,
Self::Char(_) => WasmTypeKind::Char,
Self::String(_) => WasmTypeKind::String,
Self::List(_) => WasmTypeKind::List,
Expand Down Expand Up @@ -152,11 +152,11 @@ impl WasmValue for component::Val {
(Char, char, make_char, unwrap_char)
);

fn make_float32(val: f32) -> Self {
fn make_f32(val: f32) -> Self {
let val = canonicalize_nan32(val);
Self::Float32(val)
}
fn make_float64(val: f64) -> Self {
fn make_f64(val: f64) -> Self {
let val = canonicalize_nan64(val);
Self::Float64(val)
}
Expand Down Expand Up @@ -238,12 +238,12 @@ impl WasmValue for component::Val {
Ok(val)
}

fn unwrap_float32(&self) -> f32 {
let val = *unwrap_val!(self, Self::Float32, "float32");
fn unwrap_f32(&self) -> f32 {
let val = *unwrap_val!(self, Self::Float32, "f32");
canonicalize_nan32(val)
}
fn unwrap_float64(&self) -> f64 {
let val = *unwrap_val!(self, Self::Float64, "float64");
fn unwrap_f64(&self) -> f64 {
let val = *unwrap_val!(self, Self::Float64, "f64");
canonicalize_nan64(val)
}
fn unwrap_string(&self) -> Cow<str> {
Expand Down
20 changes: 10 additions & 10 deletions crates/wasmtime/src/runtime/wave/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ impl WasmType for crate::ValType {
match self {
Self::I32 => WasmTypeKind::S32,
Self::I64 => WasmTypeKind::S64,
Self::F32 => WasmTypeKind::Float32,
Self::F64 => WasmTypeKind::Float64,
Self::F32 => WasmTypeKind::F32,
Self::F64 => WasmTypeKind::F64,
Self::V128 => WasmTypeKind::Tuple,

Self::Ref(_) => WasmTypeKind::Unsupported,
Expand All @@ -33,8 +33,8 @@ impl WasmValue for crate::Val {
match self {
Self::I32(_) => WasmTypeKind::S32,
Self::I64(_) => WasmTypeKind::S64,
Self::F32(_) => WasmTypeKind::Float32,
Self::F64(_) => WasmTypeKind::Float64,
Self::F32(_) => WasmTypeKind::F32,
Self::F64(_) => WasmTypeKind::F64,
Self::V128(_) => WasmTypeKind::Tuple,
Self::FuncRef(_) => WasmTypeKind::Unsupported,
Self::ExternRef(_) => WasmTypeKind::Unsupported,
Expand All @@ -48,11 +48,11 @@ impl WasmValue for crate::Val {
fn make_s64(val: i64) -> Self {
Self::I64(val)
}
fn make_float32(val: f32) -> Self {
fn make_f32(val: f32) -> Self {
let val = canonicalize_nan32(val);
Self::F32(val.to_bits())
}
fn make_float64(val: f64) -> Self {
fn make_f64(val: f64) -> Self {
let val = canonicalize_nan64(val);
Self::F64(val.to_bits())
}
Expand Down Expand Up @@ -88,13 +88,13 @@ impl WasmValue for crate::Val {
*unwrap_val!(self, Self::I64, "s64")
}

fn unwrap_float32(&self) -> f32 {
let val = f32::from_bits(*unwrap_val!(self, Self::F32, "float32"));
fn unwrap_f32(&self) -> f32 {
let val = f32::from_bits(*unwrap_val!(self, Self::F32, "f32"));
canonicalize_nan32(val)
}

fn unwrap_float64(&self) -> f64 {
let val = f64::from_bits(*unwrap_val!(self, Self::F64, "float64"));
fn unwrap_f64(&self) -> f64 {
let val = f64::from_bits(*unwrap_val!(self, Self::F64, "f64"));
canonicalize_nan64(val)
}

Expand Down

0 comments on commit d92598e

Please sign in to comment.