Skip to content

Commit

Permalink
Update wasmparser dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Feb 5, 2020
1 parent 121340d commit 5edd0c2
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ leb128 = "0.2.4"
log = "0.4.8"
rayon = { version = "1.1.0", optional = true }
walrus-macro = { path = './crates/macro', version = '=0.15.0' }
wasmparser = "0.48.0"
wasmparser = "0.49.0"

[features]
parallel = ['rayon', 'id-arena/rayon']
Expand Down
13 changes: 13 additions & 0 deletions src/ir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,19 @@ pub enum BinaryOp {
I16x8NarrowI32x4U,
I8x16RoundingAverageU,
I16x8RoundingAverageU,

I8x16MinS,
I8x16MinU,
I8x16MaxS,
I8x16MaxU,
I16x8MinS,
I16x8MinU,
I16x8MaxS,
I16x8MaxU,
I32x4MinS,
I32x4MinU,
I32x4MaxS,
I32x4MaxU,
}

/// Possible unary operations in wasm
Expand Down
13 changes: 13 additions & 0 deletions src/module/functions/local_function/emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,19 @@ impl<'instr> Visitor<'instr> for Emit<'_, '_> {

I8x16RoundingAverageU => self.simd(0xd9),
I16x8RoundingAverageU => self.simd(0xda),

I8x16MinS => self.simd(0x5e),
I8x16MinU => self.simd(0x5f),
I8x16MaxS => self.simd(0x60),
I8x16MaxU => self.simd(0x61),
I16x8MinS => self.simd(0x6f),
I16x8MinU => self.simd(0x70),
I16x8MaxS => self.simd(0x71),
I16x8MaxU => self.simd(0x72),
I32x4MinS => self.simd(0x80),
I32x4MinU => self.simd(0x81),
I32x4MaxS => self.simd(0x82),
I32x4MaxU => self.simd(0x83),
}
}

Expand Down
13 changes: 13 additions & 0 deletions src/module/functions/local_function/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1460,6 +1460,19 @@ fn validate_instruction<'context>(
Operator::I8x16RoundingAverageU => binop(ctx, V128, BinaryOp::I8x16RoundingAverageU)?,
Operator::I16x8RoundingAverageU => binop(ctx, V128, BinaryOp::I16x8RoundingAverageU)?,

Operator::I8x16MinS => binop(ctx, V128, BinaryOp::I8x16MinS)?,
Operator::I8x16MinU => binop(ctx, V128, BinaryOp::I8x16MinU)?,
Operator::I8x16MaxS => binop(ctx, V128, BinaryOp::I8x16MaxS)?,
Operator::I8x16MaxU => binop(ctx, V128, BinaryOp::I8x16MaxU)?,
Operator::I16x8MinS => binop(ctx, V128, BinaryOp::I16x8MinS)?,
Operator::I16x8MinU => binop(ctx, V128, BinaryOp::I16x8MinU)?,
Operator::I16x8MaxS => binop(ctx, V128, BinaryOp::I16x8MaxS)?,
Operator::I16x8MaxU => binop(ctx, V128, BinaryOp::I16x8MaxU)?,
Operator::I32x4MinS => binop(ctx, V128, BinaryOp::I32x4MinS)?,
Operator::I32x4MinU => binop(ctx, V128, BinaryOp::I32x4MinU)?,
Operator::I32x4MaxS => binop(ctx, V128, BinaryOp::I32x4MaxS)?,
Operator::I32x4MaxU => binop(ctx, V128, BinaryOp::I32x4MaxU)?,

Operator::TableCopy {
src_table,
dst_table,
Expand Down

0 comments on commit 5edd0c2

Please sign in to comment.