projects
/
power-instruction-analyzer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
06189a1
)
updating instruction models
author
Jacob Lifshay
<programmerjake@gmail.com>
Thu, 9 Jul 2020 05:06:02 +0000
(22:06 -0700)
committer
Jacob Lifshay
<programmerjake@gmail.com>
Thu, 9 Jul 2020 05:06:02 +0000
(22:06 -0700)
src/instr_models.rs
patch
|
blob
|
history
diff --git
a/src/instr_models.rs
b/src/instr_models.rs
index de5232fb097ff42d8977437184ff0d613727f2da..8908bf047c0644fa6f2e23dace59c271e7ccecc9 100644
(file)
--- a/
src/instr_models.rs
+++ b/
src/instr_models.rs
@@
-134,7
+134,8
@@
pub fn divduo(inputs: InstructionInput) -> InstructionResult {
}
}
}
}
-create_instr_variants_ov_cr!(divwe, divweo, divwe_, divweo_, i32);
+// ISA doesn't define compare results -- POWER9 apparently uses i64 instead of i32
+create_instr_variants_ov_cr!(divwe, divweo, divwe_, divweo_, i64);
pub fn divweo(inputs: InstructionInput) -> InstructionResult {
let dividend = i64::from(inputs.ra as i32) << 32;
pub fn divweo(inputs: InstructionInput) -> InstructionResult {
let dividend = i64::from(inputs.ra as i32) << 32;
@@
-161,7
+162,8
@@
pub fn divweo(inputs: InstructionInput) -> InstructionResult {
}
}
}
}
-create_instr_variants_ov_cr!(divweu, divweuo, divweu_, divweuo_, i32);
+// ISA doesn't define compare results -- POWER9 apparently uses i64 instead of i32
+create_instr_variants_ov_cr!(divweu, divweuo, divweu_, divweuo_, i64);
pub fn divweuo(inputs: InstructionInput) -> InstructionResult {
let dividend = u64::from(inputs.ra as u32) << 32;
pub fn divweuo(inputs: InstructionInput) -> InstructionResult {
let dividend = u64::from(inputs.ra as u32) << 32;
@@
-188,7
+190,8
@@
pub fn divweuo(inputs: InstructionInput) -> InstructionResult {
}
}
}
}
-create_instr_variants_ov_cr!(divw, divwo, divw_, divwo_, i32);
+// ISA doesn't define compare results -- POWER9 apparently uses i64 instead of i32
+create_instr_variants_ov_cr!(divw, divwo, divw_, divwo_, i64);
pub fn divwo(inputs: InstructionInput) -> InstructionResult {
let dividend = inputs.ra as i32;
pub fn divwo(inputs: InstructionInput) -> InstructionResult {
let dividend = inputs.ra as i32;
@@
-209,7
+212,8
@@
pub fn divwo(inputs: InstructionInput) -> InstructionResult {
}
}
}
}
-create_instr_variants_ov_cr!(divwu, divwuo, divwu_, divwuo_, i32);
+// ISA doesn't define compare results -- POWER9 apparently uses i64 instead of i32
+create_instr_variants_ov_cr!(divwu, divwuo, divwu_, divwuo_, i64);
pub fn divwuo(inputs: InstructionInput) -> InstructionResult {
let dividend = inputs.ra as u32;
pub fn divwuo(inputs: InstructionInput) -> InstructionResult {
let dividend = inputs.ra as u32;
@@
-293,10
+297,10
@@
pub fn moduw(inputs: InstructionInput) -> InstructionResult {
create_instr_variants_ov_cr!(mullw, mullwo, mullw_, mullwo_, i32);
pub fn mullwo(inputs: InstructionInput) -> InstructionResult {
create_instr_variants_ov_cr!(mullw, mullwo, mullw_, mullwo_, i32);
pub fn mullwo(inputs: InstructionInput) -> InstructionResult {
- let ra = inputs.ra as i32;
- let rb = inputs.rb as i32;
+ let ra = inputs.ra as i32
as i64
;
+ let rb = inputs.rb as i32
as i64
;
let result = ra.wrapping_mul(rb) as u64;
let result = ra.wrapping_mul(rb) as u64;
- let overflow = r
a.checked_mul(rb).is_none()
;
+ let overflow = r
esult as i32 as i64 != result as i64
;
InstructionResult {
rt: Some(result),
overflow: Some(OverflowFlags::from_overflow(overflow)),
InstructionResult {
rt: Some(result),
overflow: Some(OverflowFlags::from_overflow(overflow)),