LCOV - code coverage report
Current view: directory - gfx/skia/src/opts - SkUtils_opts_SSE2.cpp (source / functions) Found Hit Coverage
Test: app.info Lines: 40 0 0.0 %
Date: 2012-06-02 Functions: 2 0 0.0 %

       1                 : 
       2                 : /*
       3                 :  * Copyright 2009 The Android Open Source Project
       4                 :  *
       5                 :  * Use of this source code is governed by a BSD-style license that can be
       6                 :  * found in the LICENSE file.
       7                 :  */
       8                 : 
       9                 : 
      10                 : #include <emmintrin.h>
      11                 : #include "SkUtils_opts_SSE2.h"
      12                 :  
      13               0 : void sk_memset16_SSE2(uint16_t *dst, uint16_t value, int count)
      14                 : {
      15               0 :     SkASSERT(dst != NULL && count >= 0);
      16                 : 
      17                 :     // dst must be 2-byte aligned.
      18               0 :     SkASSERT((((size_t) dst) & 0x01) == 0);
      19                 : 
      20               0 :     if (count >= 32) {
      21               0 :         while (((size_t)dst) & 0x0F) {
      22               0 :             *dst++ = value;
      23               0 :             --count;
      24                 :         }
      25               0 :         __m128i *d = reinterpret_cast<__m128i*>(dst);
      26               0 :         __m128i value_wide = _mm_set1_epi16(value);
      27               0 :         while (count >= 32) {
      28               0 :             _mm_store_si128(d++, value_wide);
      29               0 :             _mm_store_si128(d++, value_wide);
      30               0 :             _mm_store_si128(d++, value_wide);
      31               0 :             _mm_store_si128(d++, value_wide);
      32               0 :             count -= 32;
      33                 :         }
      34               0 :         dst = reinterpret_cast<uint16_t*>(d);
      35                 :     }
      36               0 :     while (count > 0) {
      37               0 :         *dst++ = value;
      38               0 :         --count;
      39                 :     }
      40               0 : }
      41                 :  
      42               0 : void sk_memset32_SSE2(uint32_t *dst, uint32_t value, int count)
      43                 : {
      44               0 :     SkASSERT(dst != NULL && count >= 0);
      45                 : 
      46                 :     // dst must be 4-byte aligned.
      47               0 :     SkASSERT((((size_t) dst) & 0x03) == 0);
      48                 : 
      49               0 :     if (count >= 16) {
      50               0 :         while (((size_t)dst) & 0x0F) {
      51               0 :             *dst++ = value;
      52               0 :             --count;
      53                 :         }
      54               0 :         __m128i *d = reinterpret_cast<__m128i*>(dst);
      55               0 :         __m128i value_wide = _mm_set1_epi32(value);
      56               0 :         while (count >= 16) {
      57               0 :             _mm_store_si128(d++, value_wide);
      58               0 :             _mm_store_si128(d++, value_wide);
      59               0 :             _mm_store_si128(d++, value_wide);
      60               0 :             _mm_store_si128(d++, value_wide);
      61               0 :             count -= 16;
      62                 :         }
      63               0 :         dst = reinterpret_cast<uint32_t*>(d);
      64                 :     }
      65               0 :     while (count > 0) {
      66               0 :         *dst++ = value;
      67               0 :         --count;
      68                 :     }
      69               0 : }

Generated by: LCOV version 1.7