Skip to content

Commit 1ddb2d0

Browse files
chore: formatting
1 parent c0e8a27 commit 1ddb2d0

File tree

6 files changed

+29
-13
lines changed

6 files changed

+29
-13
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/intrinsic-test/src/loongarch/intrinsic.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ impl IntrinsicDefinition<LoongArchIntrinsicType> for Intrinsic<LoongArchIntrinsi
4040
/// rust debug output format for the return type. The generated line assumes
4141
/// there is an int i in scope which is the current pass number.
4242
fn print_result_c(&self, indentation: Indentation, additional: &str) -> String {
43-
unimplemented!("print_result_c of IntrinsicDefinition<LoongArchIntrinsicType> is not defined!")
43+
unimplemented!(
44+
"print_result_c of IntrinsicDefinition<LoongArchIntrinsicType> is not defined!"
45+
)
4446
}
4547
}

crates/intrinsic-test/src/loongarch/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ use std::fs::{self, File};
66

77
use rayon::prelude::*;
88

9-
use crate::common::intrinsic_helpers::TypeKind;
109
use crate::common::SupportedArchitectureTest;
1110
use crate::common::cli::ProcessedCli;
1211
use crate::common::compare::compare_outputs;
12+
use crate::common::intrinsic_helpers::TypeKind;
1313

1414
use crate::common::intrinsic::Intrinsic;
1515
use crate::loongarch::parser::get_loongson_intrinsics;

crates/intrinsic-test/src/loongarch/parser.rs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ use crate::loongarch::intrinsic::LoongArchIntrinsicType;
88

99
pub fn get_loongson_intrinsics(
1010
path: &Path,
11-
target: &str
11+
target: &str,
1212
) -> Result<Vec<Intrinsic<LoongArchIntrinsicType>>, Box<dyn std::error::Error>> {
1313
let f = File::open(path).unwrap_or_else(|_| panic!("Failed to open {}", path.display()));
1414
let f = BufReader::new(f);
15-
15+
1616
let mut current_name: Option<String> = None;
1717
let mut asm_fmts: Vec<String> = Vec::new();
1818

@@ -42,20 +42,26 @@ pub fn get_loongson_intrinsics(
4242
let data_types_len = data_types.len();
4343
if data_types_len > 0 && data_types_len < 6 {
4444
arguments = data_types.split_off(1);
45-
45+
4646
// Being explicit here with the variable name
4747
return_type = data_types.get(0).unwrap();
48-
} else {
48+
} else {
4949
panic!("DEBUG: line: {0} len: {1}", line, data_types.len());
5050
}
5151

52-
let intrinsic = gen_intrinsic(current_name.as_str(), asm_fmts.clone(), arguments, return_type, target);
52+
let intrinsic = gen_intrinsic(
53+
current_name.as_str(),
54+
asm_fmts.clone(),
55+
arguments,
56+
return_type,
57+
target,
58+
);
5359
if intrinsic.is_ok() {
5460
intrinsics.push(intrinsic.unwrap());
5561
}
5662
}
57-
};
58-
return Ok(intrinsics)
63+
}
64+
return Ok(intrinsics);
5965
}
6066

6167
fn gen_intrinsic(
@@ -72,7 +78,8 @@ fn gen_intrinsic(
7278
.enumerate()
7379
.map(|(i, (asm_fmt, arg_type))| {
7480
let ty = LoongArchIntrinsicType::from_values(asm_fmt, arg_type).unwrap();
75-
let arg = Argument::<LoongArchIntrinsicType>::new(i, format!("_{i}_{}", arg_type), ty, None);
81+
let arg =
82+
Argument::<LoongArchIntrinsicType>::new(i, format!("_{i}_{}", arg_type), ty, None);
7683
return arg;
7784
})
7885
.collect::<Vec<Argument<LoongArchIntrinsicType>>>();
@@ -117,7 +124,7 @@ fn gen_intrinsic(
117124
("si8", t) => {
118125
arguments[2].ty.constant = true;
119126
arguments[3].ty.constant = true;
120-
},
127+
}
121128
(_, _) => panic!(
122129
"unsupported assembly format: {:?} for {}",
123130
asm_fmts, current_name
@@ -132,4 +139,4 @@ fn gen_intrinsic(
132139
results: results,
133140
arch_tags: vec![target.to_string()],
134141
})
135-
}
142+
}

crates/intrinsic-test/src/loongarch/types.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
use super::intrinsic::LoongArchIntrinsicType;
22
use crate::common::cli::Language;
3+
<<<<<<< HEAD
4+
=======
5+
use crate::common::intrinsic_helpers::Sign;
6+
>>>>>>> b094de07 (chenj)
37
use crate::common::intrinsic_helpers::{IntrinsicType, IntrinsicTypeDefinition, TypeKind};
48

59
impl IntrinsicTypeDefinition for LoongArchIntrinsicType {

crates/intrinsic-test/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ fn main() {
2424
Some(ArmArchitectureTest::create(processed_cli_options))
2525
}
2626

27-
"loongarch64-unknown-linux-gnu" => Some(LoongArchArchitectureTest::create(processed_cli_options)),
27+
"loongarch64-unknown-linux-gnu" => {
28+
Some(LoongArchArchitectureTest::create(processed_cli_options))
29+
}
2830
_ => None,
2931
};
3032

0 commit comments

Comments
 (0)