Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/vax/include Add macros for polyd and polyf



details:   https://anonhg.NetBSD.org/src/rev/b7a1187427ff
branches:  trunk
changeset: 767748:b7a1187427ff
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Jul 28 22:54:02 2011 +0000

description:
Add macros for polyd and polyf

diffstat:

 sys/arch/vax/include/asm.h |  32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

diffs (44 lines):

diff -r b48a2673bb84 -r b7a1187427ff sys/arch/vax/include/asm.h
--- a/sys/arch/vax/include/asm.h        Thu Jul 28 22:32:28 2011 +0000
+++ b/sys/arch/vax/include/asm.h        Thu Jul 28 22:54:02 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: asm.h,v 1.23 2011/01/25 02:37:35 matt Exp $ */
+/*     $NetBSD: asm.h,v 1.24 2011/07/28 22:54:02 matt Exp $ */
 /*
  * Copyright (c) 1982, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -105,4 +105,34 @@
        .popsection
 #endif /* __STDC__ */
 
+.macro polyf arg:req degree:req tbladdr:req
+       movf    \arg, %r1
+       movzwl  \degree, %r2
+       movab   \tbladdr, %r3
+
+       clrd    %r0
+       jr      2f
+1:
+       mulf2   %r1, %r0                /* result *= arg */
+2:
+       addf2   *(%r3)+, %r0            /* result += c[n] */
+       sobgtr  %r2, 1b
+       clrf    %r1                     /* r1 is 0 on finish */
+.endm
+
+.macro polyd arg:req degree:req tbladdr:req
+       movd    \arg, %r4
+       movzwl  \degree, %r2
+       movab   \tbladdr, %r3
+
+       clrd    %r0
+       jr      2f
+1:
+       muld2   %r4, %r0                /* result *= arg */
+2:
+       addd2   *(%r3)+, %r0            /* result += c[n] */
+       sobgtr  %r2, 1b
+       clrq    %r4                     /* r4, r5 are 0 on finish */
+.endm
+
 #endif /* !_VAX_ASM_H_ */



Home | Main Index | Thread Index | Old Index