os/ossrv/genericopenlibs/liboil/src/copy/copy8x8.c
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2  * LIBOIL - Library of Optimized Inner Loops
     3  * Copyright (c) 2004 David A. Schleef <ds@schleef.org>
     4  * All rights reserved.
     5  *
     6  * Redistribution and use in source and binary forms, with or without
     7  * modification, are permitted provided that the following conditions
     8  * are met:
     9  * 1. Redistributions of source code must retain the above copyright
    10  *    notice, this list of conditions and the following disclaimer.
    11  * 2. Redistributions in binary form must reproduce the above copyright
    12  *    notice, this list of conditions and the following disclaimer in the
    13  *    documentation and/or other materials provided with the distribution.
    14  * 
    15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
    16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    17  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    18  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
    19  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    20  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    21  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
    23  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
    24  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    25  * POSSIBILITY OF SUCH DAMAGE.
    26  */
    27 //Portions Copyright (c)  2008-2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. 
    28 
    29 #ifdef HAVE_CONFIG_H
    30 #include "config.h"
    31 #endif
    32 
    33 #include <liboil/liboilfunction.h>
    34 
    35 OIL_DECLARE_CLASS (copy8x8_u8);
    36 
    37 #ifdef HAVE_UNALIGNED_ACCESS
    38 static void
    39 copy8x8_u8_ints (uint8_t *d1, int ds, const uint8_t *s1, int ss)
    40 {
    41   int j;
    42   for (j=0;j<8;j++){
    43     ((uint32_t*)d1)[0] = ((uint32_t*)s1)[0];
    44     ((uint32_t*)d1)[1] = ((uint32_t*)s1)[1];
    45 
    46     d1+=ds;
    47     s1+=ss;
    48   }
    49 }
    50 OIL_DEFINE_IMPL (copy8x8_u8_ints, copy8x8_u8);
    51 #endif
    52 
    53 #ifdef HAVE_UNALIGNED_ACCESS
    54 static void
    55 copy8x8_u8_ints_unrolled (uint8_t *d1, int ds, const uint8_t *s1, int ss)
    56 {
    57   ((uint32_t*)d1)[0] = ((uint32_t*)s1)[0];
    58   ((uint32_t*)d1)[1] = ((uint32_t*)s1)[1];
    59   d1+=ds; s1+=ss;
    60   ((uint32_t*)d1)[0] = ((uint32_t*)s1)[0];
    61   ((uint32_t*)d1)[1] = ((uint32_t*)s1)[1];
    62   d1+=ds; s1+=ss;
    63   ((uint32_t*)d1)[0] = ((uint32_t*)s1)[0];
    64   ((uint32_t*)d1)[1] = ((uint32_t*)s1)[1];
    65   d1+=ds; s1+=ss;
    66   ((uint32_t*)d1)[0] = ((uint32_t*)s1)[0];
    67   ((uint32_t*)d1)[1] = ((uint32_t*)s1)[1];
    68   d1+=ds; s1+=ss;
    69   ((uint32_t*)d1)[0] = ((uint32_t*)s1)[0];
    70   ((uint32_t*)d1)[1] = ((uint32_t*)s1)[1];
    71   d1+=ds; s1+=ss;
    72   ((uint32_t*)d1)[0] = ((uint32_t*)s1)[0];
    73   ((uint32_t*)d1)[1] = ((uint32_t*)s1)[1];
    74   d1+=ds; s1+=ss;
    75   ((uint32_t*)d1)[0] = ((uint32_t*)s1)[0];
    76   ((uint32_t*)d1)[1] = ((uint32_t*)s1)[1];
    77   d1+=ds; s1+=ss;
    78   ((uint32_t*)d1)[0] = ((uint32_t*)s1)[0];
    79   ((uint32_t*)d1)[1] = ((uint32_t*)s1)[1];
    80 }
    81 OIL_DEFINE_IMPL (copy8x8_u8_ints_unrolled, copy8x8_u8);
    82 #endif
    83 
    84 
    85 #ifdef HAVE_UNALIGNED_ACCESS
    86 #ifdef	__SYMBIAN32__
    87  
    88 OilFunctionImpl* __oil_function_impl_copy8x8_u8_ints() {
    89 		return &_oil_function_impl_copy8x8_u8_ints;
    90 }
    91 #endif
    92 #endif
    93 
    94 #ifdef HAVE_UNALIGNED_ACCESS
    95 #ifdef	__SYMBIAN32__
    96  
    97 OilFunctionImpl* __oil_function_impl_copy8x8_u8_ints_unrolled() {
    98 		return &_oil_function_impl_copy8x8_u8_ints_unrolled;
    99 }
   100 #endif
   101 #endif
   102