diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:50 +0000 |
commit | 2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35 (patch) | |
tree | d325add32978dbdc1db975a438b3a77d571b1ab8 /library/stdarch/crates/intrinsic-test | |
parent | Releasing progress-linux version 1.68.2+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.tar.xz rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.zip |
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/stdarch/crates/intrinsic-test')
7 files changed, 25 insertions, 36 deletions
diff --git a/library/stdarch/crates/intrinsic-test/Cargo.toml b/library/stdarch/crates/intrinsic-test/Cargo.toml index 5fde23c9e..7efbab755 100644 --- a/library/stdarch/crates/intrinsic-test/Cargo.toml +++ b/library/stdarch/crates/intrinsic-test/Cargo.toml @@ -2,7 +2,7 @@ name = "intrinsic-test" version = "0.1.0" authors = ["Jamie Cunliffe <Jamie.Cunliffe@arm.com>"] -edition = "2018" +edition = "2021" [dependencies] lazy_static = "1.4.0" @@ -14,4 +14,4 @@ log = "0.4.11" pretty_env_logger = "0.4.0" rayon = "1.5.0" diff = "0.1.12" -itertools = "0.10.1"
\ No newline at end of file +itertools = "0.10.1" diff --git a/library/stdarch/crates/intrinsic-test/missing_arm.txt b/library/stdarch/crates/intrinsic-test/missing_arm.txt index bbc8de584..3d7ead062 100644 --- a/library/stdarch/crates/intrinsic-test/missing_arm.txt +++ b/library/stdarch/crates/intrinsic-test/missing_arm.txt @@ -163,17 +163,6 @@ vcaddq_rot270_f32 vcaddq_rot90_f32 vcadd_rot270_f32 vcadd_rot90_f32 -vcombine_f32 -vcombine_p16 -vcombine_p8 -vcombine_s16 -vcombine_s32 -vcombine_s64 -vcombine_s8 -vcombine_u16 -vcombine_u32 -vcombine_u64 -vcombine_u8 vcvtaq_s32_f32 vcvtaq_u32_f32 vcvta_s32_f32 diff --git a/library/stdarch/crates/intrinsic-test/src/acle_csv_parser.rs b/library/stdarch/crates/intrinsic-test/src/acle_csv_parser.rs index d7b066485..7336c9e8b 100644 --- a/library/stdarch/crates/intrinsic-test/src/acle_csv_parser.rs +++ b/library/stdarch/crates/intrinsic-test/src/acle_csv_parser.rs @@ -59,8 +59,8 @@ impl Into<Intrinsic> for ACLEIntrinsicLine { let signature = self.intrinsic; let (ret_ty, remaining) = signature.split_once(' ').unwrap(); - let results = type_from_c(ret_ty) - .unwrap_or_else(|_| panic!("Failed to parse return type: {}", ret_ty)); + let results = + type_from_c(ret_ty).unwrap_or_else(|_| panic!("Failed to parse return type: {ret_ty}")); let (name, args) = remaining.split_once('(').unwrap(); let args = args.trim_end_matches(')'); @@ -177,7 +177,7 @@ fn from_c(pos: usize, s: &str) -> Argument { Argument { pos, name, - ty: type_from_c(s).unwrap_or_else(|_| panic!("Failed to parse type: {}", s)), + ty: type_from_c(s).unwrap_or_else(|_| panic!("Failed to parse type: {s}")), constraints: vec![], } } diff --git a/library/stdarch/crates/intrinsic-test/src/intrinsic.rs b/library/stdarch/crates/intrinsic-test/src/intrinsic.rs index e0645a36b..fb4eb4cb7 100644 --- a/library/stdarch/crates/intrinsic-test/src/intrinsic.rs +++ b/library/stdarch/crates/intrinsic-test/src/intrinsic.rs @@ -109,7 +109,7 @@ impl Intrinsic { pub fn generate_loop_rust(&self, additional: &str, passes: u32) -> String { let constraints = self.arguments.as_constraint_parameters_rust(); let constraints = if !constraints.is_empty() { - format!("::<{}>", constraints) + format!("::<{constraints}>") } else { constraints }; diff --git a/library/stdarch/crates/intrinsic-test/src/main.rs b/library/stdarch/crates/intrinsic-test/src/main.rs index 43f2df08b..dac934574 100644 --- a/library/stdarch/crates/intrinsic-test/src/main.rs +++ b/library/stdarch/crates/intrinsic-test/src/main.rs @@ -58,7 +58,7 @@ fn gen_code_c( pass = gen_code_c( intrinsic, constraints, - format!("{}-{}", name, i), + format!("{name}-{i}"), p64_armv7_workaround ) ) @@ -117,7 +117,7 @@ int main(int argc, char **argv) {{ }}"#, header_files = header_files .iter() - .map(|header| format!("#include <{}>", header)) + .map(|header| format!("#include <{header}>")) .collect::<Vec<_>>() .join("\n"), arglists = intrinsic.arguments.gen_arglists_c(PASSES), @@ -148,7 +148,7 @@ fn gen_code_rust(intrinsic: &Intrinsic, constraints: &[&Argument], name: String) name = current.name, ty = current.ty.rust_type(), val = i, - pass = gen_code_rust(intrinsic, constraints, format!("{}-{}", name, i)) + pass = gen_code_rust(intrinsic, constraints, format!("{name}-{i}")) ) }) .collect() @@ -237,7 +237,7 @@ fn build_rust(intrinsics: &Vec<Intrinsic>, toolchain: &str, a32: bool) -> bool { intrinsics.iter().for_each(|i| { let rust_dir = format!(r#"rust_programs/{}"#, i.name); let _ = std::fs::create_dir_all(&rust_dir); - let rust_filename = format!(r#"{}/main.rs"#, rust_dir); + let rust_filename = format!(r#"{rust_dir}/main.rs"#); let mut file = File::create(&rust_filename).unwrap(); let c_code = generate_rust_program(&i, a32); @@ -355,7 +355,7 @@ fn main() { let filename = matches.value_of("INPUT").unwrap(); let toolchain = matches .value_of("TOOLCHAIN") - .map_or("".into(), |t| format!("+{}", t)); + .map_or("".into(), |t| format!("+{t}")); let cpp_compiler = matches.value_of("CPPCOMPILER").unwrap(); let c_runner = matches.value_of("RUNNER").unwrap_or(""); @@ -443,7 +443,7 @@ fn compare_outputs(intrinsics: &Vec<Intrinsic>, toolchain: &str, runner: &str, a let (c, rust) = match (c, rust) { (Ok(c), Ok(rust)) => (c, rust), - a => panic!("{:#?}", a), + a => panic!("{a:#?}"), }; if !c.status.success() { @@ -480,20 +480,20 @@ fn compare_outputs(intrinsics: &Vec<Intrinsic>, toolchain: &str, runner: &str, a intrinsics.iter().for_each(|reason| match reason { FailureReason::Difference(intrinsic, c, rust) => { - println!("Difference for intrinsic: {}", intrinsic); + println!("Difference for intrinsic: {intrinsic}"); let diff = diff::lines(c, rust); diff.iter().for_each(|diff| match diff { - diff::Result::Left(c) => println!("C: {}", c), - diff::Result::Right(rust) => println!("Rust: {}", rust), + diff::Result::Left(c) => println!("C: {c}"), + diff::Result::Right(rust) => println!("Rust: {rust}"), diff::Result::Both(_, _) => (), }); println!("****************************************************************"); } FailureReason::RunC(intrinsic) => { - println!("Failed to run C program for intrinsic {}", intrinsic) + println!("Failed to run C program for intrinsic {intrinsic}") } FailureReason::RunRust(intrinsic) => { - println!("Failed to run rust program for intrinsic {}", intrinsic) + println!("Failed to run rust program for intrinsic {intrinsic}") } }); println!("{} differences found", intrinsics.len()); diff --git a/library/stdarch/crates/intrinsic-test/src/types.rs b/library/stdarch/crates/intrinsic-test/src/types.rs index dd23586e7..7442ad5e6 100644 --- a/library/stdarch/crates/intrinsic-test/src/types.rs +++ b/library/stdarch/crates/intrinsic-test/src/types.rs @@ -25,7 +25,7 @@ impl FromStr for TypeKind { "poly" => Ok(Self::Poly), "uint" | "unsigned" => Ok(Self::UInt), "void" => Ok(Self::Void), - _ => Err(format!("Impossible to parse argument kind {}", s)), + _ => Err(format!("Impossible to parse argument kind {s}")), } } } @@ -199,14 +199,14 @@ impl IntrinsicType { simd_len: Some(simd_len), vec_len: None, .. - } => format!("{}{}x{}_t", kind.c_prefix(), bit_len, simd_len), + } => format!("{}{bit_len}x{simd_len}_t", kind.c_prefix()), IntrinsicType::Type { kind, bit_len: Some(bit_len), simd_len: Some(simd_len), vec_len: Some(vec_len), .. - } => format!("{}{}x{}x{}_t", kind.c_prefix(), bit_len, simd_len, vec_len), + } => format!("{}{bit_len}x{simd_len}x{vec_len}_t", kind.c_prefix()), _ => todo!("{:#?}", self), } } @@ -220,7 +220,7 @@ impl IntrinsicType { simd_len: Some(simd_len), vec_len: Some(_), .. - } => format!("{}{}x{}_t", kind.c_prefix(), bit_len, simd_len), + } => format!("{}{bit_len}x{simd_len}_t", kind.c_prefix()), _ => unreachable!("Shouldn't be called on this type"), } } @@ -234,21 +234,21 @@ impl IntrinsicType { simd_len: None, vec_len: None, .. - } => format!("{}{}", kind.rust_prefix(), bit_len), + } => format!("{}{bit_len}", kind.rust_prefix()), IntrinsicType::Type { kind, bit_len: Some(bit_len), simd_len: Some(simd_len), vec_len: None, .. - } => format!("{}{}x{}_t", kind.c_prefix(), bit_len, simd_len), + } => format!("{}{bit_len}x{simd_len}_t", kind.c_prefix()), IntrinsicType::Type { kind, bit_len: Some(bit_len), simd_len: Some(simd_len), vec_len: Some(vec_len), .. - } => format!("{}{}x{}x{}_t", kind.c_prefix(), bit_len, simd_len, vec_len), + } => format!("{}{bit_len}x{simd_len}x{vec_len}_t", kind.c_prefix()), _ => todo!("{:#?}", self), } } diff --git a/library/stdarch/crates/intrinsic-test/src/values.rs b/library/stdarch/crates/intrinsic-test/src/values.rs index 64b4d9fc9..68dd30d44 100644 --- a/library/stdarch/crates/intrinsic-test/src/values.rs +++ b/library/stdarch/crates/intrinsic-test/src/values.rs @@ -13,7 +13,7 @@ pub fn value_for_array(bits: u32, index: u32) -> String { } else if bits == 64 { format!("{:#X}", VALUES_64[index % VALUES_64.len()]) } else { - panic!("Unknown size: {}", bits); + panic!("Unknown size: {bits}"); } } |