Changeset 1916 for proto


Ignore:
Timestamp:
Feb 10, 2012, 7:56:05 AM (8 years ago)
Author:
cameron
Message:

Generate simd<1>::constant<0> in place of mvmd<1>::fill(0)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/pablo.py

    r1901 r1916  
    6262     0     => simd_const_1(0)
    6363     -1    => simd_const_1(1)
    64      if x: => if bitblock_has_bit(x):
    65   while x: => while bitblock_has_bit(x):
     64     if x: => if bitblock::any(x):
     65  while x: => while bitblock::any(x):
    6666  >>> ast_show(Bitwise_to_SIMD().xfrm(ast.parse("pfx = bit0 & bit1; sfx = bit0 &~ bit1")))
    6767 
     
    9090  def visit_Num(self, numnode):
    9191    n = numnode.n
    92     if n == 0: return mkCall('simd_const_1', [numnode])
    93     elif n == -1: return mkCall('simd_const_1', [ast.Num(1)])
     92    if n == 0: return mkCall('simd<1>::constant<0>', [])
     93    elif n == -1: return mkCall('simd<1>::constant<1>', [])
    9494    else: return numnode
    9595  def visit_If(self, ifNode):
    9696    self.generic_visit(ifNode)
    97     ifNode.test = mkCall('bitblock_has_bit', [ifNode.test])
     97    ifNode.test = mkCall('bitblock::any', [ifNode.test])
    9898    return ifNode
    9999  def visit_While(self, whileNode):
    100100    self.generic_visit(whileNode)
    101     whileNode.test = mkCall('bitblock_has_bit', [whileNode.test])
     101    whileNode.test = mkCall('bitblock::any', [whileNode.test])
    102102    return whileNode
    103103  def visit_Subscript(self, numnode):
     
    279279      if self.carryout != "": 
    280280        # Non final block: atEOF(x) = 0.
    281         return mkCall('simd_const_1', [ast.Num(0)])
     281        return mkCall('simd<1>::constant<0>', [])
    282282      else: return mkCall('simd_andc', [callnode.args[0], ast.Name('EOF_mask', ast.Load())])
    283283    elif is_BuiltIn_Call(callnode, 'inFile', 1):
Note: See TracChangeset for help on using the changeset viewer.