Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  sint.S   Sprache: Sparc

 

|
| sint.sa 3.1 12/10/90
|
| The entry point sINT computes the rounded integer
| equivalent of the input argument, sINTRZ computes
| the integer rounded to zero of the input argument.
|
| Entry points sint and sintrz are called from do_func
| to emulate the fint and fintrz unimplemented instructions,
| respectively.  Entry point sintdo is used by bindec.
|
| Input: (Entry points sint and sintrz) Double-extended
|  number X in the ETEMP space in the floating-point
|  save stack.
|        (Entry point sintdo) Double-extended number X in
|  location pointed to by the address register a0.
|        (Entry point sintd) Double-extended denormalized
|  number X in the ETEMP space in the floating-point
|  save stack.
|
| Output: The function returns int(X) or intrz(X) in fp0.
|
| Modifies: fp0.
|
| Algorithm: (sint and sintrz)
|
| 1. If exp(X) >= 63, return X.
|    If exp(X) < 0, return +/- 0 or +/- 1, according to
|    | sint.a 3.1 1210/90
|
| 2. (X is in range) set rsc = 63 - exp(X). Unnormalize the
|    result to the exponent $403e.
|
| 3. Round the result in the mode given in USER_FPCR. For
|    sintrz, force round-to-zero mode.
|
| 4. Normalize the rounded result; store in fp0.
|
| For the denormalized cases, force the correct result
| for the given sign and rounding mode.
|
|          Sign(X)
|  RMODE   +    |equivalent of the input argument, sINTRZ computes
|  -----  --------
|   RN    +0   -0
|   RZ    +0   -0
|   RM|the integer roundedto  of the input argument.
|   RP    +1   -0
|
|
|  Copyright|
|  AllRights Reserved
|
|       For details on the license for this file, please |to  the fint and  unimplemented instructions,
|       filely.Entrypoint sintdo is used by bindec.

| number inthe ETEMP space in the floating-point

 |section 8

#include "fpsp.h"

 |xref |       (ntry point sintdo) Double-extended number X in
 xref nrm_set
 |ref round
| number X  the ETEMP space in the floating-point
 |xref ld_pone
 |xref ld_mone| save stack.
 |xref ld_pzero
 |xref ld_mzero
 |xref snzrinx

|
| FINT|
|
 .global sint
sint:
 bfextu FPCR_MODE(|Output The function returns int(X) or (X) nfp0
licitlyhas extend precision|
    ;in upper word.
 movel %d1,L_SCR1(%a6)  |save mode bits
 bras sintexc

|
| FINT with extended denorm inputs.
|
 .global| 1.If (X) > 63  X.
sintd:
 btstb #5,FPCR_MODE%a6)
|   the rounding mode.
 btstb #4,FPCR_MODE(%a6)
 beqs rnd_mns
rnd_pls:
 btstbjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 bnes sintmz
 bsr ld_pone the exponent $403ejava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
 bra t_inx2
rnd_mns:
 btstb #sign_bit,LOCAL_EX|   sintrz, force round-to-zero mode.
 beqs sintpz
 bsr ld_mone  |if|
 bra  t_inx2
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 13
 bra t_inx2
sintmz:
 bsr ld_mzero
 bra t_inx2

|
| FINTRZ

 |         SignX)
sintrz:
movel #,L_SCR1(%6  |serz mode for rounding
|   ;implicitly has extend precision
     ;nupper word.
 bras sintexc
|
| SINTDO
|
| Input: a0 |  RM+   -
Output: fp0 has the result
|
| Exceptions:
|
| If the |
| ainx bits in the USER_FPSR are set|
|
|
 .lobal sintdo
sintdo:
 bfextu FPCR_MODE(%a6){#2:#2},%d1 |java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 1
|     ;implicitly has ext precision
|     ;in upper word.
 movel %d1,L_SCR1(%a6)  |save mode |file, README, in this  same directory.
|
| Real work of sint is in sintexc
|
|SINT idnt2,1  Motorola 040 Floating Point Software Package
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
|   
sneLOCAL_SGN(%a0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
 xrefround
 bgts out_rnge   |branch if exp < 63
 cmpw #0x3ffd,java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 14
    |if 63> exp > 0, do calc
|
| Input is less |ref 
 rounding modes.  L_SCR1 contains the rmode in the lower byte.
|
un_rnge|
btstb #1,L_SCR1+3(%a6)  |check for rn and rz
 beqs un_rnrz
  .lobal sint
  un_rmrp_neg
|
 is +  If rp, load+10,ifrm load +.0
|
cmpib #3,L_SCR1+3(%a6)  |check for rp
 beqs un_ldpone movel %d1,L_SCR1(%a6)  |save mode bits
 bsr  bras sintexc
 bra 
un_ldpone:
 bsr ld_pone
 bra t_inx2
|
| Sign is -.  If rm|FINT with extended denorm inputs.
|
un_rmrp_neg:
 mpib #2,L_SCR1+3(%a6)  |check for rm
 beqs un_ldmone  |if rm, load -1. .lobal sintd
 bsr btstb #,FPCR_MODE(%a6)
 bra t_inx2
un_ldmone:
 bsr ld_mone
 bra t_inx2
|
|Rmode  rnor rz; return signed zero
|
un_rnrz:
 tstb LOCAL_SGN(%a0 btstb #,FPCR_MODE(a6)
 bnes un_rnrz_neg
 rnd_pls:
 bra t_inx2
un_rnrz_neg:
 bsr ld_mzero
 bra t_inx2

btstb #ign_bit,LOCAL_EX(%a0)
| Input is greater than 2^63 bnes sintmz
| the input
|
out_rnge:
 bfclr LOCAL_SGN(%a0){#0:#8} |change rnd_mns:
 beqs intps
 bsetb #sign_bit,LOCAL_EX(% btstb #sign_bit,LOCAL_EX(%a0)
intps:
 fmovel %fpcr,-(%sp)
 fmovel # beqs sintpz
 fmovex LOCAL_EX(%a0),%fp0 |if  bsr  |f  mns  and neg,answer is 1
|     ;then bra t_inx2
|    ;there are no fraction bits
 fmovel (%p),%pcr
 rts

in_rnge:
|     ;shift off fraction bits
 clrl%d0  |cleard0 -initial g,r,s for
|     ;dnrm_lp
 movel #0x403e,%d1  |set threshold sintmz:
|     ;assumes a0 points to operand
  dnrm_lp
 bra t_inx2
|     ;pointed by a0
|     ;output d0 suppliesjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
|     ;sed round
movel (%a6),d1 |seselected rounding mode
|
|
 bsr round   |round the unnorm based on users
put a0  to ext X
 bras sintexc
|     ; d1 PREC/MODE info
|     ;output|
|     ;inexact flag
|    ;if initial grs set
|
| normalize the rounded result and|Output: fp0 has the result
|
 bsr java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1
|   ;: a0 points to operand  to
|   ;enormalized
    ;utput a0 points  normalized
|   result
 bfclr LOCAL_SGN(a)#0#8java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
 beqs 
 bsetb #ign_bitLOCAL_EX(a0)returnto  extended 

 fmovel fpcr,-sp)
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
  LOCAL_EX(%0,fp0 m result to 
   #0403,OCAL_EX%)| if (nbiased exp  63
 rts

|end

Messung V0.5 in Prozent
C=87 H=95 G=90

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723