Zurzeit berechne ich die Wurzel über iqMath und macht keine Probleme, braucht allerdings unnötig Prozessorzeit. Laut Floating-Point Datenblatt von TI kann die FPU den Kehrwert einer Wurzel berechnen. Siehe: S. 49 u. 50 http://focus.ti.com/general/docs/techdocsabstract.tsp?abstractName=sprueo2a Funktioniert bei mir allerdings nicht und bekomme 1 bzw. -1 raus. Hat jemand diese Berechnungsmöglichkeit schon genutzt? Assembler ist auch nicht wirklich meine Stärke... Der CODE: ; Y = sqrt(X) ; Ye = Estimate(1/sqrt(X)); ; Ye = Ye*(1.5 - Ye*Ye*X*0.5) ; Ye = Ye*(1.5 - Ye*Ye*X*0.5) ; Y = X*Ye _sqrt: ; R0H = X on entry EISQRTF32 R1H, R0H ; R1H = Ye = Estimate(1/sqrt(X)) MPYF32 R2H, R0H, #0.5 ; R2H = X*0.5 MPYF32 R3H, R1H, R1H ; R3H = Ye*Ye NOP MPYF32 R3H, R3H, R2H ; R3H = Ye*Ye*X*0.5 NOP SUBF32 R3H, #1.5, R3H ; R3H = 1.5 - Ye*Ye*X*0.5 NOP MPYF32 R1H, R1H, R3H ; R2H = Ye = Ye*(1.5 - Ye*Ye*X*0.5) NOP MPYF32 R3H, R1H, R2H ; R3H = Ye*X*0.5 NOP MPYF32 R3H, R1H, R3H ; R3H = Ye*Ye*X*0.5 NOP SUBF32 R3H, #1.5, R3H ; R3H = 1.5 - Ye*Ye*X*0.5 CMPF32 R0H, #0.0 ; Check if X == 0 MPYF32 R1H, R1H, R3H ; R2H = Ye = Ye*(1.5 - Ye*Ye*X*0.5) NOP MOV32 R1H, R0H, EQ ; If X is zero, change the Ye estimate to 0 MPYF32
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.