Skip to content

Commit

Permalink
Update cranelift, impl low hanging fruit SIMD opcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark McCaskey committed May 12, 2021
1 parent 7d491b4 commit 86d90a0
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 88 deletions.
50 changes: 28 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cfg-if = "0.1"
wat = { version = "1.0", optional = true }
thiserror = "1.0"
more-asserts = "0.2"
target-lexicon = { version = "0.11", default-features = false }
target-lexicon = { version = "0.12", default-features = false }
loupe = "0.1"

[target.'cfg(target_os = "windows")'.dependencies]
Expand Down
12 changes: 6 additions & 6 deletions lib/compiler-cranelift/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ edition = "2018"
wasmer-compiler = { path = "../compiler", version = "1.0.2", features = ["translator"], default-features = false }
wasmer-vm = { path = "../vm", version = "1.0.2" }
wasmer-types = { path = "../types", version = "1.0.2", default-features = false, features = ["std"] }
cranelift-entity = { version = "0.70", default-features = false }
cranelift-codegen = { version = "0.70", default-features = false, features = ["x86", "arm64"] }
cranelift-frontend = { version = "0.70", default-features = false }
cranelift-entity = { version = "0.73", default-features = false }
cranelift-codegen = { version = "0.73", default-features = false, features = ["x86", "arm64"] }
cranelift-frontend = { version = "0.73", default-features = false }
tracing = "0.1"
hashbrown = { version = "0.9", optional = true }
rayon = "1.5"
Expand All @@ -27,8 +27,8 @@ smallvec = "1.6"
loupe = "0.1"

[dev-dependencies]
target-lexicon = { version = "0.11", default-features = false }
cranelift-codegen = { version = "0.70", features = ["all-arch"] }
target-lexicon = { version = "0.12", default-features = false }
cranelift-codegen = { version = "0.73", features = ["all-arch"] }
lazy_static = "1.4"

[badges]
Expand All @@ -41,4 +41,4 @@ std = ["cranelift-codegen/std", "cranelift-frontend/std", "wasmer-compiler/std",
core = ["hashbrown", "cranelift-codegen/core", "cranelift-frontend/core"]

# Enable Cranelift experimental x64 backend
experimental-x64 = ["cranelift-codegen/x64"]
experimental-x64 = ["cranelift-codegen/experimental_x64"]
26 changes: 9 additions & 17 deletions lib/compiler-cranelift/src/translator/code_translator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
let a = pop1_with_bitcast(state, type_of(op), builder);
state.push1(builder.ins().ineg(a))
}
Operator::I8x16Abs | Operator::I16x8Abs | Operator::I32x4Abs => {
Operator::I8x16Abs | Operator::I16x8Abs | Operator::I32x4Abs | Operator::I64x2Abs => {
let a = pop1_with_bitcast(state, type_of(op), builder);
state.push1(builder.ins().iabs(a))
}
Expand Down Expand Up @@ -1652,7 +1652,7 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
let bool_result = builder.ins().vany_true(a);
state.push1(builder.ins().bint(I32, bool_result))
}
Operator::I8x16AllTrue | Operator::I16x8AllTrue | Operator::I32x4AllTrue => {
Operator::I8x16AllTrue | Operator::I16x8AllTrue | Operator::I32x4AllTrue | Operator::I64x2AllTrue => {
let a = pop1_with_bitcast(state, type_of(op), builder);
let bool_result = builder.ins().vall_true(a);
state.push1(builder.ins().bint(I32, bool_result))
Expand All @@ -1662,16 +1662,16 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
// let a = pop1_with_bitcast(state, type_of(op), builder);
// state.push1(builder.ins().vhigh_bits(I32, a));
}
Operator::I8x16Eq | Operator::I16x8Eq | Operator::I32x4Eq => {
Operator::I8x16Eq | Operator::I16x8Eq | Operator::I32x4Eq | Operator::I64x2Eq => {
translate_vector_icmp(IntCC::Equal, type_of(op), builder, state)
}
Operator::I8x16Ne | Operator::I16x8Ne | Operator::I32x4Ne => {
Operator::I8x16Ne | Operator::I16x8Ne | Operator::I32x4Ne | Operator::I64x2Ne => {
translate_vector_icmp(IntCC::NotEqual, type_of(op), builder, state)
}
Operator::I8x16GtS | Operator::I16x8GtS | Operator::I32x4GtS => {
Operator::I8x16GtS | Operator::I16x8GtS | Operator::I32x4GtS | Operator::I64x2GtS => {
translate_vector_icmp(IntCC::SignedGreaterThan, type_of(op), builder, state)
}
Operator::I8x16LtS | Operator::I16x8LtS | Operator::I32x4LtS => {
Operator::I8x16LtS | Operator::I16x8LtS | Operator::I32x4LtS | Operator::I64x2LtS => {
translate_vector_icmp(IntCC::SignedLessThan, type_of(op), builder, state)
}
Operator::I8x16GtU | Operator::I16x8GtU | Operator::I32x4GtU => {
Expand All @@ -1680,10 +1680,10 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
Operator::I8x16LtU | Operator::I16x8LtU | Operator::I32x4LtU => {
translate_vector_icmp(IntCC::UnsignedLessThan, type_of(op), builder, state)
}
Operator::I8x16GeS | Operator::I16x8GeS | Operator::I32x4GeS => {
Operator::I8x16GeS | Operator::I16x8GeS | Operator::I32x4GeS | Operator::I64x2GeS => {
translate_vector_icmp(IntCC::SignedGreaterThanOrEqual, type_of(op), builder, state)
}
Operator::I8x16LeS | Operator::I16x8LeS | Operator::I32x4LeS => {
Operator::I8x16LeS | Operator::I16x8LeS | Operator::I32x4LeS | Operator::I64x2LeS => {
translate_vector_icmp(IntCC::SignedLessThanOrEqual, type_of(op), builder, state)
}
Operator::I8x16GeU | Operator::I16x8GeU | Operator::I32x4GeU => translate_vector_icmp(
Expand Down Expand Up @@ -1853,19 +1853,11 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
return Err(wasm_unsupported!("proposed tail-call operator {:?}", op));
}

Operator::I64x2LtS
| Operator::I64x2GtS
| Operator::I64x2LeS
| Operator::I64x2GeS
| Operator::I8x16Popcnt
Operator::I8x16Popcnt
| Operator::I16x8ExtAddPairwiseI8x16S
| Operator::I16x8ExtAddPairwiseI8x16U
| Operator::I32x4ExtAddPairwiseI16x8S
| Operator::I32x4ExtAddPairwiseI16x8U
| Operator::I64x2Abs
| Operator::I64x2Eq
| Operator::I64x2Ne
| Operator::I64x2AllTrue
| Operator::I64x2Bitmask
| Operator::I64x2ExtendLowI32x4S
| Operator::I64x2ExtendHighI32x4S
Expand Down
2 changes: 1 addition & 1 deletion lib/compiler-llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ edition = "2018"
wasmer-compiler = { path = "../compiler", version = "1.0.2", features = ["translator"] }
wasmer-vm = { path = "../vm", version = "1.0.2" }
wasmer-types = { path = "../types", version = "1.0.2" }
target-lexicon = { version = "0.11", default-features = false }
target-lexicon = { version = "0.12", default-features = false }
smallvec = "1.6"
object = { version = "0.23", default-features = false, features = ["read"] }
libc = { version = "^0.2", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion lib/compiler-singlepass/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ smallvec = "1.6"
loupe = "0.1"

[dev-dependencies]
target-lexicon = { version = "0.11", default-features = false }
target-lexicon = { version = "0.12", default-features = false }

[badges]
maintenance = { status = "actively-developed" }
Expand Down
2 changes: 1 addition & 1 deletion lib/compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ edition = "2018"
wasmer-vm = { path = "../vm", version = "1.0.2" }
wasmer-types = { path = "../types", version = "1.0.2", default-features = false }
wasmparser = { version = "0.78", optional = true, default-features = false }
target-lexicon = { version = "0.11", default-features = false }
target-lexicon = { version = "0.12", default-features = false }
enumset = "1.0"
hashbrown = { version = "0.9", optional = true }
serde = { version = "1.0", features = ["derive"], optional = true }
Expand Down
Loading

0 comments on commit 86d90a0

Please sign in to comment.