Skip to content

Commit

Permalink
cpu-o3: fix fsqrt_s execute clock cycle
Browse files Browse the repository at this point in the history
Remove the acceleration optimization when rs2 is approximately equal to 1, and the fsqrt_s clock is corrected to 8.

Change-Id: I2c835f9856a3ef6b003b24aaeb0d96ff49812f43
  • Loading branch information
zephyrols committed Mar 5, 2025
1 parent d865947 commit 844e2bb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/cpu/o3/inst_queue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -583,19 +583,17 @@ InstructionQueue::execLatencyCheck(const DynInstPtr& inst, uint32_t& op_latency)
if (__isnanf(*((float*)(&rs1))) ||
__isnanf(*((float*)(&rs2))) ||
__isinff(*((float*)(&rs1))) ||
__isinff(*((float*)(&rs2))) ||
(*((float*)(&rs2)) - 1.0f < 1e-6f)) {
__isinff(*((float*)(&rs2)))) {
op_latency = 2;
break;
}
op_latency = 10;
op_latency = 8;
break;
case 64:
if (__isnan(*((double*)(&rs1))) ||
__isnan(*((double*)(&rs2))) ||
__isinf(*((double*)(&rs1))) ||
__isinf(*((double*)(&rs2))) ||
(*((double*)(&rs2)) - 1.0 < 1e-15)) {
__isinf(*((double*)(&rs2)))) {
op_latency = 2;
break;
}
Expand Down

0 comments on commit 844e2bb

Please sign in to comment.