Skip to content

Commit

Permalink
Temporarily remove half-baked v128.const parsing support
Browse files Browse the repository at this point in the history
I added this in a37fbd8 and
7177c2d because a recent change in the
official WebAssembly tests [0] added some uses of `v128.const` outside
of the test/core/simd directory. This was even more recently fixed by
moving those uses into test/core/simd [1], so we don’t need this dummy
parsing code any more. I’ll bring it back if/when we get around to
properly implementing SIMD instructions.

[0] WebAssembly/spec#1597
[1] WebAssembly/spec#1610
  • Loading branch information
tomstuart committed Feb 21, 2023
1 parent bb9152b commit bd07c17
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions lib/wasminna/ast_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -641,11 +641,7 @@ def parse_start
NUMERIC_OPCODE_REGEXP =
%r{
\A
(
(?<type>[fi]) (?<bits>32|64)
|
(?<type>v) (?<bits>128)
) \. (?<operation>.+)
(?<type>[fi]) (?<bits>32|64) \. (?<operation>.+)
\z
}x

Expand Down Expand Up @@ -745,7 +741,7 @@ def parse_numeric_instruction

opcode.match(NUMERIC_OPCODE_REGEXP) =>
{ type:, bits:, operation: }
type = { 'f' => :float, 'i' => :integer, 'v' => :vector }.fetch(type)
type = { 'f' => :float, 'i' => :integer }.fetch(type)
bits = bits.to_i(10)

case operation
Expand All @@ -756,8 +752,6 @@ def parse_numeric_instruction
parse_integer(bits:)
in :float
parse_float(bits:)
in :vector
parse_vector(bits:)
end

Const.new(type:, bits:, number:)
Expand Down Expand Up @@ -1093,14 +1087,6 @@ def parse_float(bits:)
Float.parse(read).encode(format:)
end

def parse_vector(bits:)
raise unless bits == 128
read => 'i64x2'
read => '0'
read => '0'
0
end

def parse_string
read => string
encoding = string.encoding
Expand Down

0 comments on commit bd07c17

Please sign in to comment.