Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement relaxed SIMD operations #2681

Merged
merged 4 commits into from Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/options.json
Expand Up @@ -221,14 +221,14 @@
" reference-types Reference types and operations.",
" gc Garbage collection (WIP).",
" stringref String reference types.",
" relaxed-simd Relaxed SIMD operations.",
""
],
"TODO_doesNothingYet": [
" exception-handling Exception handling.",
" tail-calls Tail call operations.",
" multi-value Multi value types.",
" memory64 Memory64 operations.",
" relaxed-simd Relaxed SIMD operations.",
" extended-const Extended const expressions."
],
"type": "S",
Expand Down
622 changes: 574 additions & 48 deletions src/builtins.ts

Large diffs are not rendered by default.

114 changes: 109 additions & 5 deletions std/assembly/builtins.ts
Expand Up @@ -1562,6 +1562,50 @@ export namespace v128 {
// @ts-ignore: decorator
@builtin
export declare function extmul_high<T>(a: v128, b: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_swizzle(a: v128, s: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_trunc<T>(a: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_trunc_zero<T>(a: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_madd<T>(a: v128, b: v128, c: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_nmadd<T>(a: v128, b: v128, c: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_laneselect<T>(a: v128, b: v128, m: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_min<T>(a: v128, b: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_max<T>(a: v128, b: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_q15mulr<T>(a: v128, b: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_dot<T>(a: v128, b: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_dot_add<T>(a: v128, b: v128, c: v128): v128;
}

// @ts-ignore: decorator
Expand Down Expand Up @@ -1724,6 +1768,14 @@ export namespace i8x16 {
// @ts-ignore: decorator
@builtin
export declare function swizzle(a: v128, b: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_swizzle(a: v128, s: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_laneselect(a: v128, b: v128, m: v128): v128;
}

// @ts-ignore: decorator
Expand Down Expand Up @@ -1925,7 +1977,15 @@ export namespace i16x8 {

// @ts-ignore: decorator
@builtin
export declare function swizzle(a: v128, b: v128): v128;
export declare function relaxed_laneselect(a: v128, b: v128, m: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_q15mulr_s(a: v128, b: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_dot_i8x16_i7x16_s(a: v128, b: v128, c: v128): v128;
}

// @ts-ignore: decorator
Expand Down Expand Up @@ -2108,7 +2168,27 @@ export namespace i32x4 {

// @ts-ignore: decorator
@builtin
export declare function swizzle(a: v128, b: v128): v128;
export declare function relaxed_trunc_f32x4_s(a: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_trunc_f32x4_u(a: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_trunc_f64x2_s_zero(a: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_trunc_f64x2_u_zero(a: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_laneselect(a: v128, b: v128, m: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_dot_i8x16_i7x16_add_s(a: v128, b: v128, c: v128): v128;
}

// @ts-ignore: decorator
Expand Down Expand Up @@ -2231,7 +2311,7 @@ export namespace i64x2 {

// @ts-ignore: decorator
@builtin
export declare function swizzle(a: v128, b: v128): v128;
export declare function relaxed_laneselect(a: v128, b: v128, m: v128): v128;
}

// @ts-ignore: decorator
Expand Down Expand Up @@ -2354,7 +2434,19 @@ export namespace f32x4 {

// @ts-ignore: decorator
@builtin
export declare function swizzle(a: v128, b: v128): v128;
export declare function relaxed_madd(a: v128, b: v128, c: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_nmadd(a: v128, b: v128, c: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_min(a: v128, b: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_max(a: v128, b: v128): v128;
}

// @ts-ignore: decorator
Expand Down Expand Up @@ -2477,7 +2569,19 @@ export namespace f64x2 {

// @ts-ignore: decorator
@builtin
export declare function swizzle(a: v128, b: v128): v128;
export declare function relaxed_madd(a: v128, b: v128, c: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_nmadd(a: v128, b: v128, c: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_min(a: v128, b: v128): v128;

// @ts-ignore: decorator
@builtin
export declare function relaxed_max(a: v128, b: v128): v128;
}

@final
Expand Down