supermario/base/SuperMarioProj.1994-02-09/Toolbox/InSANE/HWElemsCommon.a
2019-06-29 23:17:50 +08:00

61 lines
2.1 KiB
Plaintext

;
; File: HWElemsCommon.a
;
; Contains: PolyEval routines
;
; Written by: Apple Numerics Group, DSG
;
; Copyright: © 1985-1991 by Apple Computer, Inc., all rights reserved.
;
; Change History (most recent first):
;
; <1> 10/24/91 SAM/KSM Rolled in Regatta file.
;
; Terror Change History:
;
; <1> 01/06/91 BG Added to TERROR/BBS for the time.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; File: 881ELEMScommon.a
;; Implementation of OmegaSANE. Expects 881/882
;; Copyright Apple Computer, Inc. 1985-7,1989-90
;; All Rights Reserved
;; Confidential and Proprietary to Apple Computer,Inc.
;;
;; Written by Clayton Lewis, begun 15 March 89.
;; Based on Elems881, package code for Mac by Jerome Coonen,
;; as modified for MacII by Stuart McDonald.
;;
;; Modification history:
;; 15 Mar 89 First paltry efforts
;; 20 Mar 89 Inclusion of 80/96 support
;; 12 May 89 Numeric values seem to work correctly in 80-bit mode
;; exceptions and 96-bit mode unchecked
;; 15 May 89 Folded in new 881ELEMScoeff.a file build jointly with Ali
;; 16 May 89 cleaning, exceptions working (funny behavior on denorms,
;; but FPSR is correct on routine exit)
;; 17 May 89 Moved common routines here for easier coordination with Ali
;; 22 May 90 Removed PROCEXIT stub routine. -S.McD
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; PolyEval is a Horner's rule polynomial evaluator. ;;
;; ;;
;; Coefficient table contains 2-byte integer = degree of polynomial less one ;;
;; followed by the polynomial coefficients in decreasing order. ;;
;; ;;
;; INPUT argument in FP0 (unchanged by PolyEval), ;;
;; address of COEFFICIENT table in A0, ;;
;; return RESULT in FP1. ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PolyEval
MOVE.W (A0)+,D0
FMOVE.X (A0)+,FP1 ; first coefficient
PolyLoop
FMUL.X FP0,FP1
FADD.X (A0)+,FP1
DBF D0,PolyLoop
RTS