Ignore:
Timestamp:
Jun 1, 2016, 10:25:43 AM (8 years ago)
Author:
meunier
Message:

In rosenfeld:

  • Updated nrio0, nrio1, nrio2, nrio1f, nrio2f, nrio1x, nrbool1, nrbool2 and nralloc1 in the nrc2 lib in order to use macro-typed functions
  • Updated the simulation script to include performance evaluation with random images, and a script to generate graphs
  • Updated the clock.h to use 64-bit integers, which potentially breaks the printing on the giet
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/rosenfeld/nrc2/include/nrbool1.h

    r772 r822  
    1111#define _NR_BOOL1_H_
    1212
    13 #ifdef __cplusplus
    14 #ifdef PRAGMA_VERBOSE
    15 #pragma message ("C++")
    16 #endif
    17 extern "C" {
    18 #endif
    1913
    20 #ifdef PRAGMA_VERBOSE
    21 //#pragma message("- include nrbool1.h")
    22 #endif
    23 
    24 /* ========================= */
    25 /* === Logical operation === */
    26 /* ========================= */
     14/* ========================== */
     15/* === Logical operations === */
     16/* ========================== */
    2717
    2818/* ----------- */
     
    3020/* ----------- */
    3121/* Y = ! Y */
    32 IMAGE_EXPORT(void) not_bvector    (byte   *X, long ncl, long nch, byte   *Y);
    33 IMAGE_EXPORT(void) not_si8vector  (sint8  *X, long ncl, long nch, sint8  *Y);
    34 IMAGE_EXPORT(void) not_ui8vector  (uint8  *X, long ncl, long nch, uint8  *Y);
    35 IMAGE_EXPORT(void) not_si16vector (sint16 *X, long ncl, long nch, sint16 *Y);
    36 IMAGE_EXPORT(void) not_ui16vector (uint16 *X, long ncl, long nch, uint16 *Y);
    37 IMAGE_EXPORT(void) not_si32vector (sint32 *X, long ncl, long nch, sint32 *Y);
    38 IMAGE_EXPORT(void) not_ui32vector (uint32 *X, long ncl, long nch, uint32 *Y);
    39 IMAGE_EXPORT(void) not_si64vector (sint64 *X, long ncl, long nch, sint64 *Y);
    40 IMAGE_EXPORT(void) not_ui64vector (uint64 *X, long ncl, long nch, uint64 *Y);
    41 IMAGE_EXPORT(void) not_rgb8vector (rgb8   *X, long ncl, long nch, rgb8   *Y);
    42 IMAGE_EXPORT(void) not_rgbx8vector(rgbx8  *X, long ncl, long nch, rgbx8  *Y);
     22
     23#define not_type_vector(t) \
     24void short_name(t,not_,vector)(t * X, int32_t ncl, int32_t nch, t * Y)
     25
     26not_type_vector(int8_t);
     27not_type_vector(uint8_t);
     28not_type_vector(int16_t);
     29not_type_vector(uint16_t);
     30not_type_vector(int32_t);
     31not_type_vector(uint32_t);
     32not_type_vector(int64_t);
     33not_type_vector(uint64_t);
     34not_type_vector(rgb8);
     35not_type_vector(rgbx8);
     36
    4337
    4438/* ---------- */
     
    4741/* Z = X | Y */
    4842
    49 IMAGE_EXPORT(void) or_bvector    (byte   *X, long ncl, long nch, byte   *Y, byte    *Z);
    50 IMAGE_EXPORT(void) or_si8vector  (sint8  *X, long ncl, long nch, sint8  *Y, sint8   *Z);
    51 IMAGE_EXPORT(void) or_ui8vector  (uint8  *X, long ncl, long nch, uint8  *Y, uint8   *Z);
    52 IMAGE_EXPORT(void) or_si16vector (sint16 *X, long ncl, long nch, sint16 *Y, sint16  *Z);
    53 IMAGE_EXPORT(void) or_ui16vector (uint16 *X, long ncl, long nch, uint16 *Y, uint16  *Z);
    54 IMAGE_EXPORT(void) or_si32vector (sint32 *X, long ncl, long nch, sint32 *Y, sint32  *Z);
    55 IMAGE_EXPORT(void) or_ui32vector (uint32 *X, long ncl, long nch, uint32 *Y, uint32  *Z);
    56 IMAGE_EXPORT(void) or_si64vector (sint64 *X, long ncl, long nch, sint64 *Y, sint64  *Z);
    57 IMAGE_EXPORT(void) or_ui64vector (uint64 *X, long ncl, long nch, uint64 *Y, uint64  *Z);
    58 IMAGE_EXPORT(void) or_rgb8vector (rgb8   *X, long ncl, long nch, rgb8   *Y, rgb8    *Z);
    59 IMAGE_EXPORT(void) or_rgbx8vector(rgbx8  *X, long ncl, long nch, rgbx8  *Y, rgbx8   *Z);
     43#define or_type_vector(t) \
     44void short_name(t,or_,vector)(t * X, int32_t ncl, int32_t nch, t * Y, t * Z); \
     45void short_name(t,orc_,vector)(t * X, int32_t ncl, int32_t nch, t y, t * Z)
    6046
    61 IMAGE_EXPORT(void) orc_bvector    (byte   *X, long ncl, long nch, byte   y, byte    *Z);
    62 IMAGE_EXPORT(void) orc_si8vector  (sint8  *X, long ncl, long nch, sint8  y, sint8   *Z);
    63 IMAGE_EXPORT(void) orc_ui8vector  (uint8  *X, long ncl, long nch, uint8  y, uint8   *Z);
    64 IMAGE_EXPORT(void) orc_si16vector (sint16 *X, long ncl, long nch, sint16 y, sint16  *Z);
    65 IMAGE_EXPORT(void) orc_ui16vector (uint16 *X, long ncl, long nch, uint16 y, uint16  *Z);
    66 IMAGE_EXPORT(void) orc_si32vector (sint32 *X, long ncl, long nch, sint32 y, sint32  *Z);
    67 IMAGE_EXPORT(void) orc_ui32vector (uint32 *X, long ncl, long nch, uint32 y, uint32  *Z);
    68 IMAGE_EXPORT(void) orc_si64vector (sint64 *X, long ncl, long nch, sint64 y, sint64  *Z);
    69 IMAGE_EXPORT(void) orc_ui64vector (uint64 *X, long ncl, long nch, uint64 y, uint64  *Z);
    70 IMAGE_EXPORT(void) orc_rgb8vector (rgb8   *X, long ncl, long nch, rgb8   y, rgb8    *Z);
    71 IMAGE_EXPORT(void) orc_rgbx8vector(rgbx8  *X, long ncl, long nch, rgbx8  y, rgbx8   *Z);
     47or_type_vector(int8_t);
     48or_type_vector(uint8_t);
     49or_type_vector(int16_t);
     50or_type_vector(uint16_t);
     51or_type_vector(int32_t);
     52or_type_vector(uint32_t);
     53or_type_vector(int64_t);
     54or_type_vector(uint64_t);
     55or_type_vector(rgb8);
     56or_type_vector(rgbx8);
     57
    7258
    7359/* ----------- */
     
    7662/* Z = X ^ Y */
    7763
    78 IMAGE_EXPORT(void) xor_bvector    (byte   *X, long ncl, long nch, byte   *Y, byte    *Z);
    79 IMAGE_EXPORT(void) xor_si8vector  (sint8  *X, long ncl, long nch, sint8  *Y, sint8   *Z);
    80 IMAGE_EXPORT(void) xor_ui8vector  (uint8  *X, long ncl, long nch, uint8  *Y, uint8   *Z);
    81 IMAGE_EXPORT(void) xor_si16vector (sint16 *X, long ncl, long nch, sint16 *Y, sint16  *Z);
    82 IMAGE_EXPORT(void) xor_ui16vector (uint16 *X, long ncl, long nch, uint16 *Y, uint16  *Z);
    83 IMAGE_EXPORT(void) xor_si32vector (sint32 *X, long ncl, long nch, sint32 *Y, sint32  *Z);
    84 IMAGE_EXPORT(void) xor_ui32vector (uint32 *X, long ncl, long nch, uint32 *Y, uint32  *Z);
    85 IMAGE_EXPORT(void) xor_si64vector (sint64 *X, long ncl, long nch, sint64 *Y, sint64  *Z);
    86 IMAGE_EXPORT(void) xor_ui64vector (uint64 *X, long ncl, long nch, uint64 *Y, uint64  *Z);
    87 IMAGE_EXPORT(void) xor_rgb8vector (rgb8   *X, long ncl, long nch, rgb8   *Y, rgb8    *Z);
    88 IMAGE_EXPORT(void) xor_rgbx8vector(rgbx8  *X, long ncl, long nch, rgbx8  *Y, rgbx8   *Z);
     64#define xor_type_vector(t) \
     65void short_name(t,xor_,vector)(t * X, int32_t ncl, int32_t nch, t * Y, t * Z); \
     66void short_name(t,xorc_,vector)(t * X, int32_t ncl, int32_t nch, t y, t * Z)
    8967
    90 IMAGE_EXPORT(void) xorc_bvector    (byte   *X, long ncl, long nch, byte   y, byte    *Z);
    91 IMAGE_EXPORT(void) xorc_si8vector  (sint8  *X, long ncl, long nch, sint8  y, sint8   *Z);
    92 IMAGE_EXPORT(void) xorc_ui8vector  (uint8  *X, long ncl, long nch, uint8  y, uint8   *Z);
    93 IMAGE_EXPORT(void) xorc_si16vector (sint16 *X, long ncl, long nch, sint16 y, sint16  *Z);
    94 IMAGE_EXPORT(void) xorc_ui16vector (uint16 *X, long ncl, long nch, uint16 y, uint16  *Z);
    95 IMAGE_EXPORT(void) xorc_si32vector (sint32 *X, long ncl, long nch, sint32 y, sint32  *Z);
    96 IMAGE_EXPORT(void) xorc_ui32vector (uint32 *X, long ncl, long nch, uint32 y, uint32  *Z);
    97 IMAGE_EXPORT(void) xorc_si64vector (sint64 *X, long ncl, long nch, sint64 y, sint64  *Z);
    98 IMAGE_EXPORT(void) xorc_ui64vector (uint64 *X, long ncl, long nch, uint64 y, uint64  *Z);
    99 IMAGE_EXPORT(void) xorc_rgb8vector (rgb8   *X, long ncl, long nch, rgb8   y, rgb8    *Z);
    100 IMAGE_EXPORT(void) xorc_rgbx8vector(rgbx8  *X, long ncl, long nch, rgbx8  y, rgbx8   *Z);
     68xor_type_vector(int8_t);
     69xor_type_vector(uint8_t);
     70xor_type_vector(int16_t);
     71xor_type_vector(uint16_t);
     72xor_type_vector(int32_t);
     73xor_type_vector(uint32_t);
     74xor_type_vector(int64_t);
     75xor_type_vector(uint64_t);
     76xor_type_vector(rgb8);
     77xor_type_vector(rgbx8);
     78
    10179
    10280/* ----------- */
     
    10583/* Z = X & Y */
    10684
    107 IMAGE_EXPORT(void) and_bvector    (byte   *X, long ncl, long nch, byte   *Y, byte    *Z);
    108 IMAGE_EXPORT(void) and_si8vector  (sint8  *X, long ncl, long nch, sint8  *Y, sint8   *Z);
    109 IMAGE_EXPORT(void) and_ui8vector  (uint8  *X, long ncl, long nch, uint8  *Y, uint8   *Z);
    110 IMAGE_EXPORT(void) and_si16vector (sint16 *X, long ncl, long nch, sint16 *Y, sint16  *Z);
    111 IMAGE_EXPORT(void) and_ui16vector (uint16 *X, long ncl, long nch, uint16 *Y, uint16  *Z);
    112 IMAGE_EXPORT(void) and_si32vector (sint32 *X, long ncl, long nch, sint32 *Y, sint32  *Z);
    113 IMAGE_EXPORT(void) and_ui32vector (uint32 *X, long ncl, long nch, uint32 *Y, uint32  *Z);
    114 IMAGE_EXPORT(void) and_si64vector (sint64 *X, long ncl, long nch, sint64 *Y, sint64  *Z);
    115 IMAGE_EXPORT(void) and_ui64vector (uint64 *X, long ncl, long nch, uint64 *Y, uint64  *Z);
    116 IMAGE_EXPORT(void) and_rgb8vector (rgb8   *X, long ncl, long nch, rgb8   *Y, rgb8    *Z);
    117 IMAGE_EXPORT(void) and_rgbx8vector(rgbx8  *X, long ncl, long nch, rgbx8  *Y, rgbx8   *Z);
     85#define and_type_vector(t) \
     86void short_name(t,and_,vector)(t * X, int32_t ncl, int32_t nch, t * Y, t * Z); \
     87void short_name(t,andc_,vector)(t * X, int32_t ncl, int32_t nch, t y, t * Z)
    11888
    119 IMAGE_EXPORT(void) andc_bvector    (byte   *X, long ncl, long nch, byte   y, byte    *Z);
    120 IMAGE_EXPORT(void) andc_si8vector  (sint8  *X, long ncl, long nch, sint8  y, sint8   *Z);
    121 IMAGE_EXPORT(void) andc_ui8vector  (uint8  *X, long ncl, long nch, uint8  y, uint8   *Z);
    122 IMAGE_EXPORT(void) andc_si16vector (sint16 *X, long ncl, long nch, sint16 y, sint16  *Z);
    123 IMAGE_EXPORT(void) andc_ui16vector (uint16 *X, long ncl, long nch, uint16 y, uint16  *Z);
    124 IMAGE_EXPORT(void) andc_si32vector (sint32 *X, long ncl, long nch, sint32 y, sint32  *Z);
    125 IMAGE_EXPORT(void) andc_ui32vector (uint32 *X, long ncl, long nch, uint32 y, uint32  *Z);
    126 IMAGE_EXPORT(void) andc_si64vector (sint64 *X, long ncl, long nch, sint64 y, sint64  *Z);
    127 IMAGE_EXPORT(void) andc_ui64vector (uint64 *X, long ncl, long nch, uint64 y, uint64  *Z);
    128 IMAGE_EXPORT(void) andc_rgb8vector (rgb8   *X, long ncl, long nch, rgb8   y, rgb8    *Z);
    129 IMAGE_EXPORT(void) andc_rgbx8vector(rgbx8  *X, long ncl, long nch, rgbx8  y, rgbx8   *Z);
     89and_type_vector(int8_t);
     90and_type_vector(uint8_t);
     91and_type_vector(int16_t);
     92and_type_vector(uint16_t);
     93and_type_vector(int32_t);
     94and_type_vector(uint32_t);
     95and_type_vector(int64_t);
     96and_type_vector(uint64_t);
     97and_type_vector(rgb8);
     98and_type_vector(rgbx8);
    13099
    131100
    132 #ifdef __cplusplus
    133 }
    134 #endif
     101#endif // _NR_BOOL1_H_
    135102
    136 #endif // _NR_BOOL1_H_
     103// Local Variables:
     104// tab-width: 4
     105// c-basic-offset: 4
     106// c-file-offsets:((innamespace . 0)(inline-open . 0))
     107// indent-tabs-mode: nil
     108// End:
     109
     110// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
     111
Note: See TracChangeset for help on using the changeset viewer.