Port-vax archive

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

Re: VAX sin/cos/atan2 vs polyd (Was: Does anyone have a netbsd-5 or earlier VAX to hand?)



On 27 May 2012 21:44, Matt Thomas <matt%3am-software.com@localhost> wrote:

> If you look at <vax/asm.h> should see gas macros for expanding polyd
> and thereby avoiding the instructions.

Ah - that seems to be the case:

n_argred.S has:

ENTRY(__libm_sincos, 0)
        addl2   %r4,%r0
        movd    %r1,%r6
        movf    %r3,%r8
        rotl    $-1,%r0,%r9
        blss    cosine
sine:
        muld2   %r1,%r1         # Xsq = X * X
        cmpw    $0x2480,%r1     # [zl] Xsq > 2^-56?
        blss    1f              # [zl] yes, go ahead and do polyd
        clrq    %r1             # [zl] work around 11/780 FPA polyd bug
1:
        polyd   %r1,$7,sin_coef # Q = P(Xsq) , of deg 7
        mulf3   $0f3.0,%r8,%r4  # beta = 3 * alpha
        mulf2   %r0,%r4         # beta = Q * beta

while disassembling __libm_sincos in gdb reports:

   0x000069be <+2>:     addl2 r4,r0
   0x000069c1 <+5>:     movd r1,r6
   0x000069c4 <+8>:     movf r3,r8
   0x000069c7 <+11>:    rotl $0xff,r0,r9
   0x000069cc <+16>:    blss 0x6a0b <__libm_sincos+79>
   0x000069ce <+18>:    muld2 r1,r1
   0x000069d1 <+21>:    cmpw $0x2480,r1
   0x000069d6 <+26>:    blss 0x69da <__libm_sincos+30>
   0x000069d8 <+28>:    clrd r1
   0x000069da <+30>:    movd r1,r4   # start polyd
   0x000069dd <+33>:    movzwl $0x7,r2
   0x000069e0 <+36>:    movab 0x7d9c,r3
   0x000069e7 <+43>:    clrd r0
   0x000069e9 <+45>:    brb 0x69ee <__libm_sincos+50>
   0x000069eb <+47>:    muld2 r4,r0
   0x000069ee <+50>:    addd2 @(r3)+,r0
   0x000069f1 <+53>:    sobgtr r2,0x69eb <__libm_sincos+47>
   0x000069f4 <+56>:    clrd r4    # end polyd
   0x000069f6 <+58>:    mulf3 $0x14 [f-float],r8,r4
   0x000069fa <+62>:    mulf2 r0,r4

Does that seem plausible?


Home | Main Index | Thread Index | Old Index