4.9 Floating-Point Instruction Description

ABSAbsolute value of Fs
Syntax:{label:}ABS.sFs,Fd
ABS.d
Operands (.s):Fs ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fd ∈ [F0, F2 ... F30]
Operation:ABS Fs → Fd
Status Affected:SUBO
Exceptions Possible:SUBO
Encoding:1000100PzzdddddsssssUUUUUUUU0010
Description:Clear the sign of the contents of the source register Fs, and place the result in the destination register Fd.

The ‘P’ bit selects single (.s) or double precision (.d) operation.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

I-Words:1
SP Execute Cycles:1
DP Execute Cycles:1
Repetition Rate:1
Note: This instruction only affects the sign bit and will not quit an sNaN input operand.
Example:1ABS.s F0, F3 ;Find absolute value of a number in F0 and store result in F3
Before executionAfter execution
F00x40800001-1.0000001F00x40800001
F30x00000000F30x40800001
FSR[7:0]8'b00000000FSR[7:0]8'b00000000
Example:2ABS.d F0, F2 ;Find absolute of a number in F1:F0 and store result in F3:F2
Before executionAfter execution
F1:F00x8000000000000001F1:F00x8000000000000001
F3:F20x0000000000000000F3:F20x0000000000000001
FSR[7:0]8'b00000000FSR[7:0]8'b01000000(SUBO)(SUBO)
ADDAdd Fb and Fs
Syntax:{label:}ADD.s Fb,Fs,Fd
ADD.d
Operands (.s):Fs ∈ [F0 ... F31]; Fb ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fb ∈ [F0, F2 ... F30]; Fd ∈ [F0, F2 ... F30]
Operation:Fb + Fs → Fd
Status Affected:SUBO, INX, UDF, OVF, INVAL (see Note 1)
Exceptions Possible:SUBO, INX, UDF, OVF, INVAL
Encoding:1000000PzzdddddssssswwwwwUUU0010
Description:Add the contents of the source register Fb and the contents of the register Fs, then place the result in the destination register Fd.

(∞ + (-∞)) will result in distinguished qNaN and signal an INVAL exception.

The ‘P’ bit selects single (.s) or double precision (.d) operation.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘d’ bits select the destination register.

Note:
  1. If not already set, corresponding sticky exception status will also be set.
  2. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
I-Words:1
SP Execute Cycles:2
DP Execute Cycles:2
Repetition Rate:1
ANDAND Floating-Point Control/Status Register and Literal
Syntax:{label:}ANDlit16,FSR
FCR
FEAR
Operandlit16 ∈ [0 ... 65535]
Operation:(FP special register[15:0]).AND.lit16 → FP special register[15:0]
Status Affected:None (other than as a result of the instruction AND operation)
Exceptions Possible:None
Encoding:1001000Uzzsskkkkkkkkkkkkkkkk0010
Description:Compute the AND of the lsw contents of the selected floating-point coprocessor special register and the literal operand, and write the result back into the lsw of the selected register.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the floating-point coprocessor source register.

The ‘k’ bits specify the 16-bit literal operand.

Note:
  1. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
  2. The effect of this instruction is solely to clear bits within the target register. No FPU interrupts can result from its execution.
  3. FEAR destination includes the EACE control/status bit.
I-Words:1
Execute Cycles:1
Repetition Rate:1
Example:1AND #FFF8, FCR;FCR | 0x7 -> To clear INVAL, DIV0 and OVM masks
Before executionAfter execution
FCR0x00000300FCR0x00000307
COS Evaluate the Cosine of Fs
Syntax:{label:}COS.sFs,Fd
Operands (.s):Fs ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]
Operation:cos(Fs) → Fd
Status Affected:SUBO, INX, UDF, INVAL (see Note 1)
Exceptions Possible:SUBO, INX, UDF, INVAL
Encoding:1000110PzzdddddsssssUUUUUUUU0110
Description:Calculate the cosine of the contents of the source register Fs
(where Fs = [2πk + θ rads]), and place the result in the destination register Fd.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register

The ‘d’ bits select the destination register.

Note:
  1. If not already set, corresponding sticky exception status will also be set.
  2. This operation is only supported using single precision floating-point.
  3. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
I-Words:1
SP Execute Cycles:4
Repetition Rate:1
Example:1COS.s F0, F3;Find Cosine of radians in F0 and store result in F3
Before executionAfter execution
F00x4016DB6EF00x4016DB6E
F30x00000000F30xBF3530E2
FSR[7:0]8'b00000000FSR[7:0]8'b00000000
Example:2COS.s F0, F3 ;Find Cosine of radians in F0 and store result in F3
Before executionAfter execution
F00xFF800000F00xFF800000
F30x00000000F30x7FC00001(distinguished qNaN)
FSR[7:0]8'b00000000FSR[7:0]8'b00000001(INVAL)
CPQCompare Fb with Fs, Quiet Signaling
Syntax:{label:}CPQ.sFb,Fs
CPQ.d
Operands (.s):Fs ∈ [F0 ... F31]; Fb ∈ [F0 ... F31]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fb ∈ [F0, F2 ... F30]
Operation:Fb - Fs (with IEEE signaling predicates)
Status Affected:LT, GT, EQ, UN, SUBO, INVAL (see Note 1)
Exceptions Possible:SUBO, INVAL
Encoding:1000101PzzUUUUUssssswwwwwUUU1010
Description:Compare of the contents of the source registers Fb and Fs (Fb - Fs) then set flags, but do not store the result. An Invalid signaling exception will only be generated if either source operand is a sNaN. A qNaN source operand will not result in a signaling exception.

If any source operand is a sNaN or qNaN, then set FSR.UN = 1.

The LT, GT and EQ status bits are set depending on the result.

The ‘P’ bit selects single (32-bit) or double precision (64-bit) operation.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

Note:
  1. If not already set, corresponding sticky exception status will also be set.
  2. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
  3. This instruction considers -0 and +0 as equivalent.
I-Words:1
SP Execute Cycles:1
DP Execute Cycles:1
Repetition Rate:1
Example:1CPQ.s F0, F3;(Queit Signaling)Compare F0 and F3; update FSR[23:16]
Before executionAfter execution
F00xFF7FFFFBF00xFF7FFFFB
F30x80800001F30x80800001
FSR[23:16] 8'b00000000FSR[23:16] 8'b00000100(LT)
Example:2CPQ.d F0, F2;(Queit Signaling)Compare F1:F0 and F3:F2; update FSR[23:16]
Before executionAfter execution
F1:F00xFFF800000000000EF1:F00xFFF800000000000E
F3:F20xFFF8000000000008F3:F20xFFF8000000000008
FSR[23:16] 8'b00000000FSR[23:16] 8'b00000001(UN)
FSR[7:0] 8'b00000000FSR[23:16] 8'b00000000
CPSCompare Fb with Fs, Signaling
Syntax:{label:}CPS.sFb,Fs
CPS.d
Operands (.s):Fs ∈ [F0 ... F31]; Fb ∈ [F0 ... F31]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fb ∈ [F0, F2 ... F30]
Operation:Fb - Fs (with IEEE signaling predicates)
Status Affected:LT, GT, EQ, UN, SUBO, INVAL (see Note 1)
Exceptions Possible:SUBO, INVAL
Encoding:1000101PzzUUUUUssssswwwwwUUU1110
Description:Compare of the contents of the source registers Fb and Fs (Fb - Fs) then set flags, but do not store the result. If either source operand is a sNaN or a qNaN, an Invalid signaling exception will be generated.

If any source operand is a sNaN or qNaN, then set FSR.UN = 1.

The LT, GT and EQ status bits are set depending on the result.

The ‘P’ bit selects single (32-bit) or double precision (64-bit) operation.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

Note:
  1. If not already set, corresponding sticky exception status will also be set.
  2. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
  3. This instruction consider -0 and +0 as equivalent.
I-Words:1
SP Execute Cycles:1
DP Execute Cycles:1
Repetition Rate:1
Example:1CPS.s F0, F3;(Signaling)Compare F0 and F3

; update FSR[23:16]

Before executionAfter execution
F00xFF7FFFFBF00xFF7FFFFB
F30x80800001F30x80800001
FSR[23:16] 8'b00000000FSR[23:16] 8'b00000100(LT)
Example:2CPS.d F0, F2;(Signaling)Compare F1:F0 and F3:F2

; update FSR[23:16]

Before executionAfter execution
F1:F00xFFF800000000000EF1:F00xFFF800000000000E
F3:F20xFFF8000000000008F3:F20xFFF8000000000008
FSR[23:16] 8'b00000000FSR[23:16] 8'b00000001(UN)
FSR[7:0] 8'b00000000FSR[23:16] 8'b00000001(INVAL)
DI2FConvert Double Word (64-bit) Integer to Floating Point
Syntax:{label:}DI2F.s{rnd}Fs,Fd
DI2F.d{rnd}
Operands (.s):Fs ∈ [F0, F2 ... F30]; Fd ∈ [F0 ... F31]; rnd ∈ [e, z, p, n]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fd ∈ [F0, F2 ... F30]; rnd ∈ [e, z, p, n]
Operation:Fs (integer) → Fd (float)
Status Affected:INX1
Exceptions Possible:INX
Encoding:1000111PzzdddddsssssUUUUUeee1110
Description:Convert the 64-bit integer contents of the source register Fs to floating point, round, then place the result in the destination register Fd. If rounding mode {rnd} is not specified, it will default to that defined by FCR.RND[1:0]. If the integer cannot be represented exactly as a floating point value, the Inexact signaling exception will be generated.

The ‘P’ bit selects single (.s) or double precision (.d) operation.

The ‘e’ bits define the rounding mode applied.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

Note:
  1. If not already set, corresponding sticky exception status will also be set.
  2. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
I-Words:1
SP Execute Cycles:2
DP Execute Cycles:2
Repetition Rate:1
Example:1DI2F.sp F0, F2;Convert 64-bit double long-word integer to a SP floating-point value (with rounding = pos)
Before executionAfter execution
F1:F00x7FFFFFFFFFFFFFFBF1:F00x7FFFFFFFFFFFFFFB
F20x00000000F20x5EFFFFFF
FSR[7:0]8'b00000000FSR[7:0]8'b00010000(INX)
Example:2DI2F.dz F0, F2;Convert 64-bit double long-word integer to a DP floating-point value (with rounding = zero)
Before executionAfter execution
F1:F00xFFFFFFFFFFFFFFFFF1:F00xFFFFFFFFFFFFFFFF
F3:F20x0000000000000000F3:F20xBFF0000000000000
DIVSigned Floating-Point Divide
Syntax:{label:}DIV.sFbFs,Fd
DIV.d
Operands (.s):Fs ∈ [F0 ... F31]; Fb ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fb ∈ [F0, F2 ... F30]; Fd ∈ [F0, F2 ... F30]
Operation:Fb ÷ Fs → Fd
Status Affected:SUBO, INX, UDF, OVF, DIV0, INVAL (see Note 1)
Exceptions Possible:SUBO, INX, UDF, OVF, DIV0, INVAL
Encoding:1000010PzzdddddssssswwwwwUUU1010
Description:Divide the contents of the source register Fb with the contents of the source register Fs, then place the result in the destination register Fd.

Result of (∞/0) is correctly signed infinity. Whereas, ((0/0) or (∞/∞)) will result in distinguished qNaN and signal an FPU INVAL exception.

The ‘P’ bit selects single (.s) or double precision (.d) operation.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘d’ bits select the destination register.

Note:
  1. If not already set, corresponding sticky exception status will also be set.
  2. An attempt to divide by zero may or may not signal DIV0 depending upon operands.
  3. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
I-Words:1
SP Execute Cycles:11
DP Execute Cycles:32
Example:1DIV.s F0, F1, F3;Divide the contents in F0 by F1 and store the result in F3
Before executionAfter execution
F00x7F00000AF00x7F00000A
F10xFF0000AAF10xFF0000AA
F30x00000000F30xBF7FFEC0
FSR[7:0]8'b00000000FSR[7:0]8'b00000000
Example:2DIV.d F0, F4, F8;Divide the contents in F1:F0 by F5:F4 and store the results in F9:F8
Before executionAfter execution
F1:F00xFFEA36E2EB1C432DF1:F00xFFEA36E2EB1C432D
F5:F40x0000000000A00000F5:F40x0000000000A00000
F9:F80x0000000000000000F9:F80xFFEFFFFFFFFFFFFF
FSR[7:0]8'b00000000FSR[7:0]8'b01010100(INX, OVF, SUBO)
FLIM Force Signed Data Limit
Syntax:{label:}FLIM.sFb,Fs,Fd
FLIM.d
Operands (.s):Fs ∈ [F0 ... F31]; Fb ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fb ∈ [F0, F2 ... F30]; Fd ∈ [F0, F2 ... F30]
Operation:IF (Fd) > (Fs) THEN (Fs) → (Fd);

IF (Fd) < (Fb) THEN (Fb) → (Fd);

Status Affected:SUBO, INVAL (see Note 1)
Exceptions Possible:SUBO, INVAL
Encoding:1001001PzzdddddssssswwwwwUUU0010
Description:Simultaneously compare a signed floating-point value in Fd to a maximum signed floating-point value held in Fs and a minimum signed floating-point value held in Fb.

If Fd is greater than Fs, set Fd to the limit value held in Fs.

If Fd is less than Fb, set Fd to the limit value held in Fb.

If Fd is less than or equal to the maximum limit value in Fs, and greater than or equal to the minimum limit value in Fb, Fd is not modified (i.e., data is within range and limits are not applied). See note 2.

If any of the operands (limit values or value to be tested) are an sNaN or a qNaN, the instruction will return a qNaN as the result. In addition, if any of the operands are an sNaN, the INVAL status will be set.

Should the (maximum) limit value Fs be inadvertently set to less than (minimum) limit value Fb, the instruction will return the distinguished qNaN as the result and set the INVAL status.

This is a signed comparison operation. The limits may both be of the same sign.

The ‘P’ bit selects single (32-bit) or double precision (64-bit) operation.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘d’ bits select the destination register.

If not already set, corresponding sticky exception status will also be set.

Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.

I-Words:1
SP Execute Cycles:1
DP Execute Cycles:1
Repetition Rate:1
Example:1FLIM.s F3, F0, F1;Limit the value in F3 to be within values in F0 and F1
Before executionAfter execution
F00xFF669595F00xFF000000
F10xFF000000F10xFF000000
F30x44480000F30x44480000
Example:2FLIM.d F6, F4, F0;Limit the value in F7:F6 to be within values in F5:F4 and F1:F0
Before executionAfter execution
F1:F00xC024000000000000F1:F00xC014000000000000
F5:F40x4024000000000000F5:F40x4024000000000000
F9:F80xC014000000000000F9:F80xC014000000000000
F2DIConvert Floating-Point Fs to Double Word (64-bit) Integer
Syntax:{label:}F2DI.s{rnd}Fs,Fd
F2DI.d{rnd}
Operands (.s):Fs ∈ [F0 ... F31]; Fd ∈ [F0, F2 ... F30]; rnd ∈ [e, z, p, n]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fd ∈ [F0, F2 ... F30]; rnd ∈ [e, z, p, n]
Operation:Fs (float) → Fd (integer)
Status Affected:SUBO, HUGI, INX, INVAL (see Note 1)
Exceptions Possible:SUBO, HUGI, INX, INVAL
Encoding:1000111PzzdddddsssssUUUUUeee0110
Description:Convert the floating-point contents of the source register Fs to a rounded 64-bit integer, then place the result in the destination register Fd. If rounding mode {rnd} is not specified, it will default to that defined by FCR.RND[1:0].

If the source register contains ±NaN or ±∞, the INVAL exception will be signaled and the result will be the integer indefinite value of 0x8000_0000_0000_0000 (maximum negative integer).

If the source register contains a finite floating point number, but the result rounds to a number greater than 263-1 or less than -263, the HUGI and INVAL exceptions will be signaled and the default result will be the integer indefinite value of 0x7FFF_FFFF_FFFF_FFFF or 0x8000_0000_0000_0000, respectively.

If the source register contains a subnormal value, the result will always be zero and the INX exception will be signaled.


The ‘P’ bit selects single (.s) or double precision (.d) operation.

The ‘e’ bits define the rounding mode applied.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

Note:
  1. If not already set, corresponding sticky exception status will also be set.
  2. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
I-Words:1
SP Execute Cycles:1 (subject to change)
DP Execute Cycles:2 (subject to change)
Repetition Rate:1
Example:1F2DI.sp F0, F2;Convert SP float value to a 64-bit double long-word integer(with rounding = pos)
Before executionAfter execution
F00xD7FFFFFEF00xD7FFFFFE
F3:F20x0000000000000000F3:F20xFFFE000004000000
FSR[7:0]8'b00000000FSR[7:0]8'b00010000(INX)
Example:2F2DI.dz F0, F2;Convert DP float value to a 64-bit double long-word integer(with rounding = zero)
Before executionAfter execution
F1:F00xC2E4F8B5877B8000F1:F00xC2E4F8B5877B8000
F3:F20x0000000000000000F3:F20xFFFF583A53C42400
F2LIConvert Floating-Point Fs to Long Word (32-bit) Integer
Syntax:{label:}F2LI.s{rnd}Fs,Fd
F2LI.d{rnd}
Operands (.s):Fs ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]; rnd ∈ [e, z, p, n]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fd ∈ [F0 ... F31]; rnd ∈ [e, z, p, n]
Operation:Fs (float) → Fd (integer)
Status Affected:SUBO, HUGI, INX, INVAL (see Note 1)
Exceptions Possible:SUBO, HUGI, INX, INVAL
Encoding:1000111PzzdddddsssssUUUUUeee0010
Description:Convert the floating-point contents of the source register Fs to a rounded 32-bit integer, then place the result in the destination register Fd. If rounding mode {rnd} is not specified, it will default to that defined by FCR.RND[1:0].

If the source register contains ±NaN or ±∞, the INVAL exception will be signaled and the result will be the integer indefinite value of 0x8000_0000 (maximum negative integer).

If the source register contains a finite floating-point number but the result rounds to a number greater than 231-1 or less than -231, the HUGI and INVAL exceptions will be signaled and the default result will be the integer indefinite value of 0x7FFF_FFFF or 0x8000_0000, respectively.

If the source register contains a subnormal value, the result will always be zero and the INX exception will be signaled.

The ‘P’ bit selects single (.s) or double precision (.d) operation.

The ‘e’ bits define the rounding mode applied.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

Note:
  1. If not already set, corresponding sticky exception status will also be set.
  2. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
I-Words:1
SP Execute Cycles:1
DP Execute Cycles:2
Repetition Rate:1
Example:1F2LI.sp F0, F1;Convert SP float value to a long-word integer(with rounding = pos)
Before executionAfter execution
F00xCA0EF725F00xCA0EF725
F10x00000000F10xFFDC4237
FSR[7:0]8'b00000000FSR[7:0]8'b00010000(INX)
Example:2F2LI.dz F0, F2;Convert DP float value to a long-word integer(with rounding = zero)
Before executionAfter execution
F1:F00xC09F400000000000F1:F00xC09F400000000000
F20x00000000F20xFFFFF830
FBRA CC FPU Coprocessor Branch
Syntax:{label:}FBRA CC,Expr
Operands:Expr is resolved by the linker to a signed word offset (slit20)
Operation:

Condition (cc) = See Table x.y

If (cc) then {

If slit20 = 1 then skip next (16-bit) instruction

Else if (slit20 = 2 && next_op[31] = 1) then skip next (32-bit) instruction

Else (PC+4) + 2*slit20 → PC

}

Else no branch

Status Affected:None
Encoding:1011bbbbnnnnnnnnnnnnnnnnnnnnzz10
See Table 4-13 for the value of “bbbb”
Description:

If the branch condition is met, then the instruction will either skip the next 16-bit or 32-bit instruction, or it will branch to any size of instruction with a forward or backward range of 1MB.

If the 2’s complement byte offset value ‘2*slit20’ (the PC offset) equals two, the conditional branch will execute as a conditional skip of one 16-bit instruction. This instruction will be speculatively executed as not skipped until such time that the branch decision can be determined.

If the 2’s complement byte offset value ‘2*slit20’ (the PC offset) equals four and the instruction after the branch is a 32-bit opcode (see note), the conditional branch will execute as a conditional skip of that 32-bit instruction. This instruction will be speculatively executed as not skipped until such time that the branch decision can be determined.

If requirements for a conditional skip are not met, the 2’s complement byte offset value ‘2*slit20’ is added to the PC to create a new PS word address. Since the PC will have incremented to fetch the next instruction, the new address will be (PC+4) + 2*slit20.

Branch prediction is based on the direction of the branch. If the branch is backwards (negative), it will be predicted as taken. If the branch is forwards (positive), it will be predicted as not taken.

The two instructions that follow the branch will then be speculatively executed in the predicted path until such time that the actual branch decision can be assessed. A correctly predicted branch will continue instruction execution in the same path unabated. An incorrectly predicted branch will abort the speculatively executed instructions and start execution from the correct path.

The ‘n’ bits are a signed literal that specifies the number of PS words offset from (PC+4).

The ‘z’ bits select the target coprocessor.

FPU co-processor supports number of branch conditions (cc) as mentioned in folloowing table.

Table 4-13. FBRA Conditions
cc Conditions

Encoding

(bbbb)

EQ FSR.EQ 0000
UNE (FSR.GT || FSR.LT || FSR.UN) 0001
NE (FSR.GT || FSR.LT) 0010
UEQ (FSR.EQ || FSR.UN) 0011
GT FSR.GT 0100
ULE (FSR.LT || FSR.EQ || FSR.UN) 0101
GE (FSR.GT || FSR.EQ) 0110
ULT (FSR.LT || FSR.UN) 0111
LT FSR.LT 1000
UGE (FSR.GT || FSR.EQ || FSR.UN) 1001
LE (FSR.LT || FSR.EQ) 1010
UGT (FSR.GT || FSR.UN) 1011
OR (FSR.GT || FSR.LT || FSR.EQ) 1100
UN FSR.UN 1101
Note:
  1. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.

  2. Should the byte offset equal four and instruction after the branch is a 16-bit opcode, a branch will occur (over the next two 16-bit ops) if the condition is met.

  3. Branch conditions are evaluated within the coprocessor.

I-Words:1
Cycles:1 (2 or 3)
IORInclusive OR Floating-Point Control/Status Register and Literal
Syntax:{label:}IORlit16,FSR
FCR
FEAR
Operandlit16 ∈ [0 ... 65535]
Operation:(FP special register[15:0]).IOR.lit16 → FP special register[15:0]
Status Affected:None (other than as a result of the instruction OR operation)
Exceptions Possible:None
Encoding:1001000Uzzsskkkkkkkkkkkkkkkk0110
Description:Compute the inclusive OR of the contents of the lsw of the selected floating-point coprocessor register and the literal operand, and write the result back into the lsw of the selected register.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the floating-point coprocessor source register.

The ‘k’ bits specify the 16-bit literal operand.

Note:
  1. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
  2. The effect of this instruction is solely to set bits within the target register. No FPU interrupts can result from its execution.
  3. FEAR destination includes the EACE control/status bit.
I-Words:1
Execute Cycles:1
Repetition Rate:1
Example:1IOR #7, FCR;FCR | 0x7 -> To set INVAL, DIV0 and OVM masks
Before executionAfter execution
FCR0x00000300FCR0x00000307
LI2FConvert Long Word (32-bit) Integer to Floating-Point
Syntax:{label:}LI2F.s{rnd}Fs,Fd
LI2F.d{rnd}
Operands (.s):Fs ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]; rnd ∈ [e, z, p, n]
Operands (.d):Fs ∈ [F0 ... F31]; Fd ∈ [F0, F2 ... F30]; rnd ∈ [e, z, p, n]3
Operation:Fs (integer) → Fd (float)
Status Affected:INX1, 3
Exceptions Possible:INX
Encoding:1000111PzzdddddsssssUUUUUeee1010
Description:Convert the 32-bit integer contents of the source register Fs to floating-point, round, and then place the result in the destination register Fd. If rounding mode {rnd} is not specified, it will default to that defined by FCR.RND[1:0]. If the integer cannot be represented exactly as a floating-point value, the Inexact signaling exception will be generated (see note 3).

The ‘P’ bit selects single (.s) or double precision (.d) operation.

The ‘e’ bits define the rounding mode applied.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

Note:
  1. If not already set, corresponding sticky exception status will also be set.
  2. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
  3. Long integer to Double Precision float (LI2F.d) conversion are always exact, so Inexact (INX) status will never be set. Similarly, rounding modes will have no effect on LI2F.d result.
I-Words:1
SP Execute Cycles:1
DP Execute Cycles:1
Repetition Rate:1
Example:1LI2F.se F0, F1;Convert long-word integer to SP float value (with even rounding)
Before executionAfter execution
F00xFFFFF830F00xFFFFF830
F10x00000000F10xC4FA0000
Example:2LI2F.d F0, F2;Convert long-word integer to DP float value
Before executionAfter execution
F00xAFF0BDBCF00xAFF0BDBC
F3:F20x0000000000000000F3:F20xC1D403D091000000
MACFloating-Point Signed Multiply and Accumulate
Syntax:{label:}MAC.sFb,Fs,Fd
MAC.d
Operands (.s):Fs ∈ [F0 ... F31]; Fb ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fb ∈ [F0, F2 ... F30]; Fd ∈ [F0, F2 ... F30]
Operation:(Fd) + ((Fb) * (Fs)) → Fd;
Status Affected:SUBO, INX, UDF, OVF, INVAL (see Note 1)
Exceptions Possible:SUBO, INX, UDF, OVF, INVAL
Encoding:1000010PzzdddddssssswwwwwUUU0010
Description:Multiply the signed contents of the source register Fb with the signed contents of the source register Fs, then add the product to Fd.

The ‘P’ bit selects single (.s) or double precision (.d) operation.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘d’ bits select the destination register.

Note:
  1. If not already set, corresponding sticky exception status will also be set.
  2. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
I-Words:1
SP Execute Cycles:3
DP Execute Cycles:4
Repetition Rate:1
Example:1MAC.s F3, F0, F1;Multiply contents of F0, F1 and add the results with content in F3
Before executionAfter execution
F00x80FFFFFFF00x80FFFFFF
F10x00000000F10x00000000
F30x80FFFFFEF30x00000000
FSR[7:0]8'b00000000FSR[7:0]8'b00011000(UDF, INX)
Example:2MAC.d F6, F4, F0;Multiply contents of F1:F0, F5:F4 and add the results with content in F7:F6
Before executionAfter execution
F1:F00x4069000000000000F1:F00x4069000000000000
F5:F40x407F400000000000F5:F40x407F400000000000
F9:F80x4024000000000000F9:F80x40A3880000000000
FSR[7:0]8'b00000000FSR[7:0]8'b00000000
MAXSelect the Signed Maximum of Fb and Fs

{IEEE 754-2019 maximum(x,y)}

Syntax:{label:}MAX.s Fb,Fs,Fd
MAX.d
Operands (.s):Fs ∈ [F0 ... F31]; Fb ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fb ∈ [F0, F2 ... F30]; Fd ∈ [F0, F2 ... F30]
Operation:IF (Fs) >= (Fb) THEN (Fs) → (Fd);

ELSE (Fb) → (Fd)

Status Affected:SUBO, INVAL (see Note 1)
Exceptions Possible:SUBO, INVAL
Encoding:1000001PzzdddddssssswwwwwUUU0010
Description:Find the signed maximum of two floating-point values held in Fb and Fs. This instruction is compliant with the IEEE 754-2019 maximum() operation.

Compare the contents of the source registers Fb and Fs, then place the maximum of the two values in the destination register Fd. This is a signed comparison operation (see note 3). If Fb = Fs (and of the same sign), Fd is loaded with the contents of Fs.

When one (or both) of the input operands is a NaN, the instructions will return a qNaN.

The ‘P’ bit selects single (32-bit) or double precision (64-bit) operation.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘d’ bits select the destination register.

Note:
  1. If not already set, corresponding sticky exception status will also be set.
  2. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
  3. Operand value of -0 compares to less than +0.
I-Words:1
SP Execute Cycles:1
DP Execute Cycles:1
Repetition Rate:1
Example:1MAX.s F0, F1, F3;Returns maximum of F0, F1 to F3 (Follows IEEE 754-2019 maximum())
Before executionAfter execution
F00x7F800000F00x7F800000
F10xFF800000F10xFF800000
F30x00000000F30x7F800000
FSR[7:0]8'b00000000FSR[7:0]8'b00000000
Example:2MAX.d F0, F4, F8;Returns maximum of F1:F0, F5:F4 to F9:F8 (Follows IEEE 754-2019 maximum())
Before executionAfter execution
F1:F00x000000000000000AF1:F00x000000000000000A
F5:F40xC00000000000000CF5:F40xC00000000000000C
F9:F80x00000000000000F9:F80x000000000000000A
FSR[7:0]8'b00000000FSR[7:0]8'b01000000(SUBO)
MAXNMSelect the Signed Maximum of Fb and Fs

{IEEE 754-2019 maxmumNumber(x,y)}

Syntax:{label:}MAXNM.s Fb,Fs,Fd
MAXNM.d
Operands (.s):Fs ∈ [F0 ... F31]; Fb ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fb ∈ [F0, F2 ... F30]; Fd ∈ [F0, F2 ... F30]
Operation:IF (Fs) >= (Fb) THEN (Fs) → (Fd);

ELSE (Fb) → (Fd)

Status Affected:SUBO, INVAL (see Note 1)
Exceptions Possible:SUBO, INVAL
Encoding:1000001PzzdddddssssswwwwwUUU0110
Description:Find the signed maximum of two floating-point values held in Fb and Fs. This instruction is compliant with the IEEE 754-2019 maximumNumber() operation.

Compare the contents of the source registers Fb and Fs, then place the maximum of the two values in the destination register Fd. If Fb = Fs, Fd is loaded with the contents of Fs. This is a signed comparison operation (see note 3). If Fb = Fs (and of the same sign), Fd is loaded with the contents of Fs.

When one of the input operands is a NaN and the other input is a floating-point number (that is not a NaN), the instructions will return the floating-point number.

If both input operands are a NaN, the instructions will return a qNaN.

The ‘P’ bit selects single (32-bit) or double precision (64-bit) operation.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘d’ bits select the destination register.

Note:
  1. If not already set, corresponding sticky exception status will also be set.
  2. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
  3. Operand value of -0 compares to less than +0.
I-Words:1
SP Execute Cycles:1
DP Execute Cycles:1
Repetition Rate:1
Example:1MAXNM.s F0, F1, F3;Returns maximum of F0, F1 to F3
Before executionAfter execution
F00x00000000F00x00000000
F10x80000000F10x80000000
F30x00000000F30x00000000
FSR[7:0]8'b00000000FSR[7:0]8'b00000000
Example:2MAXNM.d F0, F4, F8;Returns maximum of F1:F0, F5:F4 to F9:F8
Before executionAfter execution
F1:F00x800000000000000AF1:F00x800000000000000A
F5:F40x3FF924920048245CF5:F40x3FF924920048245C
F9:F80x00000000000000F9:F80x3FF924920048245C
FSR[7:0]8'b00000000FSR[7:0]8'b01000000(SUBO)
MINSelect the Signed Minimum of Fb and Fs


{IEEE 754-2019 minimum(x,y)}

Syntax:{label:}MIN.sFb,Fs,Fd
MIN.d
Operands (.s):Fs ∈ [F0 ... F31]; Fb ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fb ∈ [F0, F2 ... F30]; Fd ∈ [F0, F2 ... F30]
Operation:IF (Fs) <= (Fb) THEN (Fs) → (Fd);

ELSE (Fb) → (Fd)

Status Affected:SUBO, INVAL (see note 1)
Exceptions Possible:SUBO, INVAL
Encoding:1000001PzzdddddssssswwwwwUUU1010
Description:Find the signed minimum of two floating-point values held in Fb and Fs. This instruction is compliant with the IEEE 754-2019 minimum() operation.

Compare the contents of the source registers Fb and Fs, then place the minimum of the two values in the destination register Fd. This is a signed comparison operation (see note 3). If Fb = Fs (and of the same sign), Fd is loaded with the contents of Fs.

When one (or both) of the input operands is a NaN, the instructions will return a qNaN.

The ‘P’ bit selects single (32-bit) or double precision (64-bit) operation.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘d’ bits select the destination register.

Note:
  1. If not already set, corresponding sticky exception status will also be set.
  2. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
  3. Operand value of -0 compares to less than +0.
I-Words:1
SP Execute Cycles:1
DP Execute Cycles:1
Repetition Rate:1
Example:1MIN.s F0, F1, F3;Returns minimum of F0, F1 to F3 (Follows IEEE 754-2019 minimum())
Before executionAfter execution
F00x7F800000F00x7F800000
F10xFF800000F10xFF800000
F30x00000000F30xFF800000
FSR[7:0]8'b00000000FSR[7:0]8'b00000000
Example:2MIN.d F0, F4, F8;Returns minimum of F1:F0, F5:F4 to F9:F8 (Follows IEEE 754-2019 minimum())
Before executionAfter execution
F1:F00x000000000000000AF1:F00x000000000000000A
F5:F40xC00000000000000CF5:F40xC00000000000000C
F9:F80x00000000000000F9:F80xC00000000000000C
FSR[7:0]8'b00000000FSR[7:0]8'b01000000(SUBO)
MINNMSelect the Signed Minimum of Fb and Fs [minmumNumber()]
Syntax:{label:}MINNM.sFb,Fs,Fd
MINNM.d
Operands (.s):Fs ∈ [F0 ... F31]; Fb ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fb ∈ [F0, F2 ... F30]; Fd ∈ [F0, F2 ... F30]
Operation:IF (Fs) <= (Fb) THEN (Fs) → (Fd);

ELSE THEN (Fb) → (Fd)

Status Affected:SUBO, INVAL (see Note 1)
Exceptions Possible:SUBO, INVAL
Encoding:1000001PzzdddddssssswwwwwUUU1110
Description:Find the signed minimum of two floating-point values held in Fb and Fs. This instruction is compliant with the IEEE 754-2019 minimumNumber() operation.

Compare the contents of the source registers Fb and Fs, then place the minimum of the two values in the destination register Fd. If Fb = Fs, Fd is loaded with the contents of Fs. This is a signed comparison operation (see note 3). If Fb = Fs (and of the same sign), Fd is loaded with the contents of Fs.

When one of the input operands is a NaN and the other input is a floating-point number (that is not a NaN), the instructions will return the floating-point number.

If both input operands are a NaN, the instructions will return a qNaN.

The ‘P’ bit selects single (32-bit) or double precision (64-bit) operation.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘d’ bits select the destination register.

Note:
  1. If not already set, the corresponding sticky exception status will also be set.
  2. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
  3. Operand value of -0 compares to less than +0.
I-Words:1
SP Execute Cycles:1
DP Execute Cycles:1
Repetition Rate:1
Example:1MINNM.s F0, F1, F3;Returns minimum of F0, F1 to F3
Before executionAfter execution
F00x00000000F00x00000000
F10x80000000F10x80000000
F30x00000000F30x80000000
FSR[7:0]8'b00000000FSR[7:0]8'b00000000
Example:2MINNM.d F0, F4, F8;Returns minimum of F1:F0, F5:F4 to F9:F8
Before executionAfter execution
F1:F00x800000000000000AF1:F00x800000000000000A
F5:F40x3FF924920048245CF5:F40x3FF924920048245C
F9:F80x00000000000000F9:F80x800000000000000A
FSR[7:0]8'b00000000FSR[7:0]8'b01000000(SUBO)
MOVMove Coprocessor Register to Wns with Signed Literal Offset
Syntax:{label:}MOV.lFs, [Wnd+Slit14]
Operands:Wnd ∈ [W0 ... W15]

Fs ∈ [F0 ... F31]

Operation:Wns → [Wnd+Slit14]
Status Affected:None
Encoding:1000011sssssddddkkkkkkkkkkkkzz01
Description:Moves contents of the destination register to the source Effective Address. Syntax shown is for the floating-point coprocessor F-regs. The contents of Wnd are not modified by this operation.

The instruction encoding includes space for a 12-bit literal which is scaled accordingly for long word data moves in order to generate the corresponding byte offset value.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘d’ bits select the floating-point destination register.

Note:
  1. This instruction operates in Long Word mode only.
I-Words:1
Cycles:1
MOV Move Fs to Fd
Syntax:{label:}MOV.sFs,Fd
MOV.d
Operands (.s):Fs ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fd ∈ [F0, F2 ... F30]
Operation:Fs → Fd
Status Affected:None
Exceptions Possible:None
Encoding:1000011PzzdddddsssssUUUUUUUU0010
Description:Move (copy) the contents of the source register Fs to the destination register Fd.

The ‘P’ bit selects single (.s) or double precision (.d) operation.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

Note: Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
I-Words:1
SP Execute Cycles:1
DP Execute Cycles:1
Repetition Rate:1
Example:1MOV.s F0, F1 ;Move single precision content of F0 to F1
Before executionAfter execution
F00x40C90FDBF00x40C90FDB
F10x00000000F10x40C90FDB
Example:2MOV.d F0, F2 ;Move double precision content of F1:F0 to F3:F2
Before executionAfter execution
F1:F00x3FE62E42FEFA39EFF1:F00x3FE62E42FEFA39EF
F3:F20x0000000000000000F3:F20x3FE62E42FEFA39EF
MOVC Move Constant Value to Fd
Syntax:{label:}MOVC.s index,Fd
MOVC.d
Operands (.s):Fd ∈ [F0 ... F31]; index ∈ [0 ... 31]
Operands (.d):Fd ∈ [F0, F2 ... F30]; index ∈ [0 ... 31]
Operation:Constant table (index) → Fd
Status Affected:None
Exceptions Possible:None
Encoding:1000011PzzdddddUUUUUUUUkkkkk0110
Description:Move the constant value specified by the 5-bit index into the Fd register, as defined in the tables below.

The ‘P’ bit selects single (.s) or double precision (.d) operation.

The ‘z’ bits select the target coprocessor.

The ‘d’ bits select the destination register.

The ‘k’ bits select the index.

Note: Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
I-Words:1
SP Execute Cycles:1
DP Execute Cycles:1
Repetition Rate:1
Single Precision:
IndexDataDescription
3132'H7FFF_FFFFQNAN - RANGE ENDS
3032'H7FC0_0000QNAN - RANGE STARTS
2932'H7FBF_FFFFSNAN - RANGE ENDS
2832'H7F80_0001SNAN - RANGE STARTS
2732'H7F80_0000+INF
2632'H7F7F_FFFF+MAX MAG NORMAL
2532'H0080_0000+MIN MAG NORMAL
2432'H007F_FFFF+MAX MAG SUB-NORMAL
2332'H0000_0001+MIN MAG SUB-NORMAL
2232'H0000_0000+0.0
2132'H8000_0000-0.0
2032'H8000_0001-MIN MAG SUB-NORMAL
1932'H807F_FFFF-MAX MAG SUB-NORMAL
1832'H8080_0000-MIN MAG NORMAL
1732'HFF7F_FFFF-MAX MAG NORMAL
1632'HFF80_0000-INF
1532'HFF80_0001SNAN - RANGE STARTS
1432'HFFBF_FFFFSNAN - RANGE ENDS
1332'HFFC0_0000QNAN - RANGE STARTS
1232'HFFFF_FFFFQNAN - RANGE ENDS
1132’H3F35_04F31/√ 2 =0.70710...
1032’H3FB5_04F3√2 = 1.41421...
932’H4054_9A78LOG2(10) = 3.321
832’H3F31_7218LN(2) = 0.6931471 ...
732’H402D_F854E = 2.71828...
632’H3F49_0FDBΠ/4 = 0.785398...
532’H3FC9_0FDBΠ/2 = 1.5707...
432'H4049_0FDBΠ = 3.14159...
332’H40C9_0FDB2Π = 6.283185...
232'H4000_00002.0
132'H3F80_00001.0
032’H4120_000010.0
Double Precision:
IndexDataDescription
3164'H7FFF_FFFF_FFFF_FFFFQNAN - RANGE ENDS
3064'H7FF8_0000_0000_0000QNAN RANGE STARTS
2964'H7FF7_FFFF_FFFF_FFFFSNAN RANGE ENDS
2864'H7FF0_0000_0000_0001SNAN RANGE STARTS
2764'H7FF0_0000_0000_0000+INF
2664'H7FEF_FFFF_FFFF_FFFF+MAX MAG NORMAL
2564'H0010_0000_0000_0000+MIN MAG NORMAL
2464'H000F_FFFF_FFFF_FFFF+MAX MAG SUB-NORMAL
2364'H0000_0000_0000_0001+MIN MAG SUB-NORMAL
2264'H0000_0000_0000_0000+0.0
2164'H8000_0000_0000_0000-0.0
2064'H8000_0000_0000_0001-MIN MAG SUB-NORMAL
1964'H800F_FFFF_FFFF_FFFF-MAX MAG SUB-NORMAL
1864'H8010_0000_0000_0000-MIN MAG NORMAL
1764'HFFEF_FFFF_FFFF_FFFF-MAX MAG NORMAL
1664'HFFF0_0000_0000_0000-INF
1564'HFFF0_0000_0000_0001SNAN RANGE STARTS
1464'HFFF7_FFFF_FFFF_FFFFSNAN RANGE ENDS
1364'HFFF8_0000_0000_0000QNAN RANGE STARTS
1264'HFFFF_FFFF_FFFF_FFFFQNAN RANGE ENDS
1164'H3FE6_A09E_667F_3BCD1/√2=0.7071...
1064'H3FF6_A09E_667F_3BCD√2=1.41421..
964'H400A_934F_0979_A371LOG2(10)= 3.321
864'H3FE6_2E42_FEFA_39EFLN(2)=0.69314
764'H4005_BF0A_8B14_5769E = 2.71828...
664'H3FE9_21FB_5444_2D18π/4= 0.7853...
564'H3FF9_21FB_5444_2D18π/2 = 1.5707..
464'H4009_21FB_5444_2D18π = 3.14159...
364'H4019_21FB_5444_2D182π = 6.28...
264'H4000_0000_0000_00002.0
164'H3FF0_0000_0000_00001.0
064'H4024_0000_0000_000010.0
Example:1MOVC.s #3, F0;Move single precision constant 2π to register F0
Before executionAfter execution
F00x00000000F00x40C90FDB
Example:2MOVC.d #8, F0;Move double precision constant Ln(2) to register F1:F0
Before executionAfter execution
F1:F00x0000000000000000F1:F00x3FE62E42FEFA39EF
MOV Move Coprocessor Register to Wd
Syntax:{label:}MOV.lFs,Wd
FSR,[Wd]
FSRH,[Wd++]
FCR,[Wd--]
FEAR,[--Wd]
[++Wd]
[Wd+Wb]
Operands:Fs ∈ [F0 ... F31]; Wd ∈ [W0 ... W15]; Wb ∈ [W0 ... W14] (see Note 2)
Operation:(Fs or FSR or FSRH or FCR or FEAR) → (EAd)
Status Affected:None
Encoding:S000011sssssddddUUUqqqwwwwRUzz00
Description:Move the contents of the source coprocessor data, status or control register into the destination register. Syntax shown is for the floating-point coprocessor registers.

The ‘S’ bit selects instruction size.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the coprocessor source register.

The ‘d’ bits select the destination register.

The ‘q’ bits select the destination addressing mode.

The ‘w’ bits define the offset Wb.

The ‘R’ bit selects between the F-regs and FPU special registers.

Note:
  1. This instruction operates in Long Word mode only.
  2. Stack Pointer (W15) limit checks are only performed for Wd = W15. Consequently, setting Wb = W15 is not permitted.
I-Words:1 or 0.5
Cycles:1
MOVMove Wns with Signed Literal Offset to Coprocessor Register
Syntax:{label:}MOV.l[Wns+Slit14], Fd
Operands:Wns ∈ [W0 ... W15]

Fd ∈ [F0 ... F31]

Operation:[Wns+Slit14] → Fd
Status Affected:None
Encoding:1000010dddddsssskkkkkkkkkkkkzz01
Description:Moves contents of the source Effective Address into the destination register. Syntax shown is for the floating-point coprocessor F-regs. The contents of Wns are not modified by this operation.

The instruction encoding includes space for a 12-bit literal which is scaled accordingly for long word data moves in order to generate the corresponding byte offset value.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘d’ bits select the floating-point destination register.

Note:
  1. This instruction only supported when a coprocessor is instantiated.
  2. This instruction operates in Long Word mode only.
I-Words:1
Cycles:1
MOV Move Ws to Coprocessor Register
Syntax:{label:}MOV.lWs,Fd
[Ws],FSR
[Ws++]FCR
[Ws--]FEAR
[--Ws],
[++Ws],
[Ws+Wb],
Operands:Fd ∈ [F0 ... F31]; Ws ∈ [W0 ... W15]; Wb ∈ [W0 ... W14] (see Note 2)
Operation:(EAs) → Fd, FSR, FCR or FEAR
Status Affected:None
Encoding:S000010dddddsssspppUUUwwwwRUzz00
Description:Move the contents of the source register into the coprocessor destination data, status or control register. Syntax shown is for the floating-point coprocessor registers.

The ‘S’ bit selects instruction size.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘d’ bits select the coprocessor destination register.

The ‘p’ bits select the source addressing mode.

The ‘w’ bits define the offset Wb.

The ‘R’ bit selects between the F-regs and FPU special registers.

Note:
  1. This instruction operates in Long Word mode only.
  2. Stack Pointer (W15) limit checks are only performed for Wd = W15. Consequently, setting Wb = W15 is not permitted.
I-Words:1 or 0.5
Cycles:1
MOVMove Long Literal to Coprocessor Register
Syntax:{label:}MOV.llit32,Fd
FSR
FCR
Operands:lit32 ∈ [0 ... 4GB]; Fd ∈ [F0 ... F31]
Operation:lit32 → (Fd or FSR or FCR)
Status Affected:None
Encoding:
1st word1000001zkkkkkkkkkkkkkkkkkkkkz001
2nd word1000001dddddUkkkkkkUUUkkkkkkR101
Description:The literal ‘k’ is loaded into the coprocessor destination data register. Syntax shown is for the floating-point coprocessor register.

The ‘d’ bits select the coprocessor destination register.

The ‘z’ bits select the target coprocessor.
 zz[1:0] = Word1[24], Word1[3]

The ‘R’ bit selects between the F-regs and FPU special registers.

The ‘k’ bits specify the value of the 32-bit literal:

lit32[31:0] = Word1[18:13], Word2[9:4], Word1[23:4]

I-Words:2
Cycles:2
MUL Floating-Point Signed Multiply
Syntax:{label:}MUL.sFb,Fs,Fd
MUL.d
Operands (.s):Fs ∈ [F0 ... F31]; Fb ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fb ∈ [F0, F2 ... F30]; Fd ∈ [F0, F2 ... F30]
Operation:(Fb) * (Fs) → Fd;
Status Affected:SUBO, INX, UDF, OVF, INVAL (see Note 1)
Exceptions Possible:SUBO, INX, UDF, OVF, INVAL
Encoding:1000010PzzdddddssssswwwwwUUU0110
Description:Multiply the signed contents of the source register Fb with the signed contents of the source register Fs, then write the product to Fd.

(0 * ∞) or (∞ * 0) will result in distinguished qNaN and signal an INVAL exception.

The ‘P’ bit selects single (.s) or double precision (.d) operation.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘d’ bits select the destination register.

Note:
  1. If not already set, the corresponding sticky exception status will also be set.
  2. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
I-Words:1
SP Execute Cycles:3
DP Execute Cycles:3
Repetition Rate:1
Example:1MUL.s F0, F1, F3;Multiply contents of F0 and F1 and store result in F3
Before executionAfter execution
F00x41200000F00x41200000
F10x41C80000F10x41C80000
F30x00000000F30x437A0000
FSR[7:0]8'b00000000FSR[7:0]8'b00000000
Example:2MUL.d F0, F2, F6;Multiply contents of F1:F0 and F3:F2 and store result in F7:F6
Before executionAfter execution
F1:F00xFFE0000000000030F1:F00xFFE0000000000030
F3:F20xFFE0000000000030F3:F20xFFE0000000000030
F7:F60x00000000000000F7:F60x7FEFFFFFFFFFFFFF
FSR[7:0]8'b00000000FSR[7:0]8'b00010100(OVF, INX)
NEG Negate Fs
Syntax:{label:}NEG.sFs,Fd
NEG.d
Operands (.s):Fs ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fd ∈ [F0, F2 ... F30]
Operation:-Fs → Fd
Status Affected:SUBO1
Exceptions Possible:SUBO
Encoding:1000100PzzdddddsssssUUUUUUUU0110
Description:Negate the sign of the contents of the source register Fs and place the result in the destination register Fd.

The ‘P’ bit selects single (.s) or double precision (.d) operation.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

Note:
  1. If not already set, the corresponding sticky exception status will also be set.
  2. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
I-Words:1
SP Execute Cycles:1
DP Execute Cycles:1
Repetition Rate:1
Note: This instruction only affects the sign bit and will not quit an sNaN input operand.
Example:1NEG.s F0, F3 ;Find negate of a number in F0 and store result in F3
Before executionAfter execution
F00x40800001F00x40800001
F30x00000000F30xC0800001
FSR[7:0]8'b00000000FSR[7:0]8'b00000000
Example:2NEG.d F0, F2 ;Find negate of a number in F1:F0 and store result in F3:F2
Before executionAfter execution
F1:F00x8000000000000001F1:F00x8000000000000001
F3:F20x0000000000000000F3:F20x0000000000000001
FSR[7:0]8'b00000000FSR[7:0]8'b01000000(SUBO)
POP Pop FPU Coprocessor Register
Syntax:{label:}POP.lFd
FSR
FCR
FEAR
Operands:Fd ∈ [F0 ... F31]
Operation:(W15)-4 → W15

(TOS) → (Fd or FSR or FCR or FEAR)

Status Affected:None
Encoding:0010111dddddzzRU
Description:Move the top of system stack to the coprocessor destination register. Use of the system Stack Pointer ([--W15]) is implied. Syntax shown is for the floating-point coprocessor registers.

The ‘d’ bits select the floating point destination register.

The ‘z’ bits select the target coprocessor.

The ‘R’ bit selects between the F-regs and FPU special registers.

Note:
  1. This instruction operates in Long Word mode only.
  2. FSRH not supported as it would clear exception status in FSR[15:0].
Words:1
Cycles:1
PUSH Push FPU Coprocessor Register
Syntax:{label:}PUSH.lFs
FSR
FSRH
FCR
FEAR
Operands:Fs ∈ [F0 ... F31]
Operation:(Fs or FSR or FSRH or FCR or FEAR) → (TOS)

(W15)+4 → W15

Status Affected:None
Encoding:0010011ssssszzRU
Description:Move the contents of the source floating point register to the top of system stack. Use of the system Stack Pointer ([W15++]) is implied. Syntax shown is for the floating-point coprocessor registers.

When FSRH is selected, long word value {FSR[31:16], 16’b0} will be pushed onto the stack. FSR[31:16] comprises of FCPS/FCPQ and FTST instruction status only.

The ‘s’ bits select the floating point source register.

The ‘z’ bits select the target coprocessor.

The ‘R’ bit selects between the F-regs and FPU special registers.

Note:
  1. This instruction operates in Long Word mode only.
Words:0.5
Cycles:1
SIN Evaluate the Sine of Fs
Syntax:{label:}SIN.sFs,Fd
Operands (.s):Fs ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]
Operation:Sin(Fs) → Fd
Status Affected:SUBO, INX, UDF, INVAL (see Note 1)
Exceptions Possible:SUBO, INX, UDF, INVAL
Encoding:1000110PzzdddddsssssUUUUUUUU0010
Description:Calculate the sine of contents of the source register Fs
 (where Fs = [2πk + θ rads]), and place the result in the destination register Fd.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register

The ‘d’ bits select the destination register.

Note:
  1. If not already set, the corresponding sticky exception status will also be set.
  2. This operation is only supported using single precision floating-point.
  3. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
I-Words:1
SP Execute Cycles:4
Repetition Rate:1
Example:1SIN.s F0, F3 ;Find Sine of radians in F0 and store result in F3
Before executionAfter execution
F00x3F492492F00x3F492492
F30x00000000F30x3F351398
FSR[7:0]8'b00000000FSR[7:0]8'b00000000
Example:2SIN.s F0, F3 ;Find Sine of radians in F0 and store result in F3
Before executionAfter execution
F00x7F800000F00x7F800000
F30x00000000F30x7FC00001(distinguished qNaN)
FSR[7:0]8'b00000000FSR[7:0]8'b00000001(INVAL)
SQRTSquare Root Fs, result in Fd
Syntax:{label:}SQRT.sFs,Fd
SQRT.d
Operands (.s):Fs ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fd ∈ [F0, F2 ... F30]
Operation:√Fs → Fd
Status Affected:SUBO, INX, INVAL (see Note 1)
Exceptions Possible:SUBO, INX, INVAL
Encoding:1000100PzzdddddsssssUUUUUUUU1010
Description:Take the square root of contents of the source register Fs, and place the result in the destination register Fd.

If Fs < 0, destination will be written with distinguished qNaN and signal an FPU INVAL exception.

The ‘P’ bit selects single (.s) or double precision (.d) operation.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘d’ bits select the destination register.

Note:
  1. If not already set, the corresponding sticky exception status will also be set.
  2. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
I-Words:1
SP Execute Cycles:10
DP Execute Cycles:13
Repetition Rate:TBD
Example:1SQRT.s F0, F3;Find Square root of number in F0 and store result in F3
Before executionAfter execution
F00x00000030F00x00000030
F30x00000000F30x1B9CC470
FSR[7:0]8'b00000000FSR[7:0]8'b00000000
Example:2SQRT.d F0, F2;Find Square root of number in F1:F0 and store result in F3:F2
Before executionAfter execution
F1:F00x4050000000000000F1:F00x4050000000000000
F3:F20x0000000000000000F3:F20x4020000000000000
FSR[7:0]8'b00000000FSR[7:0]8'b00010000(INX)
SUBSubtract Fs from Fb
Syntax:{label:}SUB.sFb,Fs,Fd
SUB.d
Operands (.s):Fs ∈ [F0 ... F31]; Fb ∈ [F0 ... F31]; Fd ∈ [F0 ... F31]
Operands (.d):Fs ∈ [F0, F2 ... F30]; Fb ∈ [F0, F2 ... F30]; Fd ∈ [F0, F2 ... F30]
Operation:Fb - Fs → Fd
Status Affected:SUBO, INX, UDF, OVF, INVAL (see Note 1)
Exceptions Possible:SUBO, INX, UDF, OVF, INVAL
Encoding:1000000PzzdddddssssswwwwwUUU0110
Description:Subtract the contents of the source register Fs from the contents of the base register Fb, then place the result in the destination register Fd.

(∞ - ∞) will result in distinguished qNaN and signal an FPU INVAL exception.

The ‘P’ bit selects single (.s) or double precision (.d) operation.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

The ‘w’ bits select the base register.

The ‘d’ bits select the destination register.

Note:
  1. If not already set, the corresponding sticky exception status will also be set.
  2. Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
I-Words:1
SP Execute Cycles:2
DP Execute Cycles:2
Repetition Rate:1
Example:1SUB.s F0, F1, F3;Subtracts F1 from F0 and stores the result in F3
Before executionAfter execution
F00x40800001F00x40800001
F10xC0F800F1F10xC0F800F1
F30x00000000F30xC07001E0
FSR[7:0]8'b00000000FSR[7:0]8'b00000000
Example:2SUB.d F0, F2, F6;Subtracts F3:F2 from F1:F0 and stores the result in F7:F6
Before executionAfter execution
F1:F00x000FFFFFFFFFFFFFF1:F00x000FFFFFFFFFFFFF
F3:F20x000FFFFFFFFFFFFFF3:F20x000FFFFFFFFFFFFF
F7:F60x001FFFFFFFFFFFFEF7:F60x001FFFFFFFFFFFFE
FSR[7:0]8'b00000000FSR[7:0]8'b01000000(SUBO)
TST Test Fs
Syntax:{label:}TST.sFs
TST.d
Operands (.s):Fs ∈ [F0 ... F31]
Operands (.d):Fs ∈ [F0, F2 ... F30]
Operation:If Fs is +/-Subnormal FSR.SUB = 1 else FSR.SUB = 0
If Fs is +/- Infinity FSR.INF = 1 else FSR.INF = 0

If Fs is Negative FSR.FN = 1 else FSR.FN = 0

If Fs is +/- Zero FSR.FZ = 1 else FSR.FZ = 0

If Fs is qNaN or sNaN FSR.FNAN = 1 else FSR.FNAN = 0

Status Affected:SUB, INF, FN, FZ, FNAN
Exceptions Possible:None
Encoding:1001010PzzUUUUUsssssUUUUUUUU0010
Description:Inspect the contents of Fs and set the FSR status accordingly.

The ‘P’ bit selects single (.s) or double precision (.d) operation.

The ‘z’ bits select the target coprocessor.

The ‘s’ bits select the source register.

Note: Coprocessor select bit field zz = 2’b00 for floating-point coprocessor macro.
I-Words:1
SP Execute Cycles:1
DP Execute Cycles:1
Repetition Rate:1
Example:1TST.s F0 ;Inspects contents of F0 register and updates FSR
Before executionAfter execution
F00xFFC0000AF00xFFC0000A
(a -ve NaN number)
FSR[31:24]8'b00000000FSR[31:24]8'b00000101(FN, NAN)
Example:2TST.d F0 ;Inspects contents of F1:F0 register and updates FSR
Before executionAfter execution
F1:F00xFFF0000000000000F1:F00xFFF0000000000000
(a -ve Inf number)
FSR[31:24]8'b00000000FSR[31:24]8'b00001100(FN, INF)