下面是TI提供的头文件中,CLA除法函数,其中红色加粗代码意思是如果Den == 0.0 则改变Num的符号,请问为什么要这么做,有什么含义(虽然标记为可选项,但是还是想搞清楚)
CLAdiv .macro Dest, Num, Den
MMOV32 MR1,@_:Den: ; MR1 = Den
MEINVF32 MR2,MR1 ; MR2 = Ye = Estimate(1/Den)
MMPYF32 MR3,MR2,MR1 ; MR3 = Ye*Den
MSUBF32 MR3,#2.0,MR3 ; MR3 = 2.0 – Ye*Den
MMPYF32 MR2,MR2,MR3 ; MR2 = Ye = Ye*(2.0 – Ye*Den)
MMPYF32 MR3,MR2,MR1 ; MR3 = Ye*Den
|| MMOV32 MR0,@_:Num: ; MR0 = Num
MSUBF32 MR3,#2.0,MR3 ; MR3 = 2.0 – Ye*Den
MMPYF32 MR2,MR2,MR3 ; MR2 = Ye = Ye*(2.0 – Ye*Den)
|| MMOV32 MR1,@_:Den: ; Optional: Reload Den To Set Sign
MNEGF32 MR0,MR0,EQ ; Optional: if(Den == 0.0) Change Sign Of Num
MMPYF32 MR0,MR2,MR0 ; MR0 = Y = Ye*Num
MMOV32 MR0,MR0 ; Optional: Set/Clear MSTF NF and ZF flags
MMOV32 @_:Dest:,MR0 ; Store Y = Num/Den
.endm