Rev. 1.50, 10/04, page 411 of 448
10.3.21 FSQRT (Floating-point Square Root): Floating-Point Instruction
PR
Format
Operation
Instruction Code
Cycle
T Bit
0
FSQRT FRn
sqrt (FRn)
*
→
FRn
1111nnnn01101101
14 —
1
FSQRT DRn
sqrt (DRn)
*
→
DRn
1111nnn001101101
30 —
Note:
*
sqrt(FRn) and sqrt(DRn) are the square roots of FRn and DRn, respectively.
Description:
When FPSCR.PR = 0: Finds the arithmetical square root of the single-precision
floating-point number in FRn, and stores the result in FRn.
When FPSCR.PR = 1: Finds the arithmetical square root of the double-precision floating-point
number in DRn, and stores the result in DRn.
When FPSCR.enable.I is set, an FPU exception trap is generated regardless of whether or not an
exception has occurred. When an exception occurs, correct exception information is reflected in
FPSCR.cause and FPSCR.flag, and FRn or DRn is not updated. Appropriate processing should
therefore be performed by software.
Notes:
None
Operation:
void FSQRT(int n){
pc += 2;
clear_cause();
switch(data_type_of(n)){
case NORM : if(sign_of(n) == 0) normal_ fsqrt(n);
else invalid(n); break;
case DENORM: if(sign_of(n) == 0) set_E();
else invalid(n); break;
case PZERO :
case NZERO :
case PINF : break;
case NINF : invalid(n); break;
case qNaN : qnan(n); break;
case sNaN : invalid(n); break;
}
}
Summary of Contents for SuperH SH-4A
Page 2: ...Rev 1 50 10 04 page ii of xx ...
Page 8: ...Rev 1 50 10 04 page viii of xx ...
Page 116: ...Rev 1 50 10 04 page 96 of 448 ...
Page 178: ...Rev 1 50 10 04 page 158 of 448 ...
Page 206: ...Rev 1 50 10 04 page 186 of 448 ...
Page 231: ...Rev 1 50 10 04 page 211 of 448 Possible Exceptions Slot illegal instruction exception ...
Page 235: ...Rev 1 50 10 04 page 215 of 448 Possible Exceptions Slot illegal instruction exception ...
Page 238: ...Rev 1 50 10 04 page 218 of 448 Possible Exceptions Slot illegal instruction exception ...
Page 408: ...Rev 1 50 10 04 page 388 of 448 Possible Exceptions Inexact Not generated when FPSCR PR 1 ...
Page 446: ...Rev 1 50 10 04 page 426 of 448 ...
Page 468: ...Rev 1 50 10 04 page 448 of 448 ...
Page 471: ......
Page 472: ...SH 4A Software Manual ...