Changeset 3847 for parabix-LLVM


Ignore:
Timestamp:
May 21, 2014, 5:38:16 PM (5 years ago)
Author:
cameron
Message:

Add minimum vector width parameter; use 32 as default.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • parabix-LLVM/mkValueTypes.py

    r3846 r3847  
    99
    1010
    11 def calculateTypeData(maxwidth=256):
     11def calculateTypeData(maxwidth, minvecwidth=32):
    1212    enumTypeLine =    "\t%s\t\t=  %s,\n"
    1313    defTypeLine = "def %s\t: ValueType<%s , %s>;\n"
     
    4343    VTmap['int_vector_value_type_defs'] = ''
    4444    for fw in fws:
    45         for fieldcount in [f for f in fws if f * fw <= maxwidth]:
     45        for fieldcount in [f for f in fws if f * fw <= maxwidth and f * fw >= minvecwidth]:
    4646            enumVal += 1
    4747            vType = "v%si%s" % (fieldcount, fw)
     
    222222
    223223
    224 def makeMachineValueType_h(maxwidth):
     224def makeMachineValueType_h(maxwidth, minwidth=32):
    225225    f = open('MachineValueType.h.pytemplate')
    226226    t = Template(f.read())
    227227    f.close()
    228     (VTmap, VectorSizeMap, VectorFieldSizeMap) = calculateTypeData(maxwidth)
     228    (VTmap, VectorSizeMap, VectorFieldSizeMap) = calculateTypeData(maxwidth, minwidth)
    229229    VTmap['isXXXBitFunctions'] = make_isXXXBitFunctions(VectorSizeMap)
    230230    VTmap['getVectorElementType'] = make_getVectorElementType(VectorFieldSizeMap)
     
    240240    f.close()
    241241
    242 def makeValueTypes_td(maxwidth):
     242def makeValueTypes_td(maxwidth, minwidth=32):
    243243    f = open('ValueTypes.td.pytemplate')
    244244    t = Template(f.read())
    245245    f.close()
    246     (VTmap, VectorSizeMap, VectorFieldSizeMap) = calculateTypeData(maxwidth)
     246    (VTmap, VectorSizeMap, VectorFieldSizeMap) = calculateTypeData(maxwidth, minwidth)
    247247    content = t.substitute(VTmap)
    248248    if os.path.exists("ValueTypes.td") and  not os.path.exists("ValueTypes.td.bak"):
     
    253253
    254254if __name__ == '__main__':
    255     makeMachineValueType_h(1024)
    256     makeValueTypes_td(1024)
     255    makeMachineValueType_h(1024, 32)
     256    makeValueTypes_td(1024, 32)
Note: See TracChangeset for help on using the changeset viewer.