Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/runtime/mach-dep/MIPS.prim.asm
ViewVC logotype

Diff of /sml/trunk/src/runtime/mach-dep/MIPS.prim.asm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3, Sat Oct 4 23:33:46 1997 UTC revision 8, Sun Jan 18 01:01:29 1998 UTC
# Line 5  Line 5 
5    
6  #define _MIPS_SIM       1       /* IRIX 5.x needs this in <regdef.h> */  #define _MIPS_SIM       1       /* IRIX 5.x needs this in <regdef.h> */
7    
8  #ifndef OPSYS_MACH  /** include <regdef.h> **/
9  #include <regdef.h>  #define zero    $0      /* wired zero */
10  #endif  #define AT      $at     /* assembler temp */
11    #define v0      $2      /* return value */
12    #define v1      $3
13    #define a0      $4      /* argument registers */
14    #define a1      $5
15    #define a2      $6
16    #define a3      $7
17    #define t0      $8      /* caller saved */
18    #define t1      $9
19    #define t2      $10
20    #define t3      $11
21    #define t4      $12     /* caller saved - 32 bit env arg reg 64 bit */
22    #define ta0     $12     /* caller saved in 32 bit - arg regs in 64 bit */
23    #define t5      $13
24    #define ta1     $13
25    #define t6      $14
26    #define ta2     $14
27    #define t7      $15
28    #define ta3     $15
29    #define s0      $16     /* callee saved */
30    #define s1      $17
31    #define s2      $18
32    #define s3      $19
33    #define s4      $20
34    #define s5      $21
35    #define s6      $22
36    #define s7      $23
37    #define t8      $24     /* code generator */
38    #define t9      $25
39    #define jp      $25     /* PIC jump register */
40    #define k0      $26     /* kernel temporary */
41    #define k1      $27
42    #define gp      $28     /* global pointer */
43    #define sp      $29     /* stack pointer */
44    #define fp      $30     /* frame pointer */
45    #define s8      $30     /* calle saved */
46    #define ra      $31     /* return address */
47    /** end <regdef.h> **/
48    
49  #include "ml-base.h"  #include "ml-base.h"
50  #include "asm-base.h"  #include "asm-base.h"
# Line 704  Line 741 
741   *      DIVIDE BY ZERO - (div)   *      DIVIDE BY ZERO - (div)
742   *      OVERFLOW/UNDERFLOW - (add,div,sub,mul) as appropriate   *      OVERFLOW/UNDERFLOW - (add,div,sub,mul) as appropriate
743   *   *
744   * floor raises integer overflow if the float is out of 32-bit range,   * floor does not check for out-of-range ;  it's up to the ML code to do that beforehand.
745   * so the float is tested before conversion, to make sure it is in (31-bit)   */
  * range */  
746  ML_CODE_HDR(floor_a)  ML_CODE_HDR(floor_a)
747          CHECKLIMIT(FUN_MASK)          CHECKLIMIT(FUN_MASK)
748          lwc1    $f4,LITTLEPART(stdarg)  /* get least significant word */          lwc1    $f4,LITTLEPART(stdarg)  /* get least significant word */
749          lwc1    $f5,BIGPART(stdarg)     /* get most significant word */          lwc1    $f5,BIGPART(stdarg)     /* get most significant word */
         mtc1    zero,$f2                /* ($f2,$f3) := maxint */  
         lui     atmp3,0x41d0  
         mtc1    atmp3,$f3  
         abs.d   $f6,$f4  
         c.le.d  $f6,$f2  
750          cfc1    atmp3,$31               /* grab fpa control register */          cfc1    atmp3,$31               /* grab fpa control register */
         bc1f    over  
751          ori     atmp2,atmp3,0x03        /* set rounding bits to 11 */          ori     atmp2,atmp3,0x03        /* set rounding bits to 11 */
752          ctc1    atmp2,$31               /* return fpa control register */          ctc1    atmp2,$31               /* return fpa control register */
753          cvt.w.d $f6,$f4                 /* convert to integer */          cvt.w.d $f6,$f4                 /* convert to integer */

Legend:
Removed from v.3  
changed lines
  Added in v.8

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0