source: rtems/c/src/lib/libcpu/m68k/m68040/fpsp/sasin.S @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 2.4 KB
Line 
1//
2//
3//      sasin.sa 3.3 12/19/90
4//
5//      Description: The entry point sAsin computes the inverse sine of
6//              an input argument; sAsind does the same except for denormalized
7//              input.
8//
9//      Input: Double-extended number X in location pointed to
10//              by address register a0.
11//
12//      Output: The value arcsin(X) returned in floating-point register Fp0.
13//
14//      Accuracy and Monotonicity: The returned result is within 3 ulps in
15//              64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
16//              result is subsequently rounded to double precision. The
17//              result is provably monotonic in double precision.
18//
19//      Speed: The program sASIN takes approximately 310 cycles.
20//
21//      Algorithm:
22//
23//      ASIN
24//      1. If |X| >= 1, go to 3.
25//
26//      2. (|X| < 1) Calculate asin(X) by
27//              z := sqrt( [1-X][1+X] )
28//              asin(X) = atan( x / z ).
29//              Exit.
30//
31//      3. If |X| > 1, go to 5.
32//
33//      4. (|X| = 1) sgn := sign(X), return asin(X) := sgn * Pi/2. Exit.
34//
35//      5. (|X| > 1) Generate an invalid operation by 0 * infinity.
36//              Exit.
37//
38
39//              Copyright (C) Motorola, Inc. 1990
40//                      All Rights Reserved
41//
42//      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
43//      The copyright notice above does not evidence any
44//      actual or intended publication of such source code.
45
46//SASIN idnt    2,1 | Motorola 040 Floating Point Software Package
47
48        |section        8
49
50PIBY2:  .long 0x3FFF0000,0xC90FDAA2,0x2168C235,0x00000000
51
52        |xref   t_operr
53        |xref   t_frcinx
54        |xref   t_extdnrm
55        |xref   satan
56
57        .global sasind
58sasind:
59//--ASIN(X) = X FOR DENORMALIZED X
60
61        bra             t_extdnrm
62
63        .global sasin
64sasin:
65        fmovex          (%a0),%fp0      // ...LOAD INPUT
66
67        movel           (%a0),%d0
68        movew           4(%a0),%d0
69        andil           #0x7FFFFFFF,%d0
70        cmpil           #0x3FFF8000,%d0
71        bges            asinbig
72
73//--THIS IS THE USUAL CASE, |X| < 1
74//--ASIN(X) = ATAN( X / SQRT( (1-X)(1+X) ) )
75
76        fmoves          #0x3F800000,%fp1
77        fsubx           %fp0,%fp1               // ...1-X
78        fmovemx %fp2-%fp2,-(%a7)
79        fmoves          #0x3F800000,%fp2
80        faddx           %fp0,%fp2               // ...1+X
81        fmulx           %fp2,%fp1               // ...(1+X)(1-X)
82        fmovemx (%a7)+,%fp2-%fp2
83        fsqrtx          %fp1            // ...SQRT([1-X][1+X])
84        fdivx           %fp1,%fp0               // ...X/SQRT([1-X][1+X])
85        fmovemx %fp0-%fp0,(%a0)
86        bsr             satan
87        bra             t_frcinx
88
89asinbig:
90        fabsx           %fp0     // ...|X|
91        fcmps           #0x3F800000,%fp0
92        fbgt            t_operr         //cause an operr exception
93
94//--|X| = 1, ASIN(X) = +- PI/2.
95
96        fmovex          PIBY2,%fp0
97        movel           (%a0),%d0
98        andil           #0x80000000,%d0 // ...SIGN BIT OF X
99        oril            #0x3F800000,%d0 // ...+-1 IN SGL FORMAT
100        movel           %d0,-(%sp)      // ...push SIGN(X) IN SGL-FMT
101        fmovel          %d1,%FPCR
102        fmuls           (%sp)+,%fp0
103        bra             t_frcinx
104
105        |end
Note: See TracBrowser for help on using the repository browser.