-
Notifications
You must be signed in to change notification settings - Fork 319
Fix lane-swapping on pairwise big endian Neon intrinsic #2087
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,8 +30,7 @@ where | |
| } | ||
|
|
||
| pub fn to_c_type(&self) -> String { | ||
| let prefix = if self.ty.constant { "const " } else { "" }; | ||
| format!("{prefix}{}", self.ty.c_type()) | ||
| self.ty.c_type() | ||
| } | ||
|
|
||
| pub fn generate_name(&self) -> String { | ||
|
|
@@ -176,9 +175,10 @@ where | |
| pub fn load_values_c(&self, indentation: Indentation) -> String { | ||
| self.iter() | ||
| .filter(|&arg| !arg.has_constraint()) | ||
| .map(|arg| { | ||
| .enumerate() | ||
| .map(|(idx, arg)| { | ||
| format!( | ||
| "{indentation}{ty} {name} = cast<{ty}>({load}(&{name}_vals[i]));\n", | ||
| "{indentation}{ty} {name} = cast<{ty}>({load}(&{name}_vals[i+{idx}]));\n", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to be clear, not using
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doing it this way (ensuring that two inputs to the intrinsic aren't always equal) provides a bit of extra coverage and should slightly reduce runtime. Just an oversight that we never did it this way originally |
||
| ty = arg.to_c_type(), | ||
| name = arg.generate_name(), | ||
| load = if arg.is_simd() { | ||
|
|
@@ -197,15 +197,16 @@ where | |
| pub fn load_values_rust(&self, indentation: Indentation) -> String { | ||
| self.iter() | ||
| .filter(|&arg| !arg.has_constraint()) | ||
| .map(|arg| { | ||
| .enumerate() | ||
| .map(|(idx, arg)| { | ||
| let load = if arg.is_simd() { | ||
| arg.ty.get_load_function(Language::Rust) | ||
| } else { | ||
| "*".to_string() | ||
| }; | ||
| let typecast = if load.len() > 2 { "as _" } else { "" }; | ||
| format!( | ||
| "{indentation}let {name} = {load}({vals_name}.as_ptr().offset(i){typecast});\n", | ||
| "{indentation}let {name} = {load}({vals_name}.as_ptr().offset(i+{idx}){typecast});\n", | ||
| name = arg.generate_name(), | ||
| vals_name = arg.rust_vals_array_name(), | ||
| ) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
you've now removed the
"const "prefix in both cases (here and inc_type), is that right?View changes since the review
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.
Yep, it should be handled by generate_c_constraint_blocks() now, and this avoids a warning about
const constappearing in the output