Skip to content

Commit ae507dc

Browse files
ngzhianmarijnh
authored andcommitted
[wast mode] More SIMD instructions
f32x4 and f64x2 arithmetic instructions. Sorted test cases to match the order in https://github.com/WebAssembly/simd/blob/master/proposals/simd/BinarySIMD.md to make it easier to spot missing instructions.
1 parent cab432b commit ae507dc

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

mode/wast/test.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,12 @@
201201
'[keyword f32x4.gt]',
202202
'[keyword f32x4.le]',
203203
'[keyword f32x4.ge]',
204-
'[keyword f32x4.abs]',
205-
'[keyword f32x4.neg]',
206204
'[keyword f64x2.eq]',
207205
'[keyword f64x2.ne]',
208206
'[keyword f64x2.lt]',
209207
'[keyword f64x2.gt]',
210208
'[keyword f64x2.le]',
211209
'[keyword f64x2.ge]',
212-
'[keyword f64x2.abs]',
213-
'[keyword f64x2.neg]',
214210
'[keyword v128.not]',
215211
'[keyword v128.andnot]',
216212
'[keyword v128.and]',
@@ -274,5 +270,23 @@
274270
'[keyword i64x2.shl]',
275271
'[keyword i64x2.shr_s]',
276272
'[keyword i64x2.shr_u]',
277-
'[keyword i64x2.sub]');
273+
'[keyword i64x2.sub]',
274+
'[keyword f32x4.abs]',
275+
'[keyword f32x4.neg]',
276+
'[keyword f32x4.sqrt]',
277+
'[keyword f32x4.add]',
278+
'[keyword f32x4.sub]',
279+
'[keyword f32x4.mul]',
280+
'[keyword f32x4.div]',
281+
'[keyword f32x4.min]',
282+
'[keyword f32x4.max]',
283+
'[keyword f64x2.abs]',
284+
'[keyword f64x2.neg]',
285+
'[keyword f64x2.sqrt]',
286+
'[keyword f64x2.add]',
287+
'[keyword f64x2.sub]',
288+
'[keyword f64x2.mul]',
289+
'[keyword f64x2.div]',
290+
'[keyword f64x2.min]',
291+
'[keyword f64x2.max]');
278292
})();

mode/wast/wast.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
CodeMirror.defineSimpleMode('wast', {
1515
start: [
1616
{regex: /[+\-]?(?:nan(?::0x[0-9a-fA-F]+)?|infinity|inf|0x[0-9a-fA-F]+\.?[0-9a-fA-F]*p[+\/-]?\d+|\d+(?:\.\d*)?[eE][+\-]?\d*|\d+\.\d*|0x[0-9a-fA-F]+|\d+)/, token: "number"},
17-
{regex: /mut|nop|block|if|then|else|loop|br_if|br_table|br|call(_indirect)?|drop|end|return(_call(_indirect)?)?|local\.(get|set|tee)|global\.(get|set)|i(32|64)\.(store(8|16)|(load(8|16)_[su]))|i64\.(load32_[su]|store32)|[fi](32|64)\.(const|load|store)|f(32|64)\.(abs|add|ceil|copysign|div|eq|floor|[gl][et]|max|min|mul|nearest|neg?|sqrt|sub|trunc)|i(32|64)\.(a[dn]d|c[lt]z|(div|rem)_[su]|eqz?|[gl][te]_[su]|mul|ne|popcnt|rot[lr]|sh(l|r_[su])|sub|x?or)|i64\.extend_[su]_i32|i32\.wrap_i64|i(32|64)\.trunc_f(32|64)_[su]|f(32|64)\.convert_i(32|64)_[su]|f64\.promote_f32|f32\.demote_f64|f32\.reinterpret_i32|i32\.reinterpret_f32|f64\.reinterpret_i64|i64\.reinterpret_f64|select|unreachable|current_memory|memory(\.((atomic\.(notify|wait(32|64)))|grow|size))?|type|func|param|result|local|global|module|table|start|elem|data|align|offset|import|export|i64\.atomic\.(load32_u|store32|rmw32\.(a[dn]d|sub|x?or|(cmp)?xchg)_u)|i(32|64)\.atomic\.(load((8|16)_u)?|store(8|16)?|rmw(\.(a[dn]d|sub|x?or|(cmp)?xchg)|(8|16)\.(a[dn]d|sub|x?or|(cmp)?xchg)_u))|v128\.(load|store|const|not|andnot|and|or|xor|bitselect)|i(8x16|16x8|32x4|64x2)\.(shl|shr_[su])|i(8x16|16x8)\.(extract_lane_[su]|((add|sub)_saturate_[su])|avgr_u)|(i(8x16|16x8|32x4|64x2)|f(32x4|64x2))\.(splat|replace_lane|neg|add|sub)|i(8x16|16x8|32x4)\.(eq|ne|([lg][te]_[su])|abs|any_true|all_true|bitmask|((min|max)_[su]))|f(32x4|64x2)\.(eq|ne|[lg][te]|abs)|[fi](32x4|64x2)\.extract_lane|v8x16\.(shuffle|swizzle)/, token: "keyword"},
17+
{regex: /mut|nop|block|if|then|else|loop|br_if|br_table|br|call(_indirect)?|drop|end|return(_call(_indirect)?)?|local\.(get|set|tee)|global\.(get|set)|i(32|64)\.(store(8|16)|(load(8|16)_[su]))|i64\.(load32_[su]|store32)|[fi](32|64)\.(const|load|store)|f(32|64)\.(abs|add|ceil|copysign|div|eq|floor|[gl][et]|max|min|mul|nearest|neg?|sqrt|sub|trunc)|i(32|64)\.(a[dn]d|c[lt]z|(div|rem)_[su]|eqz?|[gl][te]_[su]|mul|ne|popcnt|rot[lr]|sh(l|r_[su])|sub|x?or)|i64\.extend_[su]_i32|i32\.wrap_i64|i(32|64)\.trunc_f(32|64)_[su]|f(32|64)\.convert_i(32|64)_[su]|f64\.promote_f32|f32\.demote_f64|f32\.reinterpret_i32|i32\.reinterpret_f32|f64\.reinterpret_i64|i64\.reinterpret_f64|select|unreachable|current_memory|memory(\.((atomic\.(notify|wait(32|64)))|grow|size))?|type|func|param|result|local|global|module|table|start|elem|data|align|offset|import|export|i64\.atomic\.(load32_u|store32|rmw32\.(a[dn]d|sub|x?or|(cmp)?xchg)_u)|i(32|64)\.atomic\.(load((8|16)_u)?|store(8|16)?|rmw(\.(a[dn]d|sub|x?or|(cmp)?xchg)|(8|16)\.(a[dn]d|sub|x?or|(cmp)?xchg)_u))|v128\.(load|store|const|not|andnot|and|or|xor|bitselect)|i(8x16|16x8|32x4|64x2)\.(shl|shr_[su])|i(8x16|16x8)\.(extract_lane_[su]|((add|sub)_saturate_[su])|avgr_u)|(i(8x16|16x8|32x4|64x2)|f(32x4|64x2))\.(splat|replace_lane|neg|add|sub)|i(8x16|16x8|32x4)\.(eq|ne|([lg][te]_[su])|abs|any_true|all_true|bitmask|((min|max)_[su]))|f(32x4|64x2)\.(eq|ne|[lg][te]|abs|sqrt|mul|div|min|max)|[fi](32x4|64x2)\.extract_lane|v8x16\.(shuffle|swizzle)/, token: "keyword"},
1818
{regex: /\b(anyfunc|[fi](32|64))\b/, token: "atom"},
1919
{regex: /\$([a-zA-Z0-9_`\+\-\*\/\\\^~=<>!\?@#$%&|:\.]+)/, token: "variable-2"},
2020
{regex: /"(?:[^"\\\x00-\x1f\x7f]|\\[nt\\'"]|\\[0-9a-fA-F][0-9a-fA-F])*"/, token: "string"},

0 commit comments

Comments
 (0)