-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Winch: packed integer basic arithmetic for x64 #10147
base: main
Are you sure you want to change the base?
Winch: packed integer basic arithmetic for x64 #10147
Conversation
|
||
/// Perform a vector add between `lsh` and `rhs`, placing the result in `dst`, where each lane | ||
/// is interpreted to be `size` long. | ||
fn v128_add( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naming-wise, I'm completely sure what to call those. Maybe vector_add
is more appropriate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the naming is fine here, as far as I can tell, we don't have any other vector
naming convention.
I can take this review. |
let mul_avx512 = |this: &mut Self, op| { | ||
this.ensure_has_avx512vl()?; | ||
this.ensure_has_avx512dq()?; | ||
this.asm.xmm_rm_rvex3(op, lhs, rhs, dst); | ||
Ok(()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should make this a hard requirement, given that our baseline is AVX.
Given that Intel suggests that there's no penalty on mixing AVX with AVX512 instructions , we could emit AVX512 if they are available, however in case they aren't we still need to emit a fallback to avoid bumping our baseline for this operation. For reference: https://github.com/bytecodealliance/wasmtime/blob/main/cranelift/codegen/src/isa/x64/lower.isle#L1121
|
||
/// Perform a vector add between `lsh` and `rhs`, placing the result in `dst`, where each lane | ||
/// is interpreted to be `size` long. | ||
fn v128_add( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the naming is fine here, as far as I can tell, we don't have any other vector
naming convention.
implements the following instructions for winch x64:
i8x16.add
i8x16.add_sat_u
i8x16.add_sat_s
i16x8.add
i16x8.add_sat_u
i16x8.add_sat_s
i32x4.add
i64x2.add
i8x16.sub
i8x16.sub_sat_u
i8x16.sub_sat_s
i16x8.sub
i16x8.sub_sat_u
i16x8.sub_sat_s
i32x4.sub
i64x2.sub
i16x8.mul
i32x4.mul
i64x2.mul
#8093