Changeset 818

Show
Ignore:
Timestamp:
01/06/08 05:57:28 (13 years ago)
Author:
ppalmers
Message:

add prefetch commands, can't harm

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/api-cleanup/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp

    r817 r818  
    448448    for (i = 0; i < m_nb_audio_ports; i++) { 
    449449        target_event = (quadlet_t *)(data + i); 
     450        __builtin_prefetch(target_event, 1, 0); // prefetch events for write, no temporal locality 
    450451 
    451452        for (j = 0;j < nevents; j += 1) 
     
    453454            *target_event = htonl( 0x40000000 ); 
    454455            target_event += m_dimension; 
     456            __builtin_prefetch(target_event, 1, 0); // prefetch events for write, no temporal locality 
    455457        } 
    456458    } 
     
    475477        struct _MBLA_port_cache &p = m_audio_ports.at(i); 
    476478        target_event = (quadlet_t *)(data + i); 
     479        __builtin_prefetch(target_event, 1, 0); // prefetch events for write, no temporal locality 
    477480        assert(nevents + offset <= p.buffer_size ); 
    478481 
    479482        float *buffer = (float *)(p.buffer); 
    480483        buffer += offset; 
     484        __builtin_prefetch(buffer, 0, 0); // prefetch events for read, no temporal locality 
    481485 
    482486        for (j = 0;j < nevents; j += 1) 
     
    487491            *target_event = htonl ( ( tmp >> 8 ) | 0x40000000 ); 
    488492            buffer++; 
     493            __builtin_prefetch(buffer, 0, 0); // prefetch events for read, no temporal locality 
    489494            target_event += m_dimension; 
     495            __builtin_prefetch(target_event, 1, 0); // prefetch events for write, no temporal locality 
    490496        } 
    491497    } 
     
    510516        struct _MBLA_port_cache &p = m_audio_ports.at(i); 
    511517        target_event = (quadlet_t *)(data + i); 
     518        __builtin_prefetch(target_event, 1, 0); // prefetch events for write, no temporal locality 
    512519        assert(nevents + offset <= p.buffer_size ); 
    513520 
    514521        uint32_t *buffer = (uint32_t *)(p.buffer); 
    515522        buffer += offset; 
     523        __builtin_prefetch(buffer, 0, 0); // prefetch events for read, no temporal locality 
    516524 
    517525        for (j = 0; j < nevents; j += 1) 
     
    519527            *target_event = htonl(((*buffer) & 0x00FFFFFF) | 0x40000000); 
    520528            buffer++; 
     529            __builtin_prefetch(buffer, 0, 0); // prefetch events for read, no temporal locality 
     530 
    521531            target_event += m_dimension; 
     532            __builtin_prefetch(target_event, 1, 0); // prefetch events for write, no temporal locality 
    522533        } 
    523534    } 
     
    543554        for (j = p.location;j < nevents; j += 8) { 
    544555            target_event = (quadlet_t *) (data + ((j * m_dimension) + p.position)); 
     556            __builtin_prefetch(target_event, 1, 0); // prefetch events for write, no temporal locality 
    545557            *target_event = htonl(IEC61883_AM824_SET_LABEL(0, IEC61883_AM824_LABEL_MIDI_NO_DATA)); 
    546558        } 
     
    566578        uint32_t *buffer = (quadlet_t *)(p.buffer); 
    567579        buffer += offset; 
     580        __builtin_prefetch(buffer, 0, 0); // prefetch events for read, no temporal locality 
    568581 
    569582        for (j = p.location;j < nevents; j += 8) { 
    570583            target_event = (quadlet_t *) (data + ((j * m_dimension) + p.position)); 
     584            __builtin_prefetch(target_event, 1, 0); // prefetch events for write, no temporal locality 
     585 
    571586            if ( *buffer & 0xFF000000 )   // we can send a byte 
    572587            { 
  • branches/api-cleanup/tests/streaming/teststreaming3.cpp

    r816 r818  
    419419            continue; 
    420420        } 
    421          
     421 
    422422        ffado_streaming_transfer_capture_buffers(dev); 
    423          
     423 
    424424        if (arguments.test_tone) { 
    425425            // generate the test tone