Skip to content

Commit bafa3fb

Browse files
authored
Merge pull request #6 from dhil/wasmfx-merge
Merge with upstream
2 parents bf57bb4 + 2f45a86 commit bafa3fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1493
-682
lines changed

Cargo.lock

Lines changed: 74 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ resolver = "2"
1818

1919
[workspace.package]
2020
edition = "2021"
21-
version = "0.22.0"
21+
version = "0.23.0"
2222

2323
[workspace.dependencies]
2424
anyhow = "1.0.72"
@@ -28,20 +28,20 @@ pulldown-cmark = { version = "0.9", default-features = false }
2828
clap = { version = "4.3.19", features = ["derive"] }
2929
indexmap = "2.0.0"
3030

31-
wasmparser = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "wasmfx-tools-1.201.0+rev.1" }
32-
wasm-metadata = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "wasmfx-tools-1.201.0+rev.1" }
33-
wasm-encoder = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "wasmfx-tools-1.201.0+rev.1" }
34-
wit-parser = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "wasmfx-tools-1.201.0+rev.1" }
35-
wit-component = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "wasmfx-tools-1.201.0+rev.1" }
31+
wasmparser = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "v1.202.0" }
32+
wasm-metadata = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "v1.202.0" }
33+
wasm-encoder = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "v1.202.0" }
34+
wit-parser = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "v1.202.0" }
35+
wit-component = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "v1.202.0" }
3636

37-
wit-bindgen-core = { path = 'crates/core', version = '0.22.0' }
38-
wit-bindgen-c = { path = 'crates/c', version = '0.22.0' }
39-
wit-bindgen-rust = { path = "crates/rust", version = "0.22.0" }
40-
wit-bindgen-teavm-java = { path = 'crates/teavm-java', version = '0.22.0' }
41-
wit-bindgen-go = { path = 'crates/go', version = '0.22.0' }
42-
wit-bindgen-csharp = { path = 'crates/csharp', version = '0.22.0' }
43-
wit-bindgen-markdown = { path = 'crates/markdown', version = '0.22.0' }
44-
wit-bindgen = { path = 'crates/guest-rust', version = '0.22.0', default-features = false }
37+
wit-bindgen-core = { path = 'crates/core', version = '0.23.0' }
38+
wit-bindgen-c = { path = 'crates/c', version = '0.23.0' }
39+
wit-bindgen-rust = { path = "crates/rust", version = "0.23.0" }
40+
wit-bindgen-teavm-java = { path = 'crates/teavm-java', version = '0.23.0' }
41+
wit-bindgen-go = { path = 'crates/go', version = '0.23.0' }
42+
wit-bindgen-csharp = { path = 'crates/csharp', version = '0.23.0' }
43+
wit-bindgen-markdown = { path = 'crates/markdown', version = '0.23.0' }
44+
wit-bindgen = { path = 'crates/guest-rust', version = '0.23.0', default-features = false }
4545

4646
[[bin]]
4747
name = "wit-bindgen"

crates/c/src/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,8 @@ impl C {
560560
Type::S32 => dst.push_str("int32_t"),
561561
Type::U64 => dst.push_str("uint64_t"),
562562
Type::S64 => dst.push_str("int64_t"),
563-
Type::Float32 => dst.push_str("float"),
564-
Type::Float64 => dst.push_str("double"),
563+
Type::F32 => dst.push_str("float"),
564+
Type::F64 => dst.push_str("double"),
565565
Type::String => {
566566
dst.push_str(&self.world.to_snake_case());
567567
dst.push_str("_");
@@ -731,8 +731,8 @@ pub fn push_ty_name(resolve: &Resolve, ty: &Type, src: &mut String) {
731731
Type::S32 => src.push_str("s32"),
732732
Type::U64 => src.push_str("u64"),
733733
Type::S64 => src.push_str("s64"),
734-
Type::Float32 => src.push_str("float32"),
735-
Type::Float64 => src.push_str("float64"),
734+
Type::F32 => src.push_str("f32"),
735+
Type::F64 => src.push_str("f64"),
736736
Type::String => src.push_str("string"),
737737
Type::Id(id) => {
738738
let ty = &resolve.types[*id];
@@ -1617,8 +1617,8 @@ impl InterfaceGenerator<'_> {
16171617
| Type::S32
16181618
| Type::U64
16191619
| Type::S64
1620-
| Type::Float32
1621-
| Type::Float64
1620+
| Type::F32
1621+
| Type::F64
16221622
| Type::Char => {}
16231623
}
16241624
}
@@ -2264,10 +2264,10 @@ impl Bindgen for FunctionBindgen<'_, '_> {
22642264

22652265
// f32/f64 have the same representation in the import type and in C,
22662266
// so no conversions necessary.
2267-
Instruction::F32FromFloat32
2268-
| Instruction::F64FromFloat64
2269-
| Instruction::Float32FromF32
2270-
| Instruction::Float64FromF64 => {
2267+
Instruction::CoreF32FromF32
2268+
| Instruction::CoreF64FromF64
2269+
| Instruction::F32FromCoreF32
2270+
| Instruction::F64FromCoreF64 => {
22712271
results.push(operands[0].clone());
22722272
}
22732273

crates/core/src/abi.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@ def_instruction! {
174174
/// This may be a noop for some implementations, but it's here in case the
175175
/// native language representation of `f32` is different than the wasm
176176
/// representation of `f32`.
177-
F32FromFloat32 : [1] => [1],
177+
CoreF32FromF32 : [1] => [1],
178178
/// Conversion an interface type `f64` value to a wasm `f64`.
179179
///
180180
/// This may be a noop for some implementations, but it's here in case the
181181
/// native language representation of `f64` is different than the wasm
182182
/// representation of `f64`.
183-
F64FromFloat64 : [1] => [1],
183+
CoreF64FromF64 : [1] => [1],
184184

185185
/// Converts a native wasm `i32` to an interface type `s8`.
186186
///
@@ -211,9 +211,9 @@ def_instruction! {
211211
/// It's safe to assume that the `i32` is indeed a valid unicode code point.
212212
CharFromI32 : [1] => [1],
213213
/// Converts a native wasm `f32` to an interface type `f32`.
214-
Float32FromF32 : [1] => [1],
214+
F32FromCoreF32 : [1] => [1],
215215
/// Converts a native wasm `f64` to an interface type `f64`.
216-
Float64FromF64 : [1] => [1],
216+
F64FromCoreF64 : [1] => [1],
217217

218218
/// Creates a `bool` from an `i32` input, trapping if the `i32` isn't
219219
/// zero or one.
@@ -747,8 +747,8 @@ fn needs_post_return(resolve: &Resolve, ty: &Type) -> bool {
747747
| Type::S32
748748
| Type::U64
749749
| Type::S64
750-
| Type::Float32
751-
| Type::Float64
750+
| Type::F32
751+
| Type::F64
752752
| Type::Char => false,
753753
}
754754
}
@@ -1067,8 +1067,8 @@ impl<'a, B: Bindgen> Generator<'a, B> {
10671067
Type::S64 => self.emit(&I64FromS64),
10681068
Type::U64 => self.emit(&I64FromU64),
10691069
Type::Char => self.emit(&I32FromChar),
1070-
Type::Float32 => self.emit(&F32FromFloat32),
1071-
Type::Float64 => self.emit(&F64FromFloat64),
1070+
Type::F32 => self.emit(&CoreF32FromF32),
1071+
Type::F64 => self.emit(&CoreF64FromF64),
10721072
Type::String => {
10731073
let realloc = self.list_realloc();
10741074
self.emit(&StringLower { realloc });
@@ -1256,8 +1256,8 @@ impl<'a, B: Bindgen> Generator<'a, B> {
12561256
Type::S64 => self.emit(&S64FromI64),
12571257
Type::U64 => self.emit(&U64FromI64),
12581258
Type::Char => self.emit(&CharFromI32),
1259-
Type::Float32 => self.emit(&Float32FromF32),
1260-
Type::Float64 => self.emit(&Float64FromF64),
1259+
Type::F32 => self.emit(&F32FromCoreF32),
1260+
Type::F64 => self.emit(&F64FromCoreF64),
12611261
Type::String => self.emit(&StringLift),
12621262
Type::Id(id) => match &self.resolve.types[id].kind {
12631263
TypeDefKind::Type(t) => self.lift(t),
@@ -1414,8 +1414,8 @@ impl<'a, B: Bindgen> Generator<'a, B> {
14141414
self.lower_and_emit(ty, addr, &I32Store { offset })
14151415
}
14161416
Type::U64 | Type::S64 => self.lower_and_emit(ty, addr, &I64Store { offset }),
1417-
Type::Float32 => self.lower_and_emit(ty, addr, &F32Store { offset }),
1418-
Type::Float64 => self.lower_and_emit(ty, addr, &F64Store { offset }),
1417+
Type::F32 => self.lower_and_emit(ty, addr, &F32Store { offset }),
1418+
Type::F64 => self.lower_and_emit(ty, addr, &F64Store { offset }),
14191419
Type::String => self.write_list_to_memory(ty, addr, offset),
14201420

14211421
Type::Id(id) => match &self.resolve.types[id].kind {
@@ -1602,8 +1602,8 @@ impl<'a, B: Bindgen> Generator<'a, B> {
16021602
Type::S16 => self.emit_and_lift(ty, addr, &I32Load16S { offset }),
16031603
Type::U32 | Type::S32 | Type::Char => self.emit_and_lift(ty, addr, &I32Load { offset }),
16041604
Type::U64 | Type::S64 => self.emit_and_lift(ty, addr, &I64Load { offset }),
1605-
Type::Float32 => self.emit_and_lift(ty, addr, &F32Load { offset }),
1606-
Type::Float64 => self.emit_and_lift(ty, addr, &F64Load { offset }),
1605+
Type::F32 => self.emit_and_lift(ty, addr, &F32Load { offset }),
1606+
Type::F64 => self.emit_and_lift(ty, addr, &F64Load { offset }),
16071607
Type::String => self.read_list_from_memory(ty, addr, offset),
16081608

16091609
Type::Id(id) => match &self.resolve.types[id].kind {
@@ -1799,8 +1799,8 @@ impl<'a, B: Bindgen> Generator<'a, B> {
17991799
| Type::Char
18001800
| Type::U64
18011801
| Type::S64
1802-
| Type::Float32
1803-
| Type::Float64 => {}
1802+
| Type::F32
1803+
| Type::F64 => {}
18041804

18051805
Type::Id(id) => match &self.resolve.types[id].kind {
18061806
TypeDefKind::Type(t) => self.deallocate(t, addr, offset),

0 commit comments

Comments
 (0)