-
Notifications
You must be signed in to change notification settings - Fork 299
intrinsic-test
: Adding x86 behavioural testing.
#1894
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
base: master
Are you sure you want to change the base?
Changes from 27 commits
1eee9ed
07f20f4
191614a
a952d3b
417f729
4c19bd2
3e3bf65
3e95708
fbb8214
6c69404
0d62fe4
bd48f59
8a69c61
83bc235
76359ef
0c803aa
a7dac63
68b2b2c
1951ed0
9726455
1a07650
e79129a
8efed65
33ead37
30e0642
6f9e90e
6fbdf07
d3dbbd6
adb8124
218c360
e32b078
07024e9
5383867
7454872
b28fc7a
f7f0d4e
2913908
1e56470
39425f3
51c8750
52c0c08
c5717c3
06f1b0c
9c1ec7d
c824690
3a1aab8
3a4ae99
ab00695
06bb848
599b68f
3a0fef0
f123a9b
ce16379
411fbcd
ee2f1e7
4b06d4b
87e39a2
3b77dc5
9dbc078
6c66eb7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,17 @@ impl SupportedArchitectureTest for ArmArchitectureTest { | |
|
||
const NOTICE: &str = config::NOTICE; | ||
|
||
const PLATFORM_C_HEADERS: &[&str] = &["arm_neon.h", "arm_acle.h", "arm_fp16.h"]; | ||
const PLATFORM_C_HEADERS: &[&str] = &[ | ||
"iostream", | ||
"cstring", | ||
"iomanip", | ||
"sstream", | ||
"cstddef", | ||
"cstdint", | ||
"arm_neon.h", | ||
"arm_acle.h", | ||
"arm_fp16.h", | ||
]; | ||
|
||
const PLATFORM_C_DEFINITIONS: &str = config::POLY128_OSTREAM_DEF; | ||
const PLATFORM_C_FORWARD_DECLARATIONS: &str = config::POLY128_OSTREAM_DECL; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,7 +108,7 @@ where | |
for arg in self.iter().filter(|&arg| !arg.has_constraint()) { | ||
writeln!( | ||
w, | ||
"{indentation}const {ty} {name}_vals[] = {values};", | ||
"{indentation}alignas(64) const {ty} {name}_vals[] = {values};", | ||
Comment on lines
-111
to
+118
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. interesting, I suppose we're casting values to simd vectors and then performing some sort of aligned read? In any case, can you leave a comment on why the alignment is required? 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. Really, I added this as a general precautionary measure. Fortunately when I was working on x86, there were intrinsics that helped with unaligned reads (like 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. But yes, I'll add a comment on the same. 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. @folkertdev I wish to confer with you on this. I chose 64 so that it generalizes well across 16-bit, 32-bit and 64-bit alignment requirements. Would 64 be a good value, or is it overkill? 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. I'd go with either 64 or remove it completely, any other inbetween value does not really make sense. |
||
ty = arg.ty.c_scalar_type(), | ||
name = arg.name, | ||
values = arg.ty.populate_random(indentation, loads, &Language::C) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
use std::fs::File; | ||
use std::io::{self, Write}; | ||
|
||
use rayon::prelude::*; | ||
|
||
|
@@ -76,6 +77,14 @@ pub trait SupportedArchitectureTest { | |
if let Some(cpp_compiler) = cpp_compiler_wrapped.as_ref() { | ||
let output = cpp_compiler | ||
.compile_object_file(&format!("mod_{i}.cpp"), &format!("mod_{i}.o"))?; | ||
if !output.status.success() { | ||
io::stdout() | ||
.write_all(&output.stdout) | ||
.expect("Failed to write to stdout!"); | ||
io::stderr() | ||
.write_all(&output.stderr) | ||
.expect("Failed to write to stderr!"); | ||
} | ||
|
||
assert!(output.status.success(), "{output:?}"); | ||
} | ||
|
||
|
@@ -88,6 +97,7 @@ pub trait SupportedArchitectureTest { | |
write_main_cpp( | ||
&mut file, | ||
Self::PLATFORM_C_DEFINITIONS, | ||
Self::PLATFORM_C_HEADERS, | ||
self.intrinsics().iter().map(|i| i.name.as_str()), | ||
) | ||
.unwrap(); | ||
|
Uh oh!
There was an error while loading. Please reload this page.