parameters: (emitter, zip_lanes, leftovers, aligned)
docstring: Emit the zip function for a given number of rows and row size leftovers.
docstring_summary: Emit the zip function for a given number of rows and row size leftovers.
docstring_tokens: Emit the zip function for a given number of rows and row size leftovers .
function: def GenerateZipNx8(emitter, zip_lanes, leftovers, aligned):
    """Emit the zip function for a given number of rows and row size leftovers."""
    if leftovers < 0 or leftovers > 7:
      raise ConfigurationError('Leftovers should be between 0 and 7 inclusive.')
    if zip_lanes < 1 or zip_lanes > 4:
      raise ConfigurationError('Zip_lanes should should be 1, 2, 3 or 4.')
  
    name = BuildName(zip_lanes, leftovers, aligned)
  
    emitter.EmitFunctionBeginA(name, [['const std::uint8_t*', 'source'],
                                      ['std::int32_t', 'count'],
                                      ['std::int32_t', 'stride'],
                                      ['std::uint8_t*', 'destination'],
                                      ['std::int32_t', 'multiplicative_offset'],
                                      ['std::int32_t', 'additive_offset']],
                               'void')
    emitter.EmitAssert('count %% 8 == %d' % leftovers)
    emitter.EmitAssert('count <= 2048')
    emitter.EmitAssert('count >= 8')
    emitter.EmitAssert('reinterpret_cast<std::uintptr_t>(destination) % 8 == 0')
    if aligned:
      emitter.EmitAssert('reinterpret_cast<std::uintptr_t>(source) % 8 == 0')
      if zip_lanes > 1:
        emitter.EmitAssert('stride % 8 == 0')
    emitter.EmitAsmBegin()
  
    registers = emitter.CreateRegisters()
  
    count = registers.MapParameter('count')
    output_address = registers.MapParameter('destination')
  
    lanes = GenerateZipLanes(emitter, registers, zip_lanes,
                             registers.MapParameter('source'),
                             registers.MapParameter('stride'))
  
    if leftovers:
      emitter.EmitSub(count, count, emitter.ImmediateConstant(leftovers))
  
    GenerateClearAggregators(emitter, lanes)
  
    emitter.EmitNewline()
    emitter.EmitNumericalLabel(1)
    emitter.EmitSubs(count, count, emitter.ImmediateConstant(8))
  
    GenerateLoadAggregateStore(emitter, lanes, output_address, 64 if aligned else
                               None)
  
    emitter.EmitNewline()
    emitter.EmitBneBack(1)
  
    if leftovers:
      GenerateLeftoverLoadAggregateStore(emitter, leftovers, lanes,
                                         output_address)
  
    GenerateAggregatorReduction(emitter, registers, lanes, output_address,
                                registers.MapParameter('multiplicative_offset'),
                                registers.MapParameter('additive_offset'))
  
    emitter.EmitAsmEnd(registers.MappedParameters(), [],
                       registers.Clobbers() + ['cc', 'memory'])
    emitter.EmitFunctionEnd()
function_tokens: def GenerateZipNx8 ( emitter , zip_lanes , leftovers , aligned ) : if leftovers < 0 or leftovers > 7 : raise ConfigurationError ( 'Leftovers should be between 0 and 7 inclusive.' ) if zip_lanes < 1 or zip_lanes > 4 : raise ConfigurationError ( 'Zip_lanes should should be 1, 2, 3 or 4.' ) name = BuildName ( zip_lanes , leftovers , aligned ) emitter . EmitFunctionBeginA ( name , [ [ 'const std::uint8_t*' , 'source' ] , [ 'std::int32_t' , 'count' ] , [ 'std::int32_t' , 'stride' ] , [ 'std::uint8_t*' , 'destination' ] , [ 'std::int32_t' , 'multiplicative_offset' ] , [ 'std::int32_t' , 'additive_offset' ] ] , 'void' ) emitter . EmitAssert ( 'count %% 8 == %d' % leftovers ) emitter . EmitAssert ( 'count <= 2048' ) emitter . EmitAssert ( 'count >= 8' ) emitter . EmitAssert ( 'reinterpret_cast<std::uintptr_t>(destination) % 8 == 0' ) if aligned : emitter . EmitAssert ( 'reinterpret_cast<std::uintptr_t>(source) % 8 == 0' ) if zip_lanes > 1 : emitter . EmitAssert ( 'stride % 8 == 0' ) emitter . EmitAsmBegin ( ) registers = emitter . CreateRegisters ( ) count = registers . MapParameter ( 'count' ) output_address = registers . MapParameter ( 'destination' ) lanes = GenerateZipLanes ( emitter , registers , zip_lanes , registers . MapParameter ( 'source' ) , registers . MapParameter ( 'stride' ) ) if leftovers : emitter . EmitSub ( count , count , emitter . ImmediateConstant ( leftovers ) ) GenerateClearAggregators ( emitter , lanes ) emitter . EmitNewline ( ) emitter . EmitNumericalLabel ( 1 ) emitter . EmitSubs ( count , count , emitter . ImmediateConstant ( 8 ) ) GenerateLoadAggregateStore ( emitter , lanes , output_address , 64 if aligned else None ) emitter . EmitNewline ( ) emitter . EmitBneBack ( 1 ) if leftovers : GenerateLeftoverLoadAggregateStore ( emitter , leftovers , lanes , output_address ) GenerateAggregatorReduction ( emitter , registers , lanes , output_address , registers . MapParameter ( 'multiplicative_offset' ) , registers . MapParameter ( 'additive_offset' ) ) emitter . EmitAsmEnd ( registers . MappedParameters ( ) , [ ] , registers . Clobbers ( ) + [ 'cc' , 'memory' ] ) emitter . EmitFunctionEnd ( )