Changeset 351


Ignore:
Timestamp:
Jan 22, 2010, 4:15:20 PM (9 years ago)
Author:
eamiri
Message:

REAMDME updated
subtraction macro added to template

Location:
proto/parabix2/Compiler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/Compiler/README

    r350 r351  
    66
    77Output filename is optional. If it is not specified by uesr, the name "code.c" will be used. This file must be compiled using g++. Using gcc to compile this file produces error. It is recommended to use optimiztion flag -O3 when compiling this file.
     8
     9
     10=====================================
     11Variables:
     12    In any program compilable by this compiler all variables are assumed to be bit streams, arrays of bitstreams or structures of bitstreams.
     13
     14Valid operations on bit streams:
     15    Bitwise logical operations:
     16        And
     17        Or
     18        Xor
     19        And-Not (&~)
     20
     21    Predefind Functions:
     22        Advance
     23        ScanThru
     24
     25    Pragmas:
     26        optimize pragma
     27       
     28    Loops:
     29        while loop
     30   
     31    Function calls:
     32        Normal python function call
     33   
     34    Module importing:
     35        Simple form of module importing
     36
     37=====================================
     38Loops:
     39    The current valid form is: while var > 0 for bitstream var.
     40
     41Function Calls:
     42    Currently function calls must be of the following form: var = func(params)
     43    params is a list of positional arguments. Keyword arguments are not currently supported.
     44    func is the function name. It must return a single variable bitstream variable.
     45    All the functions will be inlined in the output C code.
     46    Function calls are only allowed within "main" function. No other function call is allowed, except calling predefined functions.
     47
     48Module importing:
     49    The following format is accepted currently, but implementation is not yet finished: import module_name[,module_name]
     50
     51=====================================
     52OTHER CONSTRAINTS:
     53    There should be one and only one return statement within the main function. This statement variables values of which is needed in other parts of the output program. A variables with name 'error_mask' is always assumed to be used in other parts of the output program. (This does not mean that your program should have a variable with this name). If you have a variable that specifies error locations, it is recommended to be named 'error_mask'.
     54       
  • proto/parabix2/Compiler/template.c

    r344 r351  
    8080
    8181
     82                     
     83#define double_int64_sbb(x1, x2, y1, y2, rslt1, rslt2, carry) \
     84  __asm__  ("sahf\n\t" \
     85            "sbb %[e1], %[z1]\n\t" \
     86            "sbb %[e2], %[z2]\n\t" \
     87            "lahf\n\t" \
     88         : [z1] "=r" (rslt1), [z2] "=r" (rslt2), [carry] "=a" (carry) \
     89         : "[z1]" (x1), "[z2]" (x2), \
     90           [e1] "r" (y1), [e2] "r" (y2), \
     91           "[carry]" (carry) \
     92         : "cc")
     93
     94static inline BitBlock sbb128(BitBlock first, BitBlock second, int &carry)
     95{
     96  union {__m128i bitblock;
     97         uint64_t int64[2];} rslt;
     98
     99  union {__m128i bitblock;
     100         uint64_t int64[2];} x;
     101
     102  union {__m128i bitblock;
     103         uint64_t int64[2];} y;
     104
     105  x.bitblock = first;
     106  y.bitblock = second;
     107
     108  double_int64_sbb(x.int64[0], x.int64[1], y.int64[0], y.int64[1],
     109                   rslt.int64[0], rslt.int64[1], carry);
     110
     111  return rslt.bitblock;
     112}
     113
     114
     115       
     116           
    82117#define BLOCK_SIZE 128
    83118
Note: See TracChangeset for help on using the changeset viewer.