Changeset 455


Ignore:
Timestamp:
Jul 9, 2010, 3:48:07 PM (9 years ago)
Author:
cameron
Message:

Add test_carry function

Location:
proto
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/py2bitexpr.py

    r454 r455  
    14751475
    14761476    elif isinstance(s[0], bitexpr.WhileLoop):
    1477         if int_carry:
    1478                 code = "\n%s((%s)||((256&%s)%s)) {\n"%(" "*indent+"while"+" ", generate_condition(s[0].control_expr), s[0].carry_expr.var.varname, ">0")
    1479         else:
    1480                         code = "\n%s((%s)||(bitblock_has_bit(%s))) {\n"%(" "*indent+"while"+" ", generate_condition(s[0].control_expr), s[0].carry_expr.var.varname)
     1477        code = "\n%s((%s)||(test_carry(%s))) {\n"%(" "*indent+"while"+" ", generate_condition(s[0].control_expr), s[0].carry_expr.var.varname)
    14811478        code += print_block_stmts(s[0].stmts, int_carry, indent+indent_unit)
    14821479        code += " "*indent+"}\n"
  • proto/parabix2/compiled/block_carry.h

    r454 r455  
    1919
    2020#define Carry0 0
     21
     22#define test_carry(x) (((x)&256) > 0)
    2123
    2224#define double_int64_adc(x1, x2, y1, y2, rslt1, rslt2, carry) \
     
    9496#define Carry0 simd_const_1(0)
    9597
     98#define test_carry(x) bitblock_has_bit(x)
     99
    96100#define adc128(x, y, carry,  sum) \
    97101do{ \
Note: See TracChangeset for help on using the changeset viewer.