[Tinyos-commits] CVS: tinyos-1.x/tos/lib/VM/languages/motlle/mate MOParithM.nc, 1.3, 1.4 MOPrelM.nc, 1.3, 1.4 MemoryM.nc, 1.8, 1.9 Motlle.h, 1.7, 1.8 MotllePlatform.h, 1.1, 1.2

David Gay idgay at users.sourceforge.net
Tue Nov 29 14:53:19 PST 2005


Update of /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15897

Modified Files:
	MOParithM.nc MOPrelM.nc MemoryM.nc Motlle.h MotllePlatform.h 
Log Message:
tweaks to reduce code size


Index: MOParithM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/MOParithM.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MOParithM.nc	1 Nov 2005 02:28:11 -0000	1.3
--- MOParithM.nc	29 Nov 2005 22:53:16 -0000	1.4
***************
*** 21,25 ****
  }
  implementation {
!   result_t floatOp(uint8_t instr, vreal x, vreal y, MateContext *context) {
      vreal r = 0;
  
--- 21,25 ----
  }
  implementation {
!   void floatOp(uint8_t instr, vreal x, vreal y, MateContext *context) {
      vreal r = 0;
  
***************
*** 40,44 ****
        }
      call S.qpush(context, call T.make_real(r));
-     return SUCCESS;
    }
  
--- 40,43 ----
***************
*** 78,88 ****
        }
      else if (call T.real_realp(x, y))
!       return floatOp(instr, call T.real(x), call T.real(y), context);
      else if (call T.real_intp(x, y))
!       return floatOp(instr, call T.real(x), call T.intv(y), context);
      else if (call T.real_intp(y, x))
!       return floatOp(instr, call T.intv(x), call T.real(y), context);
! 
!     call E.error(context, MOTLLE_ERROR_BAD_TYPE);
      return SUCCESS;
    }
--- 77,87 ----
        }
      else if (call T.real_realp(x, y))
!       floatOp(instr, call T.real(x), call T.real(y), context);
      else if (call T.real_intp(x, y))
!       floatOp(instr, call T.real(x), call T.intv(y), context);
      else if (call T.real_intp(y, x))
!       floatOp(instr, call T.intv(x), call T.real(y), context);
!     else
!       call E.error(context, MOTLLE_ERROR_BAD_TYPE);
      return SUCCESS;
    }

Index: MOPrelM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/MOPrelM.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MOPrelM.nc	1 Nov 2005 02:28:11 -0000	1.3
--- MOPrelM.nc	29 Nov 2005 22:53:16 -0000	1.4
***************
*** 20,24 ****
  }
  implementation {
!   result_t floatOp(uint8_t instr, vreal x, vreal y, MateContext *context) {
      bool r;
  
--- 20,24 ----
  }
  implementation {
!   void floatOp(uint8_t instr, vreal x, vreal y, MateContext *context) {
      bool r;
  
***************
*** 32,36 ****
        }
      call S.qpush(context, call T.make_bool(r));
-     return SUCCESS;
    }
  
--- 32,35 ----
***************
*** 55,65 ****
        }
      else if (call T.real_realp(x, y))
!       return floatOp(instr, call T.real(x), call T.real(y), context);
      else if (call T.real_intp(x, y))
!       return floatOp(instr, call T.real(x), call T.intv(y), context);
      else if (call T.real_intp(y, x))
!       return floatOp(instr, call T.intv(x), call T.real(y), context);
! 
!     call E.error(context, MOTLLE_ERROR_BAD_TYPE);
      return SUCCESS;
    }
--- 54,64 ----
        }
      else if (call T.real_realp(x, y))
!       floatOp(instr, call T.real(x), call T.real(y), context);
      else if (call T.real_intp(x, y))
!       floatOp(instr, call T.real(x), call T.intv(y), context);
      else if (call T.real_intp(y, x))
!       floatOp(instr, call T.intv(x), call T.real(y), context);
!     else
!       call E.error(context, MOTLLE_ERROR_BAD_TYPE);
      return SUCCESS;
    }

Index: MemoryM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/MemoryM.nc,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** MemoryM.nc	23 Nov 2005 23:16:23 -0000	1.8
--- MemoryM.nc	29 Nov 2005 22:53:16 -0000	1.9
***************
*** 58,62 ****
    uint8_t gcpro;
  
!   MINLINE command uint8_t *GC.base() { /* Return base of GC area */
  #ifdef PLATFORM_REQUIRES_ALIGNMENT
      return (uint8_t *)ALIGN((intptr_t)mcapsule.data, MOTLLE_HEAP_ALIGNMENT);
--- 58,62 ----
    uint8_t gcpro;
  
!   inline command uint8_t *GC.base() { /* Return base of GC area */
  #ifdef PLATFORM_REQUIRES_ALIGNMENT
      return (uint8_t *)ALIGN((intptr_t)mcapsule.data, MOTLLE_HEAP_ALIGNMENT);
***************
*** 66,70 ****
    }
  
!   MINLINE uint8_t *capsule_end() {
      return (uint8_t *)ALIGN_DOWN((intptr_t)mcapsule.data + sizeof mcapsule.data, MOTLLE_STACK_ALIGNMENT);
    }
--- 66,70 ----
    }
  
!   inline uint8_t *capsule_end() {
      return (uint8_t *)ALIGN_DOWN((intptr_t)mcapsule.data + sizeof mcapsule.data, MOTLLE_STACK_ALIGNMENT);
    }
***************
*** 82,89 ****
    command result_t StdControl.init() {
      call Virus.registerCapsule(0, &mcapsule);
- #if 1
      if (TOS_LOCAL_ADDRESS != 0)
        call PowerMgmtEnable();
- #endif
      return SUCCESS;
    }
--- 82,87 ----
***************
*** 171,175 ****
    /* Returns TRUE if ptr is in a mutable object (i.e., above gc_heap)
     */
!   MINLINE command bool GC.mutable(void *ptr) {
      return ptr >= (void *)gc_heap;
    }
--- 169,173 ----
    /* Returns TRUE if ptr is in a mutable object (i.e., above gc_heap)
     */
!   command bool GC.mutable(void *ptr) {
      return ptr >= (void *)gc_heap;
    }

Index: Motlle.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/Motlle.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Motlle.h	23 Nov 2005 23:16:23 -0000	1.7
--- Motlle.h	29 Nov 2005 22:53:16 -0000	1.8
***************
*** 41,46 ****
  */
  
! #define MINLINE
!   
  #include "BaseTypes.h"
  
--- 41,47 ----
  */
  
! /* Disable asserts */
! #define NDEBUG
! 
  #include "BaseTypes.h"
  
***************
*** 83,87 ****
  // If a type above has a single rep, it has an associated vXXX typedef
  typedef ivalue vint;
- typedef float vreal;
  typedef avalue vprimitive;
  typedef avalue vsymbol;
--- 84,87 ----

Index: MotllePlatform.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/MotllePlatform.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MotllePlatform.h	23 Nov 2005 23:16:23 -0000	1.1
--- MotllePlatform.h	29 Nov 2005 22:53:16 -0000	1.2
***************
*** 19,22 ****
--- 19,24 ----
     PLATFORM_REQUIRES_ALIGNMENT except if your platform supports unaligned 
       reads.
+    MINLINE to inline if you want to inline performance-critical routines
+      and can afford the code space, or to nothing if you can't
  */
  
***************
*** 31,34 ****
--- 33,39 ----
  #undef PLATFORM_REQUIRES_ALIGNMENT
  
+ /* Trade code space for performance */
+ #define MINLINE inline
+   
  #elif defined(PLATFORM_TELOS) || defined(PLATFORM_TELOSB)
  
***************
*** 41,44 ****
--- 46,52 ----
  #define PLATFORM_REQUIRES_ALIGNMENT
  
+ /* Trade performace for code space */
+ #define MINLINE
+   
  #else
  #error "Unsupported platform. Add appropriate definitions to this file (MotllePlatform.h)"



More information about the Tinyos-commits mailing list