1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/liboil/src/c/ag_clamp_c.c Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,1914 @@
1.4 +/* This file is autogenerated. Do not edit. */
1.5 +/*
1.6 + * LIBOIL - Library of Optimized Inner Loops
1.7 + * Copyright (c) 2005 David A. Schleef <ds@schleef.org>
1.8 + * All rights reserved.
1.9 + *
1.10 + * Redistribution and use in source and binary forms, with or without
1.11 + * modification, are permitted provided that the following conditions
1.12 + * are met:
1.13 + * 1. Redistributions of source code must retain the above copyright
1.14 + * notice, this list of conditions and the following disclaimer.
1.15 + * 2. Redistributions in binary form must reproduce the above copyright
1.16 + * notice, this list of conditions and the following disclaimer in the
1.17 + * documentation and/or other materials provided with the distribution.
1.18 + *
1.19 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1.20 + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1.21 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1.22 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
1.23 + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
1.24 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
1.25 + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1.26 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
1.27 + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
1.28 + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
1.29 + * POSSIBILITY OF SUCH DAMAGE.
1.30 + */
1.31 +//Portions Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
1.32 +
1.33 +#ifdef HAVE_CONFIG_H
1.34 +#include "config.h"
1.35 +#endif
1.36 +
1.37 +#include <math.h>
1.38 +
1.39 +#include "liboil/liboil.h"
1.40 +#include "liboil/liboilclasses.h"
1.41 +
1.42 +static void
1.43 +clamp_s8_pointer (oil_type_s8 *dest, oil_type_s8 *src1,
1.44 + int n
1.45 + , oil_type_s8 *low
1.46 + , oil_type_s8 *high
1.47 + )
1.48 +{
1.49 + while (n) {
1.50 + oil_type_s8 x = *src1;
1.51 + if (x < *low) x = *low;
1.52 + if (x > *high) x = *high;
1.53 + *dest = x;
1.54 + dest++;
1.55 + src1++;
1.56 + n--;
1.57 + }
1.58 +}
1.59 +OIL_DEFINE_IMPL (clamp_s8_pointer, clamp_s8);
1.60 +
1.61 +static void
1.62 +clamp_u8_pointer (oil_type_u8 *dest, oil_type_u8 *src1,
1.63 + int n
1.64 + , oil_type_u8 *low
1.65 + , oil_type_u8 *high
1.66 + )
1.67 +{
1.68 + while (n) {
1.69 + oil_type_u8 x = *src1;
1.70 + if (x < *low) x = *low;
1.71 + if (x > *high) x = *high;
1.72 + *dest = x;
1.73 + dest++;
1.74 + src1++;
1.75 + n--;
1.76 + }
1.77 +}
1.78 +OIL_DEFINE_IMPL (clamp_u8_pointer, clamp_u8);
1.79 +
1.80 +static void
1.81 +clamp_s16_pointer (oil_type_s16 *dest, oil_type_s16 *src1,
1.82 + int n
1.83 + , oil_type_s16 *low
1.84 + , oil_type_s16 *high
1.85 + )
1.86 +{
1.87 + while (n) {
1.88 + oil_type_s16 x = *src1;
1.89 + if (x < *low) x = *low;
1.90 + if (x > *high) x = *high;
1.91 + *dest = x;
1.92 + dest++;
1.93 + src1++;
1.94 + n--;
1.95 + }
1.96 +}
1.97 +OIL_DEFINE_IMPL (clamp_s16_pointer, clamp_s16);
1.98 +
1.99 +static void
1.100 +clamp_u16_pointer (oil_type_u16 *dest, oil_type_u16 *src1,
1.101 + int n
1.102 + , oil_type_u16 *low
1.103 + , oil_type_u16 *high
1.104 + )
1.105 +{
1.106 + while (n) {
1.107 + oil_type_u16 x = *src1;
1.108 + if (x < *low) x = *low;
1.109 + if (x > *high) x = *high;
1.110 + *dest = x;
1.111 + dest++;
1.112 + src1++;
1.113 + n--;
1.114 + }
1.115 +}
1.116 +OIL_DEFINE_IMPL (clamp_u16_pointer, clamp_u16);
1.117 +
1.118 +static void
1.119 +clamp_s32_pointer (oil_type_s32 *dest, oil_type_s32 *src1,
1.120 + int n
1.121 + , oil_type_s32 *low
1.122 + , oil_type_s32 *high
1.123 + )
1.124 +{
1.125 + while (n) {
1.126 + oil_type_s32 x = *src1;
1.127 + if (x < *low) x = *low;
1.128 + if (x > *high) x = *high;
1.129 + *dest = x;
1.130 + dest++;
1.131 + src1++;
1.132 + n--;
1.133 + }
1.134 +}
1.135 +OIL_DEFINE_IMPL (clamp_s32_pointer, clamp_s32);
1.136 +
1.137 +static void
1.138 +clamp_u32_pointer (oil_type_u32 *dest, oil_type_u32 *src1,
1.139 + int n
1.140 + , oil_type_u32 *low
1.141 + , oil_type_u32 *high
1.142 + )
1.143 +{
1.144 + while (n) {
1.145 + oil_type_u32 x = *src1;
1.146 + if (x < *low) x = *low;
1.147 + if (x > *high) x = *high;
1.148 + *dest = x;
1.149 + dest++;
1.150 + src1++;
1.151 + n--;
1.152 + }
1.153 +}
1.154 +OIL_DEFINE_IMPL (clamp_u32_pointer, clamp_u32);
1.155 +
1.156 +static void
1.157 +clamp_s8_unroll4 (oil_type_s8 *dest, oil_type_s8 *src,
1.158 + int n , oil_type_s8 *low, oil_type_s8 *high)
1.159 +{
1.160 + oil_type_s8 x;
1.161 + while (n&3) {
1.162 + x = *src;
1.163 + if (x < *low) x = *low;
1.164 + if (x > *high) x = *high;
1.165 +
1.166 + *dest = x;
1.167 + dest++;
1.168 + src++;
1.169 + n--;
1.170 + }
1.171 + n >>= 2;
1.172 + while (n) {
1.173 + x = src[0];
1.174 + if (x < *low) x = *low;
1.175 + if (x > *high) x = *high;
1.176 +
1.177 + dest[0] = x;
1.178 + x = src[1];
1.179 + if (x < *low) x = *low;
1.180 + if (x > *high) x = *high;
1.181 +
1.182 + dest[1] = x;
1.183 + x = src[2];
1.184 + if (x < *low) x = *low;
1.185 + if (x > *high) x = *high;
1.186 +
1.187 + dest[2] = x;
1.188 + x = src[3];
1.189 + if (x < *low) x = *low;
1.190 + if (x > *high) x = *high;
1.191 +
1.192 + dest[3] = x;
1.193 + dest+=4;
1.194 + src+=4;
1.195 + n--;
1.196 + }
1.197 +}
1.198 +OIL_DEFINE_IMPL (clamp_s8_unroll4, clamp_s8);
1.199 +
1.200 +static void
1.201 +clamp_u8_unroll4 (oil_type_u8 *dest, oil_type_u8 *src,
1.202 + int n , oil_type_u8 *low, oil_type_u8 *high)
1.203 +{
1.204 + oil_type_u8 x;
1.205 + while (n&3) {
1.206 + x = *src;
1.207 + if (x < *low) x = *low;
1.208 + if (x > *high) x = *high;
1.209 +
1.210 + *dest = x;
1.211 + dest++;
1.212 + src++;
1.213 + n--;
1.214 + }
1.215 + n >>= 2;
1.216 + while (n) {
1.217 + x = src[0];
1.218 + if (x < *low) x = *low;
1.219 + if (x > *high) x = *high;
1.220 +
1.221 + dest[0] = x;
1.222 + x = src[1];
1.223 + if (x < *low) x = *low;
1.224 + if (x > *high) x = *high;
1.225 +
1.226 + dest[1] = x;
1.227 + x = src[2];
1.228 + if (x < *low) x = *low;
1.229 + if (x > *high) x = *high;
1.230 +
1.231 + dest[2] = x;
1.232 + x = src[3];
1.233 + if (x < *low) x = *low;
1.234 + if (x > *high) x = *high;
1.235 +
1.236 + dest[3] = x;
1.237 + dest+=4;
1.238 + src+=4;
1.239 + n--;
1.240 + }
1.241 +}
1.242 +OIL_DEFINE_IMPL (clamp_u8_unroll4, clamp_u8);
1.243 +
1.244 +static void
1.245 +clamp_s16_unroll4 (oil_type_s16 *dest, oil_type_s16 *src,
1.246 + int n , oil_type_s16 *low, oil_type_s16 *high)
1.247 +{
1.248 + oil_type_s16 x;
1.249 + while (n&3) {
1.250 + x = *src;
1.251 + if (x < *low) x = *low;
1.252 + if (x > *high) x = *high;
1.253 +
1.254 + *dest = x;
1.255 + dest++;
1.256 + src++;
1.257 + n--;
1.258 + }
1.259 + n >>= 2;
1.260 + while (n) {
1.261 + x = src[0];
1.262 + if (x < *low) x = *low;
1.263 + if (x > *high) x = *high;
1.264 +
1.265 + dest[0] = x;
1.266 + x = src[1];
1.267 + if (x < *low) x = *low;
1.268 + if (x > *high) x = *high;
1.269 +
1.270 + dest[1] = x;
1.271 + x = src[2];
1.272 + if (x < *low) x = *low;
1.273 + if (x > *high) x = *high;
1.274 +
1.275 + dest[2] = x;
1.276 + x = src[3];
1.277 + if (x < *low) x = *low;
1.278 + if (x > *high) x = *high;
1.279 +
1.280 + dest[3] = x;
1.281 + dest+=4;
1.282 + src+=4;
1.283 + n--;
1.284 + }
1.285 +}
1.286 +OIL_DEFINE_IMPL (clamp_s16_unroll4, clamp_s16);
1.287 +
1.288 +static void
1.289 +clamp_u16_unroll4 (oil_type_u16 *dest, oil_type_u16 *src,
1.290 + int n , oil_type_u16 *low, oil_type_u16 *high)
1.291 +{
1.292 + oil_type_u16 x;
1.293 + while (n&3) {
1.294 + x = *src;
1.295 + if (x < *low) x = *low;
1.296 + if (x > *high) x = *high;
1.297 +
1.298 + *dest = x;
1.299 + dest++;
1.300 + src++;
1.301 + n--;
1.302 + }
1.303 + n >>= 2;
1.304 + while (n) {
1.305 + x = src[0];
1.306 + if (x < *low) x = *low;
1.307 + if (x > *high) x = *high;
1.308 +
1.309 + dest[0] = x;
1.310 + x = src[1];
1.311 + if (x < *low) x = *low;
1.312 + if (x > *high) x = *high;
1.313 +
1.314 + dest[1] = x;
1.315 + x = src[2];
1.316 + if (x < *low) x = *low;
1.317 + if (x > *high) x = *high;
1.318 +
1.319 + dest[2] = x;
1.320 + x = src[3];
1.321 + if (x < *low) x = *low;
1.322 + if (x > *high) x = *high;
1.323 +
1.324 + dest[3] = x;
1.325 + dest+=4;
1.326 + src+=4;
1.327 + n--;
1.328 + }
1.329 +}
1.330 +OIL_DEFINE_IMPL (clamp_u16_unroll4, clamp_u16);
1.331 +
1.332 +static void
1.333 +clamp_s32_unroll4 (oil_type_s32 *dest, oil_type_s32 *src,
1.334 + int n , oil_type_s32 *low, oil_type_s32 *high)
1.335 +{
1.336 + oil_type_s32 x;
1.337 + while (n&3) {
1.338 + x = *src;
1.339 + if (x < *low) x = *low;
1.340 + if (x > *high) x = *high;
1.341 +
1.342 + *dest = x;
1.343 + dest++;
1.344 + src++;
1.345 + n--;
1.346 + }
1.347 + n >>= 2;
1.348 + while (n) {
1.349 + x = src[0];
1.350 + if (x < *low) x = *low;
1.351 + if (x > *high) x = *high;
1.352 +
1.353 + dest[0] = x;
1.354 + x = src[1];
1.355 + if (x < *low) x = *low;
1.356 + if (x > *high) x = *high;
1.357 +
1.358 + dest[1] = x;
1.359 + x = src[2];
1.360 + if (x < *low) x = *low;
1.361 + if (x > *high) x = *high;
1.362 +
1.363 + dest[2] = x;
1.364 + x = src[3];
1.365 + if (x < *low) x = *low;
1.366 + if (x > *high) x = *high;
1.367 +
1.368 + dest[3] = x;
1.369 + dest+=4;
1.370 + src+=4;
1.371 + n--;
1.372 + }
1.373 +}
1.374 +OIL_DEFINE_IMPL (clamp_s32_unroll4, clamp_s32);
1.375 +
1.376 +static void
1.377 +clamp_u32_unroll4 (oil_type_u32 *dest, oil_type_u32 *src,
1.378 + int n , oil_type_u32 *low, oil_type_u32 *high)
1.379 +{
1.380 + oil_type_u32 x;
1.381 + while (n&3) {
1.382 + x = *src;
1.383 + if (x < *low) x = *low;
1.384 + if (x > *high) x = *high;
1.385 +
1.386 + *dest = x;
1.387 + dest++;
1.388 + src++;
1.389 + n--;
1.390 + }
1.391 + n >>= 2;
1.392 + while (n) {
1.393 + x = src[0];
1.394 + if (x < *low) x = *low;
1.395 + if (x > *high) x = *high;
1.396 +
1.397 + dest[0] = x;
1.398 + x = src[1];
1.399 + if (x < *low) x = *low;
1.400 + if (x > *high) x = *high;
1.401 +
1.402 + dest[1] = x;
1.403 + x = src[2];
1.404 + if (x < *low) x = *low;
1.405 + if (x > *high) x = *high;
1.406 +
1.407 + dest[2] = x;
1.408 + x = src[3];
1.409 + if (x < *low) x = *low;
1.410 + if (x > *high) x = *high;
1.411 +
1.412 + dest[3] = x;
1.413 + dest+=4;
1.414 + src+=4;
1.415 + n--;
1.416 + }
1.417 +}
1.418 +OIL_DEFINE_IMPL (clamp_u32_unroll4, clamp_u32);
1.419 +
1.420 +static void
1.421 +clamp_s8_trick (oil_type_s8 *dest, oil_type_s8 *src,
1.422 + int n , oil_type_s8 *low, oil_type_s8 *high)
1.423 +{
1.424 + int x;
1.425 + while (n&3) {
1.426 + x = *src;
1.427 + x = x - (((x-*low)>>31)&(x-*low));
1.428 + x = x + (((*high-x)>>31)&(*high-x));
1.429 +
1.430 + *dest = x;
1.431 + dest++;
1.432 + src++;
1.433 + n--;
1.434 + }
1.435 + n >>= 2;
1.436 + while (n) {
1.437 + x = src[0];
1.438 + x = x - (((x-*low)>>31)&(x-*low));
1.439 + x = x + (((*high-x)>>31)&(*high-x));
1.440 +
1.441 + dest[0] = x;
1.442 + x = src[1];
1.443 + x = x - (((x-*low)>>31)&(x-*low));
1.444 + x = x + (((*high-x)>>31)&(*high-x));
1.445 +
1.446 + dest[1] = x;
1.447 + x = src[2];
1.448 + x = x - (((x-*low)>>31)&(x-*low));
1.449 + x = x + (((*high-x)>>31)&(*high-x));
1.450 +
1.451 + dest[2] = x;
1.452 + x = src[3];
1.453 + x = x - (((x-*low)>>31)&(x-*low));
1.454 + x = x + (((*high-x)>>31)&(*high-x));
1.455 +
1.456 + dest[3] = x;
1.457 + dest+=4;
1.458 + src+=4;
1.459 + n--;
1.460 + }
1.461 +}
1.462 +OIL_DEFINE_IMPL (clamp_s8_trick, clamp_s8);
1.463 +
1.464 +static void
1.465 +clamp_u8_trick (oil_type_u8 *dest, oil_type_u8 *src,
1.466 + int n , oil_type_u8 *low, oil_type_u8 *high)
1.467 +{
1.468 + int x;
1.469 + while (n&3) {
1.470 + x = *src;
1.471 + x = x - (((x-*low)>>31)&(x-*low));
1.472 + x = x + (((*high-x)>>31)&(*high-x));
1.473 +
1.474 + *dest = x;
1.475 + dest++;
1.476 + src++;
1.477 + n--;
1.478 + }
1.479 + n >>= 2;
1.480 + while (n) {
1.481 + x = src[0];
1.482 + x = x - (((x-*low)>>31)&(x-*low));
1.483 + x = x + (((*high-x)>>31)&(*high-x));
1.484 +
1.485 + dest[0] = x;
1.486 + x = src[1];
1.487 + x = x - (((x-*low)>>31)&(x-*low));
1.488 + x = x + (((*high-x)>>31)&(*high-x));
1.489 +
1.490 + dest[1] = x;
1.491 + x = src[2];
1.492 + x = x - (((x-*low)>>31)&(x-*low));
1.493 + x = x + (((*high-x)>>31)&(*high-x));
1.494 +
1.495 + dest[2] = x;
1.496 + x = src[3];
1.497 + x = x - (((x-*low)>>31)&(x-*low));
1.498 + x = x + (((*high-x)>>31)&(*high-x));
1.499 +
1.500 + dest[3] = x;
1.501 + dest+=4;
1.502 + src+=4;
1.503 + n--;
1.504 + }
1.505 +}
1.506 +OIL_DEFINE_IMPL (clamp_u8_trick, clamp_u8);
1.507 +
1.508 +static void
1.509 +clamp_s16_trick (oil_type_s16 *dest, oil_type_s16 *src,
1.510 + int n , oil_type_s16 *low, oil_type_s16 *high)
1.511 +{
1.512 + int x;
1.513 + while (n&3) {
1.514 + x = *src;
1.515 + x = x - (((x-*low)>>31)&(x-*low));
1.516 + x = x + (((*high-x)>>31)&(*high-x));
1.517 +
1.518 + *dest = x;
1.519 + dest++;
1.520 + src++;
1.521 + n--;
1.522 + }
1.523 + n >>= 2;
1.524 + while (n) {
1.525 + x = src[0];
1.526 + x = x - (((x-*low)>>31)&(x-*low));
1.527 + x = x + (((*high-x)>>31)&(*high-x));
1.528 +
1.529 + dest[0] = x;
1.530 + x = src[1];
1.531 + x = x - (((x-*low)>>31)&(x-*low));
1.532 + x = x + (((*high-x)>>31)&(*high-x));
1.533 +
1.534 + dest[1] = x;
1.535 + x = src[2];
1.536 + x = x - (((x-*low)>>31)&(x-*low));
1.537 + x = x + (((*high-x)>>31)&(*high-x));
1.538 +
1.539 + dest[2] = x;
1.540 + x = src[3];
1.541 + x = x - (((x-*low)>>31)&(x-*low));
1.542 + x = x + (((*high-x)>>31)&(*high-x));
1.543 +
1.544 + dest[3] = x;
1.545 + dest+=4;
1.546 + src+=4;
1.547 + n--;
1.548 + }
1.549 +}
1.550 +OIL_DEFINE_IMPL (clamp_s16_trick, clamp_s16);
1.551 +
1.552 +static void
1.553 +clamp_u16_trick (oil_type_u16 *dest, oil_type_u16 *src,
1.554 + int n , oil_type_u16 *low, oil_type_u16 *high)
1.555 +{
1.556 + int x;
1.557 + while (n&3) {
1.558 + x = *src;
1.559 + x = x - (((x-*low)>>31)&(x-*low));
1.560 + x = x + (((*high-x)>>31)&(*high-x));
1.561 +
1.562 + *dest = x;
1.563 + dest++;
1.564 + src++;
1.565 + n--;
1.566 + }
1.567 + n >>= 2;
1.568 + while (n) {
1.569 + x = src[0];
1.570 + x = x - (((x-*low)>>31)&(x-*low));
1.571 + x = x + (((*high-x)>>31)&(*high-x));
1.572 +
1.573 + dest[0] = x;
1.574 + x = src[1];
1.575 + x = x - (((x-*low)>>31)&(x-*low));
1.576 + x = x + (((*high-x)>>31)&(*high-x));
1.577 +
1.578 + dest[1] = x;
1.579 + x = src[2];
1.580 + x = x - (((x-*low)>>31)&(x-*low));
1.581 + x = x + (((*high-x)>>31)&(*high-x));
1.582 +
1.583 + dest[2] = x;
1.584 + x = src[3];
1.585 + x = x - (((x-*low)>>31)&(x-*low));
1.586 + x = x + (((*high-x)>>31)&(*high-x));
1.587 +
1.588 + dest[3] = x;
1.589 + dest+=4;
1.590 + src+=4;
1.591 + n--;
1.592 + }
1.593 +}
1.594 +OIL_DEFINE_IMPL (clamp_u16_trick, clamp_u16);
1.595 +
1.596 +static void
1.597 +clamphigh_s8_pointer (oil_type_s8 *dest, oil_type_s8 *src1,
1.598 + int n
1.599 + , oil_type_s8 *high
1.600 + )
1.601 +{
1.602 + while (n) {
1.603 + oil_type_s8 x = *src1;
1.604 + if (x > *high) x = *high;
1.605 + *dest = x;
1.606 + dest++;
1.607 + src1++;
1.608 + n--;
1.609 + }
1.610 +}
1.611 +OIL_DEFINE_IMPL (clamphigh_s8_pointer, clamphigh_s8);
1.612 +
1.613 +static void
1.614 +clamphigh_u8_pointer (oil_type_u8 *dest, oil_type_u8 *src1,
1.615 + int n
1.616 + , oil_type_u8 *high
1.617 + )
1.618 +{
1.619 + while (n) {
1.620 + oil_type_u8 x = *src1;
1.621 + if (x > *high) x = *high;
1.622 + *dest = x;
1.623 + dest++;
1.624 + src1++;
1.625 + n--;
1.626 + }
1.627 +}
1.628 +OIL_DEFINE_IMPL (clamphigh_u8_pointer, clamphigh_u8);
1.629 +
1.630 +static void
1.631 +clamphigh_s16_pointer (oil_type_s16 *dest, oil_type_s16 *src1,
1.632 + int n
1.633 + , oil_type_s16 *high
1.634 + )
1.635 +{
1.636 + while (n) {
1.637 + oil_type_s16 x = *src1;
1.638 + if (x > *high) x = *high;
1.639 + *dest = x;
1.640 + dest++;
1.641 + src1++;
1.642 + n--;
1.643 + }
1.644 +}
1.645 +OIL_DEFINE_IMPL (clamphigh_s16_pointer, clamphigh_s16);
1.646 +
1.647 +static void
1.648 +clamphigh_u16_pointer (oil_type_u16 *dest, oil_type_u16 *src1,
1.649 + int n
1.650 + , oil_type_u16 *high
1.651 + )
1.652 +{
1.653 + while (n) {
1.654 + oil_type_u16 x = *src1;
1.655 + if (x > *high) x = *high;
1.656 + *dest = x;
1.657 + dest++;
1.658 + src1++;
1.659 + n--;
1.660 + }
1.661 +}
1.662 +OIL_DEFINE_IMPL (clamphigh_u16_pointer, clamphigh_u16);
1.663 +
1.664 +static void
1.665 +clamphigh_s32_pointer (oil_type_s32 *dest, oil_type_s32 *src1,
1.666 + int n
1.667 + , oil_type_s32 *high
1.668 + )
1.669 +{
1.670 + while (n) {
1.671 + oil_type_s32 x = *src1;
1.672 + if (x > *high) x = *high;
1.673 + *dest = x;
1.674 + dest++;
1.675 + src1++;
1.676 + n--;
1.677 + }
1.678 +}
1.679 +OIL_DEFINE_IMPL (clamphigh_s32_pointer, clamphigh_s32);
1.680 +
1.681 +static void
1.682 +clamphigh_u32_pointer (oil_type_u32 *dest, oil_type_u32 *src1,
1.683 + int n
1.684 + , oil_type_u32 *high
1.685 + )
1.686 +{
1.687 + while (n) {
1.688 + oil_type_u32 x = *src1;
1.689 + if (x > *high) x = *high;
1.690 + *dest = x;
1.691 + dest++;
1.692 + src1++;
1.693 + n--;
1.694 + }
1.695 +}
1.696 +OIL_DEFINE_IMPL (clamphigh_u32_pointer, clamphigh_u32);
1.697 +
1.698 +static void
1.699 +clamphigh_s8_unroll4 (oil_type_s8 *dest, oil_type_s8 *src,
1.700 + int n , oil_type_s8 *high)
1.701 +{
1.702 + oil_type_s8 x;
1.703 + while (n&3) {
1.704 + x = *src;
1.705 + if (x > *high) x = *high;
1.706 +
1.707 + *dest = x;
1.708 + dest++;
1.709 + src++;
1.710 + n--;
1.711 + }
1.712 + n >>= 2;
1.713 + while (n) {
1.714 + x = src[0];
1.715 + if (x > *high) x = *high;
1.716 +
1.717 + dest[0] = x;
1.718 + x = src[1];
1.719 + if (x > *high) x = *high;
1.720 +
1.721 + dest[1] = x;
1.722 + x = src[2];
1.723 + if (x > *high) x = *high;
1.724 +
1.725 + dest[2] = x;
1.726 + x = src[3];
1.727 + if (x > *high) x = *high;
1.728 +
1.729 + dest[3] = x;
1.730 + dest+=4;
1.731 + src+=4;
1.732 + n--;
1.733 + }
1.734 +}
1.735 +OIL_DEFINE_IMPL (clamphigh_s8_unroll4, clamphigh_s8);
1.736 +
1.737 +static void
1.738 +clamphigh_u8_unroll4 (oil_type_u8 *dest, oil_type_u8 *src,
1.739 + int n , oil_type_u8 *high)
1.740 +{
1.741 + oil_type_u8 x;
1.742 + while (n&3) {
1.743 + x = *src;
1.744 + if (x > *high) x = *high;
1.745 +
1.746 + *dest = x;
1.747 + dest++;
1.748 + src++;
1.749 + n--;
1.750 + }
1.751 + n >>= 2;
1.752 + while (n) {
1.753 + x = src[0];
1.754 + if (x > *high) x = *high;
1.755 +
1.756 + dest[0] = x;
1.757 + x = src[1];
1.758 + if (x > *high) x = *high;
1.759 +
1.760 + dest[1] = x;
1.761 + x = src[2];
1.762 + if (x > *high) x = *high;
1.763 +
1.764 + dest[2] = x;
1.765 + x = src[3];
1.766 + if (x > *high) x = *high;
1.767 +
1.768 + dest[3] = x;
1.769 + dest+=4;
1.770 + src+=4;
1.771 + n--;
1.772 + }
1.773 +}
1.774 +OIL_DEFINE_IMPL (clamphigh_u8_unroll4, clamphigh_u8);
1.775 +
1.776 +static void
1.777 +clamphigh_s16_unroll4 (oil_type_s16 *dest, oil_type_s16 *src,
1.778 + int n , oil_type_s16 *high)
1.779 +{
1.780 + oil_type_s16 x;
1.781 + while (n&3) {
1.782 + x = *src;
1.783 + if (x > *high) x = *high;
1.784 +
1.785 + *dest = x;
1.786 + dest++;
1.787 + src++;
1.788 + n--;
1.789 + }
1.790 + n >>= 2;
1.791 + while (n) {
1.792 + x = src[0];
1.793 + if (x > *high) x = *high;
1.794 +
1.795 + dest[0] = x;
1.796 + x = src[1];
1.797 + if (x > *high) x = *high;
1.798 +
1.799 + dest[1] = x;
1.800 + x = src[2];
1.801 + if (x > *high) x = *high;
1.802 +
1.803 + dest[2] = x;
1.804 + x = src[3];
1.805 + if (x > *high) x = *high;
1.806 +
1.807 + dest[3] = x;
1.808 + dest+=4;
1.809 + src+=4;
1.810 + n--;
1.811 + }
1.812 +}
1.813 +OIL_DEFINE_IMPL (clamphigh_s16_unroll4, clamphigh_s16);
1.814 +
1.815 +static void
1.816 +clamphigh_u16_unroll4 (oil_type_u16 *dest, oil_type_u16 *src,
1.817 + int n , oil_type_u16 *high)
1.818 +{
1.819 + oil_type_u16 x;
1.820 + while (n&3) {
1.821 + x = *src;
1.822 + if (x > *high) x = *high;
1.823 +
1.824 + *dest = x;
1.825 + dest++;
1.826 + src++;
1.827 + n--;
1.828 + }
1.829 + n >>= 2;
1.830 + while (n) {
1.831 + x = src[0];
1.832 + if (x > *high) x = *high;
1.833 +
1.834 + dest[0] = x;
1.835 + x = src[1];
1.836 + if (x > *high) x = *high;
1.837 +
1.838 + dest[1] = x;
1.839 + x = src[2];
1.840 + if (x > *high) x = *high;
1.841 +
1.842 + dest[2] = x;
1.843 + x = src[3];
1.844 + if (x > *high) x = *high;
1.845 +
1.846 + dest[3] = x;
1.847 + dest+=4;
1.848 + src+=4;
1.849 + n--;
1.850 + }
1.851 +}
1.852 +OIL_DEFINE_IMPL (clamphigh_u16_unroll4, clamphigh_u16);
1.853 +
1.854 +static void
1.855 +clamphigh_s32_unroll4 (oil_type_s32 *dest, oil_type_s32 *src,
1.856 + int n , oil_type_s32 *high)
1.857 +{
1.858 + oil_type_s32 x;
1.859 + while (n&3) {
1.860 + x = *src;
1.861 + if (x > *high) x = *high;
1.862 +
1.863 + *dest = x;
1.864 + dest++;
1.865 + src++;
1.866 + n--;
1.867 + }
1.868 + n >>= 2;
1.869 + while (n) {
1.870 + x = src[0];
1.871 + if (x > *high) x = *high;
1.872 +
1.873 + dest[0] = x;
1.874 + x = src[1];
1.875 + if (x > *high) x = *high;
1.876 +
1.877 + dest[1] = x;
1.878 + x = src[2];
1.879 + if (x > *high) x = *high;
1.880 +
1.881 + dest[2] = x;
1.882 + x = src[3];
1.883 + if (x > *high) x = *high;
1.884 +
1.885 + dest[3] = x;
1.886 + dest+=4;
1.887 + src+=4;
1.888 + n--;
1.889 + }
1.890 +}
1.891 +OIL_DEFINE_IMPL (clamphigh_s32_unroll4, clamphigh_s32);
1.892 +
1.893 +static void
1.894 +clamphigh_u32_unroll4 (oil_type_u32 *dest, oil_type_u32 *src,
1.895 + int n , oil_type_u32 *high)
1.896 +{
1.897 + oil_type_u32 x;
1.898 + while (n&3) {
1.899 + x = *src;
1.900 + if (x > *high) x = *high;
1.901 +
1.902 + *dest = x;
1.903 + dest++;
1.904 + src++;
1.905 + n--;
1.906 + }
1.907 + n >>= 2;
1.908 + while (n) {
1.909 + x = src[0];
1.910 + if (x > *high) x = *high;
1.911 +
1.912 + dest[0] = x;
1.913 + x = src[1];
1.914 + if (x > *high) x = *high;
1.915 +
1.916 + dest[1] = x;
1.917 + x = src[2];
1.918 + if (x > *high) x = *high;
1.919 +
1.920 + dest[2] = x;
1.921 + x = src[3];
1.922 + if (x > *high) x = *high;
1.923 +
1.924 + dest[3] = x;
1.925 + dest+=4;
1.926 + src+=4;
1.927 + n--;
1.928 + }
1.929 +}
1.930 +OIL_DEFINE_IMPL (clamphigh_u32_unroll4, clamphigh_u32);
1.931 +
1.932 +static void
1.933 +clamphigh_s8_trick (oil_type_s8 *dest, oil_type_s8 *src,
1.934 + int n , oil_type_s8 *high)
1.935 +{
1.936 + int x;
1.937 + while (n&3) {
1.938 + x = *src;
1.939 + x = x + (((*high-x)>>31)&(*high-x));
1.940 +
1.941 + *dest = x;
1.942 + dest++;
1.943 + src++;
1.944 + n--;
1.945 + }
1.946 + n >>= 2;
1.947 + while (n) {
1.948 + x = src[0];
1.949 + x = x + (((*high-x)>>31)&(*high-x));
1.950 +
1.951 + dest[0] = x;
1.952 + x = src[1];
1.953 + x = x + (((*high-x)>>31)&(*high-x));
1.954 +
1.955 + dest[1] = x;
1.956 + x = src[2];
1.957 + x = x + (((*high-x)>>31)&(*high-x));
1.958 +
1.959 + dest[2] = x;
1.960 + x = src[3];
1.961 + x = x + (((*high-x)>>31)&(*high-x));
1.962 +
1.963 + dest[3] = x;
1.964 + dest+=4;
1.965 + src+=4;
1.966 + n--;
1.967 + }
1.968 +}
1.969 +OIL_DEFINE_IMPL (clamphigh_s8_trick, clamphigh_s8);
1.970 +
1.971 +static void
1.972 +clamphigh_u8_trick (oil_type_u8 *dest, oil_type_u8 *src,
1.973 + int n , oil_type_u8 *high)
1.974 +{
1.975 + int x;
1.976 + while (n&3) {
1.977 + x = *src;
1.978 + x = x + (((*high-x)>>31)&(*high-x));
1.979 +
1.980 + *dest = x;
1.981 + dest++;
1.982 + src++;
1.983 + n--;
1.984 + }
1.985 + n >>= 2;
1.986 + while (n) {
1.987 + x = src[0];
1.988 + x = x + (((*high-x)>>31)&(*high-x));
1.989 +
1.990 + dest[0] = x;
1.991 + x = src[1];
1.992 + x = x + (((*high-x)>>31)&(*high-x));
1.993 +
1.994 + dest[1] = x;
1.995 + x = src[2];
1.996 + x = x + (((*high-x)>>31)&(*high-x));
1.997 +
1.998 + dest[2] = x;
1.999 + x = src[3];
1.1000 + x = x + (((*high-x)>>31)&(*high-x));
1.1001 +
1.1002 + dest[3] = x;
1.1003 + dest+=4;
1.1004 + src+=4;
1.1005 + n--;
1.1006 + }
1.1007 +}
1.1008 +OIL_DEFINE_IMPL (clamphigh_u8_trick, clamphigh_u8);
1.1009 +
1.1010 +static void
1.1011 +clamphigh_s16_trick (oil_type_s16 *dest, oil_type_s16 *src,
1.1012 + int n , oil_type_s16 *high)
1.1013 +{
1.1014 + int x;
1.1015 + while (n&3) {
1.1016 + x = *src;
1.1017 + x = x + (((*high-x)>>31)&(*high-x));
1.1018 +
1.1019 + *dest = x;
1.1020 + dest++;
1.1021 + src++;
1.1022 + n--;
1.1023 + }
1.1024 + n >>= 2;
1.1025 + while (n) {
1.1026 + x = src[0];
1.1027 + x = x + (((*high-x)>>31)&(*high-x));
1.1028 +
1.1029 + dest[0] = x;
1.1030 + x = src[1];
1.1031 + x = x + (((*high-x)>>31)&(*high-x));
1.1032 +
1.1033 + dest[1] = x;
1.1034 + x = src[2];
1.1035 + x = x + (((*high-x)>>31)&(*high-x));
1.1036 +
1.1037 + dest[2] = x;
1.1038 + x = src[3];
1.1039 + x = x + (((*high-x)>>31)&(*high-x));
1.1040 +
1.1041 + dest[3] = x;
1.1042 + dest+=4;
1.1043 + src+=4;
1.1044 + n--;
1.1045 + }
1.1046 +}
1.1047 +OIL_DEFINE_IMPL (clamphigh_s16_trick, clamphigh_s16);
1.1048 +
1.1049 +static void
1.1050 +clamphigh_u16_trick (oil_type_u16 *dest, oil_type_u16 *src,
1.1051 + int n , oil_type_u16 *high)
1.1052 +{
1.1053 + int x;
1.1054 + while (n&3) {
1.1055 + x = *src;
1.1056 + x = x + (((*high-x)>>31)&(*high-x));
1.1057 +
1.1058 + *dest = x;
1.1059 + dest++;
1.1060 + src++;
1.1061 + n--;
1.1062 + }
1.1063 + n >>= 2;
1.1064 + while (n) {
1.1065 + x = src[0];
1.1066 + x = x + (((*high-x)>>31)&(*high-x));
1.1067 +
1.1068 + dest[0] = x;
1.1069 + x = src[1];
1.1070 + x = x + (((*high-x)>>31)&(*high-x));
1.1071 +
1.1072 + dest[1] = x;
1.1073 + x = src[2];
1.1074 + x = x + (((*high-x)>>31)&(*high-x));
1.1075 +
1.1076 + dest[2] = x;
1.1077 + x = src[3];
1.1078 + x = x + (((*high-x)>>31)&(*high-x));
1.1079 +
1.1080 + dest[3] = x;
1.1081 + dest+=4;
1.1082 + src+=4;
1.1083 + n--;
1.1084 + }
1.1085 +}
1.1086 +OIL_DEFINE_IMPL (clamphigh_u16_trick, clamphigh_u16);
1.1087 +
1.1088 +static void
1.1089 +clamplow_s8_pointer (oil_type_s8 *dest, oil_type_s8 *src1,
1.1090 + int n
1.1091 + , oil_type_s8 *low
1.1092 + )
1.1093 +{
1.1094 + while (n) {
1.1095 + oil_type_s8 x = *src1;
1.1096 + if (x < *low) x = *low;
1.1097 + *dest = x;
1.1098 + dest++;
1.1099 + src1++;
1.1100 + n--;
1.1101 + }
1.1102 +}
1.1103 +OIL_DEFINE_IMPL (clamplow_s8_pointer, clamplow_s8);
1.1104 +
1.1105 +static void
1.1106 +clamplow_u8_pointer (oil_type_u8 *dest, oil_type_u8 *src1,
1.1107 + int n
1.1108 + , oil_type_u8 *low
1.1109 + )
1.1110 +{
1.1111 + while (n) {
1.1112 + oil_type_u8 x = *src1;
1.1113 + if (x < *low) x = *low;
1.1114 + *dest = x;
1.1115 + dest++;
1.1116 + src1++;
1.1117 + n--;
1.1118 + }
1.1119 +}
1.1120 +OIL_DEFINE_IMPL (clamplow_u8_pointer, clamplow_u8);
1.1121 +
1.1122 +static void
1.1123 +clamplow_s16_pointer (oil_type_s16 *dest, oil_type_s16 *src1,
1.1124 + int n
1.1125 + , oil_type_s16 *low
1.1126 + )
1.1127 +{
1.1128 + while (n) {
1.1129 + oil_type_s16 x = *src1;
1.1130 + if (x < *low) x = *low;
1.1131 + *dest = x;
1.1132 + dest++;
1.1133 + src1++;
1.1134 + n--;
1.1135 + }
1.1136 +}
1.1137 +OIL_DEFINE_IMPL (clamplow_s16_pointer, clamplow_s16);
1.1138 +
1.1139 +static void
1.1140 +clamplow_u16_pointer (oil_type_u16 *dest, oil_type_u16 *src1,
1.1141 + int n
1.1142 + , oil_type_u16 *low
1.1143 + )
1.1144 +{
1.1145 + while (n) {
1.1146 + oil_type_u16 x = *src1;
1.1147 + if (x < *low) x = *low;
1.1148 + *dest = x;
1.1149 + dest++;
1.1150 + src1++;
1.1151 + n--;
1.1152 + }
1.1153 +}
1.1154 +OIL_DEFINE_IMPL (clamplow_u16_pointer, clamplow_u16);
1.1155 +
1.1156 +static void
1.1157 +clamplow_s32_pointer (oil_type_s32 *dest, oil_type_s32 *src1,
1.1158 + int n
1.1159 + , oil_type_s32 *low
1.1160 + )
1.1161 +{
1.1162 + while (n) {
1.1163 + oil_type_s32 x = *src1;
1.1164 + if (x < *low) x = *low;
1.1165 + *dest = x;
1.1166 + dest++;
1.1167 + src1++;
1.1168 + n--;
1.1169 + }
1.1170 +}
1.1171 +OIL_DEFINE_IMPL (clamplow_s32_pointer, clamplow_s32);
1.1172 +
1.1173 +static void
1.1174 +clamplow_u32_pointer (oil_type_u32 *dest, oil_type_u32 *src1,
1.1175 + int n
1.1176 + , oil_type_u32 *low
1.1177 + )
1.1178 +{
1.1179 + while (n) {
1.1180 + oil_type_u32 x = *src1;
1.1181 + if (x < *low) x = *low;
1.1182 + *dest = x;
1.1183 + dest++;
1.1184 + src1++;
1.1185 + n--;
1.1186 + }
1.1187 +}
1.1188 +OIL_DEFINE_IMPL (clamplow_u32_pointer, clamplow_u32);
1.1189 +
1.1190 +static void
1.1191 +clamplow_s8_unroll4 (oil_type_s8 *dest, oil_type_s8 *src,
1.1192 + int n , oil_type_s8 *low)
1.1193 +{
1.1194 + oil_type_s8 x;
1.1195 + while (n&3) {
1.1196 + x = *src;
1.1197 + if (x < *low) x = *low;
1.1198 +
1.1199 + *dest = x;
1.1200 + dest++;
1.1201 + src++;
1.1202 + n--;
1.1203 + }
1.1204 + n >>= 2;
1.1205 + while (n) {
1.1206 + x = src[0];
1.1207 + if (x < *low) x = *low;
1.1208 +
1.1209 + dest[0] = x;
1.1210 + x = src[1];
1.1211 + if (x < *low) x = *low;
1.1212 +
1.1213 + dest[1] = x;
1.1214 + x = src[2];
1.1215 + if (x < *low) x = *low;
1.1216 +
1.1217 + dest[2] = x;
1.1218 + x = src[3];
1.1219 + if (x < *low) x = *low;
1.1220 +
1.1221 + dest[3] = x;
1.1222 + dest+=4;
1.1223 + src+=4;
1.1224 + n--;
1.1225 + }
1.1226 +}
1.1227 +OIL_DEFINE_IMPL (clamplow_s8_unroll4, clamplow_s8);
1.1228 +
1.1229 +static void
1.1230 +clamplow_u8_unroll4 (oil_type_u8 *dest, oil_type_u8 *src,
1.1231 + int n , oil_type_u8 *low)
1.1232 +{
1.1233 + oil_type_u8 x;
1.1234 + while (n&3) {
1.1235 + x = *src;
1.1236 + if (x < *low) x = *low;
1.1237 +
1.1238 + *dest = x;
1.1239 + dest++;
1.1240 + src++;
1.1241 + n--;
1.1242 + }
1.1243 + n >>= 2;
1.1244 + while (n) {
1.1245 + x = src[0];
1.1246 + if (x < *low) x = *low;
1.1247 +
1.1248 + dest[0] = x;
1.1249 + x = src[1];
1.1250 + if (x < *low) x = *low;
1.1251 +
1.1252 + dest[1] = x;
1.1253 + x = src[2];
1.1254 + if (x < *low) x = *low;
1.1255 +
1.1256 + dest[2] = x;
1.1257 + x = src[3];
1.1258 + if (x < *low) x = *low;
1.1259 +
1.1260 + dest[3] = x;
1.1261 + dest+=4;
1.1262 + src+=4;
1.1263 + n--;
1.1264 + }
1.1265 +}
1.1266 +OIL_DEFINE_IMPL (clamplow_u8_unroll4, clamplow_u8);
1.1267 +
1.1268 +static void
1.1269 +clamplow_s16_unroll4 (oil_type_s16 *dest, oil_type_s16 *src,
1.1270 + int n , oil_type_s16 *low)
1.1271 +{
1.1272 + oil_type_s16 x;
1.1273 + while (n&3) {
1.1274 + x = *src;
1.1275 + if (x < *low) x = *low;
1.1276 +
1.1277 + *dest = x;
1.1278 + dest++;
1.1279 + src++;
1.1280 + n--;
1.1281 + }
1.1282 + n >>= 2;
1.1283 + while (n) {
1.1284 + x = src[0];
1.1285 + if (x < *low) x = *low;
1.1286 +
1.1287 + dest[0] = x;
1.1288 + x = src[1];
1.1289 + if (x < *low) x = *low;
1.1290 +
1.1291 + dest[1] = x;
1.1292 + x = src[2];
1.1293 + if (x < *low) x = *low;
1.1294 +
1.1295 + dest[2] = x;
1.1296 + x = src[3];
1.1297 + if (x < *low) x = *low;
1.1298 +
1.1299 + dest[3] = x;
1.1300 + dest+=4;
1.1301 + src+=4;
1.1302 + n--;
1.1303 + }
1.1304 +}
1.1305 +OIL_DEFINE_IMPL (clamplow_s16_unroll4, clamplow_s16);
1.1306 +
1.1307 +static void
1.1308 +clamplow_u16_unroll4 (oil_type_u16 *dest, oil_type_u16 *src,
1.1309 + int n , oil_type_u16 *low)
1.1310 +{
1.1311 + oil_type_u16 x;
1.1312 + while (n&3) {
1.1313 + x = *src;
1.1314 + if (x < *low) x = *low;
1.1315 +
1.1316 + *dest = x;
1.1317 + dest++;
1.1318 + src++;
1.1319 + n--;
1.1320 + }
1.1321 + n >>= 2;
1.1322 + while (n) {
1.1323 + x = src[0];
1.1324 + if (x < *low) x = *low;
1.1325 +
1.1326 + dest[0] = x;
1.1327 + x = src[1];
1.1328 + if (x < *low) x = *low;
1.1329 +
1.1330 + dest[1] = x;
1.1331 + x = src[2];
1.1332 + if (x < *low) x = *low;
1.1333 +
1.1334 + dest[2] = x;
1.1335 + x = src[3];
1.1336 + if (x < *low) x = *low;
1.1337 +
1.1338 + dest[3] = x;
1.1339 + dest+=4;
1.1340 + src+=4;
1.1341 + n--;
1.1342 + }
1.1343 +}
1.1344 +OIL_DEFINE_IMPL (clamplow_u16_unroll4, clamplow_u16);
1.1345 +
1.1346 +static void
1.1347 +clamplow_s32_unroll4 (oil_type_s32 *dest, oil_type_s32 *src,
1.1348 + int n , oil_type_s32 *low)
1.1349 +{
1.1350 + oil_type_s32 x;
1.1351 + while (n&3) {
1.1352 + x = *src;
1.1353 + if (x < *low) x = *low;
1.1354 +
1.1355 + *dest = x;
1.1356 + dest++;
1.1357 + src++;
1.1358 + n--;
1.1359 + }
1.1360 + n >>= 2;
1.1361 + while (n) {
1.1362 + x = src[0];
1.1363 + if (x < *low) x = *low;
1.1364 +
1.1365 + dest[0] = x;
1.1366 + x = src[1];
1.1367 + if (x < *low) x = *low;
1.1368 +
1.1369 + dest[1] = x;
1.1370 + x = src[2];
1.1371 + if (x < *low) x = *low;
1.1372 +
1.1373 + dest[2] = x;
1.1374 + x = src[3];
1.1375 + if (x < *low) x = *low;
1.1376 +
1.1377 + dest[3] = x;
1.1378 + dest+=4;
1.1379 + src+=4;
1.1380 + n--;
1.1381 + }
1.1382 +}
1.1383 +OIL_DEFINE_IMPL (clamplow_s32_unroll4, clamplow_s32);
1.1384 +
1.1385 +static void
1.1386 +clamplow_u32_unroll4 (oil_type_u32 *dest, oil_type_u32 *src,
1.1387 + int n , oil_type_u32 *low)
1.1388 +{
1.1389 + oil_type_u32 x;
1.1390 + while (n&3) {
1.1391 + x = *src;
1.1392 + if (x < *low) x = *low;
1.1393 +
1.1394 + *dest = x;
1.1395 + dest++;
1.1396 + src++;
1.1397 + n--;
1.1398 + }
1.1399 + n >>= 2;
1.1400 + while (n) {
1.1401 + x = src[0];
1.1402 + if (x < *low) x = *low;
1.1403 +
1.1404 + dest[0] = x;
1.1405 + x = src[1];
1.1406 + if (x < *low) x = *low;
1.1407 +
1.1408 + dest[1] = x;
1.1409 + x = src[2];
1.1410 + if (x < *low) x = *low;
1.1411 +
1.1412 + dest[2] = x;
1.1413 + x = src[3];
1.1414 + if (x < *low) x = *low;
1.1415 +
1.1416 + dest[3] = x;
1.1417 + dest+=4;
1.1418 + src+=4;
1.1419 + n--;
1.1420 + }
1.1421 +}
1.1422 +OIL_DEFINE_IMPL (clamplow_u32_unroll4, clamplow_u32);
1.1423 +
1.1424 +static void
1.1425 +clamplow_s8_trick (oil_type_s8 *dest, oil_type_s8 *src,
1.1426 + int n , oil_type_s8 *low)
1.1427 +{
1.1428 + int x;
1.1429 + while (n&3) {
1.1430 + x = *src;
1.1431 + x = x - (((x-*low)>>31)&(x-*low));
1.1432 +
1.1433 + *dest = x;
1.1434 + dest++;
1.1435 + src++;
1.1436 + n--;
1.1437 + }
1.1438 + n >>= 2;
1.1439 + while (n) {
1.1440 + x = src[0];
1.1441 + x = x - (((x-*low)>>31)&(x-*low));
1.1442 +
1.1443 + dest[0] = x;
1.1444 + x = src[1];
1.1445 + x = x - (((x-*low)>>31)&(x-*low));
1.1446 +
1.1447 + dest[1] = x;
1.1448 + x = src[2];
1.1449 + x = x - (((x-*low)>>31)&(x-*low));
1.1450 +
1.1451 + dest[2] = x;
1.1452 + x = src[3];
1.1453 + x = x - (((x-*low)>>31)&(x-*low));
1.1454 +
1.1455 + dest[3] = x;
1.1456 + dest+=4;
1.1457 + src+=4;
1.1458 + n--;
1.1459 + }
1.1460 +}
1.1461 +OIL_DEFINE_IMPL (clamplow_s8_trick, clamplow_s8);
1.1462 +
1.1463 +static void
1.1464 +clamplow_u8_trick (oil_type_u8 *dest, oil_type_u8 *src,
1.1465 + int n , oil_type_u8 *low)
1.1466 +{
1.1467 + int x;
1.1468 + while (n&3) {
1.1469 + x = *src;
1.1470 + x = x - (((x-*low)>>31)&(x-*low));
1.1471 +
1.1472 + *dest = x;
1.1473 + dest++;
1.1474 + src++;
1.1475 + n--;
1.1476 + }
1.1477 + n >>= 2;
1.1478 + while (n) {
1.1479 + x = src[0];
1.1480 + x = x - (((x-*low)>>31)&(x-*low));
1.1481 +
1.1482 + dest[0] = x;
1.1483 + x = src[1];
1.1484 + x = x - (((x-*low)>>31)&(x-*low));
1.1485 +
1.1486 + dest[1] = x;
1.1487 + x = src[2];
1.1488 + x = x - (((x-*low)>>31)&(x-*low));
1.1489 +
1.1490 + dest[2] = x;
1.1491 + x = src[3];
1.1492 + x = x - (((x-*low)>>31)&(x-*low));
1.1493 +
1.1494 + dest[3] = x;
1.1495 + dest+=4;
1.1496 + src+=4;
1.1497 + n--;
1.1498 + }
1.1499 +}
1.1500 +OIL_DEFINE_IMPL (clamplow_u8_trick, clamplow_u8);
1.1501 +
1.1502 +static void
1.1503 +clamplow_s16_trick (oil_type_s16 *dest, oil_type_s16 *src,
1.1504 + int n , oil_type_s16 *low)
1.1505 +{
1.1506 + int x;
1.1507 + while (n&3) {
1.1508 + x = *src;
1.1509 + x = x - (((x-*low)>>31)&(x-*low));
1.1510 +
1.1511 + *dest = x;
1.1512 + dest++;
1.1513 + src++;
1.1514 + n--;
1.1515 + }
1.1516 + n >>= 2;
1.1517 + while (n) {
1.1518 + x = src[0];
1.1519 + x = x - (((x-*low)>>31)&(x-*low));
1.1520 +
1.1521 + dest[0] = x;
1.1522 + x = src[1];
1.1523 + x = x - (((x-*low)>>31)&(x-*low));
1.1524 +
1.1525 + dest[1] = x;
1.1526 + x = src[2];
1.1527 + x = x - (((x-*low)>>31)&(x-*low));
1.1528 +
1.1529 + dest[2] = x;
1.1530 + x = src[3];
1.1531 + x = x - (((x-*low)>>31)&(x-*low));
1.1532 +
1.1533 + dest[3] = x;
1.1534 + dest+=4;
1.1535 + src+=4;
1.1536 + n--;
1.1537 + }
1.1538 +}
1.1539 +OIL_DEFINE_IMPL (clamplow_s16_trick, clamplow_s16);
1.1540 +
1.1541 +static void
1.1542 +clamplow_u16_trick (oil_type_u16 *dest, oil_type_u16 *src,
1.1543 + int n , oil_type_u16 *low)
1.1544 +{
1.1545 + int x;
1.1546 + while (n&3) {
1.1547 + x = *src;
1.1548 + x = x - (((x-*low)>>31)&(x-*low));
1.1549 +
1.1550 + *dest = x;
1.1551 + dest++;
1.1552 + src++;
1.1553 + n--;
1.1554 + }
1.1555 + n >>= 2;
1.1556 + while (n) {
1.1557 + x = src[0];
1.1558 + x = x - (((x-*low)>>31)&(x-*low));
1.1559 +
1.1560 + dest[0] = x;
1.1561 + x = src[1];
1.1562 + x = x - (((x-*low)>>31)&(x-*low));
1.1563 +
1.1564 + dest[1] = x;
1.1565 + x = src[2];
1.1566 + x = x - (((x-*low)>>31)&(x-*low));
1.1567 +
1.1568 + dest[2] = x;
1.1569 + x = src[3];
1.1570 + x = x - (((x-*low)>>31)&(x-*low));
1.1571 +
1.1572 + dest[3] = x;
1.1573 + dest+=4;
1.1574 + src+=4;
1.1575 + n--;
1.1576 + }
1.1577 +}
1.1578 +OIL_DEFINE_IMPL (clamplow_u16_trick, clamplow_u16);
1.1579 +
1.1580 +
1.1581 +
1.1582 +#ifdef __SYMBIAN32__
1.1583 +
1.1584 +OilFunctionImpl* __oil_function_impl_clamp_s8_pointer() {
1.1585 + return &_oil_function_impl_clamp_s8_pointer;
1.1586 +}
1.1587 +#endif
1.1588 +
1.1589 +#ifdef __SYMBIAN32__
1.1590 +
1.1591 +OilFunctionImpl* __oil_function_impl_clamp_u8_pointer() {
1.1592 + return &_oil_function_impl_clamp_u8_pointer;
1.1593 +}
1.1594 +#endif
1.1595 +
1.1596 +#ifdef __SYMBIAN32__
1.1597 +
1.1598 +OilFunctionImpl* __oil_function_impl_clamp_s16_pointer() {
1.1599 + return &_oil_function_impl_clamp_s16_pointer;
1.1600 +}
1.1601 +#endif
1.1602 +
1.1603 +#ifdef __SYMBIAN32__
1.1604 +
1.1605 +OilFunctionImpl* __oil_function_impl_clamp_u16_pointer() {
1.1606 + return &_oil_function_impl_clamp_u16_pointer;
1.1607 +}
1.1608 +#endif
1.1609 +
1.1610 +#ifdef __SYMBIAN32__
1.1611 +
1.1612 +OilFunctionImpl* __oil_function_impl_clamp_s32_pointer() {
1.1613 + return &_oil_function_impl_clamp_s32_pointer;
1.1614 +}
1.1615 +#endif
1.1616 +
1.1617 +#ifdef __SYMBIAN32__
1.1618 +
1.1619 +OilFunctionImpl* __oil_function_impl_clamp_u32_pointer() {
1.1620 + return &_oil_function_impl_clamp_u32_pointer;
1.1621 +}
1.1622 +#endif
1.1623 +
1.1624 +#ifdef __SYMBIAN32__
1.1625 +
1.1626 +OilFunctionImpl* __oil_function_impl_clamp_s8_unroll4() {
1.1627 + return &_oil_function_impl_clamp_s8_unroll4;
1.1628 +}
1.1629 +#endif
1.1630 +
1.1631 +#ifdef __SYMBIAN32__
1.1632 +
1.1633 +OilFunctionImpl* __oil_function_impl_clamp_u8_unroll4() {
1.1634 + return &_oil_function_impl_clamp_u8_unroll4;
1.1635 +}
1.1636 +#endif
1.1637 +
1.1638 +#ifdef __SYMBIAN32__
1.1639 +
1.1640 +OilFunctionImpl* __oil_function_impl_clamp_s16_unroll4() {
1.1641 + return &_oil_function_impl_clamp_s16_unroll4;
1.1642 +}
1.1643 +#endif
1.1644 +
1.1645 +#ifdef __SYMBIAN32__
1.1646 +
1.1647 +OilFunctionImpl* __oil_function_impl_clamp_u16_unroll4() {
1.1648 + return &_oil_function_impl_clamp_u16_unroll4;
1.1649 +}
1.1650 +#endif
1.1651 +
1.1652 +#ifdef __SYMBIAN32__
1.1653 +
1.1654 +OilFunctionImpl* __oil_function_impl_clamp_s32_unroll4() {
1.1655 + return &_oil_function_impl_clamp_s32_unroll4;
1.1656 +}
1.1657 +#endif
1.1658 +
1.1659 +#ifdef __SYMBIAN32__
1.1660 +
1.1661 +OilFunctionImpl* __oil_function_impl_clamp_u32_unroll4() {
1.1662 + return &_oil_function_impl_clamp_u32_unroll4;
1.1663 +}
1.1664 +#endif
1.1665 +
1.1666 +#ifdef __SYMBIAN32__
1.1667 +
1.1668 +OilFunctionImpl* __oil_function_impl_clamp_s8_trick() {
1.1669 + return &_oil_function_impl_clamp_s8_trick;
1.1670 +}
1.1671 +#endif
1.1672 +
1.1673 +#ifdef __SYMBIAN32__
1.1674 +
1.1675 +OilFunctionImpl* __oil_function_impl_clamp_u8_trick() {
1.1676 + return &_oil_function_impl_clamp_u8_trick;
1.1677 +}
1.1678 +#endif
1.1679 +
1.1680 +#ifdef __SYMBIAN32__
1.1681 +
1.1682 +OilFunctionImpl* __oil_function_impl_clamp_s16_trick() {
1.1683 + return &_oil_function_impl_clamp_s16_trick;
1.1684 +}
1.1685 +#endif
1.1686 +
1.1687 +#ifdef __SYMBIAN32__
1.1688 +
1.1689 +OilFunctionImpl* __oil_function_impl_clamp_u16_trick() {
1.1690 + return &_oil_function_impl_clamp_u16_trick;
1.1691 +}
1.1692 +#endif
1.1693 +
1.1694 +#ifdef __SYMBIAN32__
1.1695 +
1.1696 +OilFunctionImpl* __oil_function_impl_clamphigh_s8_pointer() {
1.1697 + return &_oil_function_impl_clamphigh_s8_pointer;
1.1698 +}
1.1699 +#endif
1.1700 +
1.1701 +#ifdef __SYMBIAN32__
1.1702 +
1.1703 +OilFunctionImpl* __oil_function_impl_clamphigh_u8_pointer() {
1.1704 + return &_oil_function_impl_clamphigh_u8_pointer;
1.1705 +}
1.1706 +#endif
1.1707 +
1.1708 +#ifdef __SYMBIAN32__
1.1709 +
1.1710 +OilFunctionImpl* __oil_function_impl_clamphigh_s16_pointer() {
1.1711 + return &_oil_function_impl_clamphigh_s16_pointer;
1.1712 +}
1.1713 +#endif
1.1714 +
1.1715 +#ifdef __SYMBIAN32__
1.1716 +
1.1717 +OilFunctionImpl* __oil_function_impl_clamphigh_u16_pointer() {
1.1718 + return &_oil_function_impl_clamphigh_u16_pointer;
1.1719 +}
1.1720 +#endif
1.1721 +
1.1722 +#ifdef __SYMBIAN32__
1.1723 +
1.1724 +OilFunctionImpl* __oil_function_impl_clamphigh_s32_pointer() {
1.1725 + return &_oil_function_impl_clamphigh_s32_pointer;
1.1726 +}
1.1727 +#endif
1.1728 +
1.1729 +#ifdef __SYMBIAN32__
1.1730 +
1.1731 +OilFunctionImpl* __oil_function_impl_clamphigh_u32_pointer() {
1.1732 + return &_oil_function_impl_clamphigh_u32_pointer;
1.1733 +}
1.1734 +#endif
1.1735 +
1.1736 +#ifdef __SYMBIAN32__
1.1737 +
1.1738 +OilFunctionImpl* __oil_function_impl_clamphigh_s8_unroll4() {
1.1739 + return &_oil_function_impl_clamphigh_s8_unroll4;
1.1740 +}
1.1741 +#endif
1.1742 +
1.1743 +#ifdef __SYMBIAN32__
1.1744 +
1.1745 +OilFunctionImpl* __oil_function_impl_clamphigh_u8_unroll4() {
1.1746 + return &_oil_function_impl_clamphigh_u8_unroll4;
1.1747 +}
1.1748 +#endif
1.1749 +
1.1750 +#ifdef __SYMBIAN32__
1.1751 +
1.1752 +OilFunctionImpl* __oil_function_impl_clamphigh_s16_unroll4() {
1.1753 + return &_oil_function_impl_clamphigh_s16_unroll4;
1.1754 +}
1.1755 +#endif
1.1756 +
1.1757 +#ifdef __SYMBIAN32__
1.1758 +
1.1759 +OilFunctionImpl* __oil_function_impl_clamphigh_u16_unroll4() {
1.1760 + return &_oil_function_impl_clamphigh_u16_unroll4;
1.1761 +}
1.1762 +#endif
1.1763 +
1.1764 +#ifdef __SYMBIAN32__
1.1765 +
1.1766 +OilFunctionImpl* __oil_function_impl_clamphigh_s32_unroll4() {
1.1767 + return &_oil_function_impl_clamphigh_s32_unroll4;
1.1768 +}
1.1769 +#endif
1.1770 +
1.1771 +#ifdef __SYMBIAN32__
1.1772 +
1.1773 +OilFunctionImpl* __oil_function_impl_clamphigh_u32_unroll4() {
1.1774 + return &_oil_function_impl_clamphigh_u32_unroll4;
1.1775 +}
1.1776 +#endif
1.1777 +
1.1778 +#ifdef __SYMBIAN32__
1.1779 +
1.1780 +OilFunctionImpl* __oil_function_impl_clamphigh_s8_trick() {
1.1781 + return &_oil_function_impl_clamphigh_s8_trick;
1.1782 +}
1.1783 +#endif
1.1784 +
1.1785 +#ifdef __SYMBIAN32__
1.1786 +
1.1787 +OilFunctionImpl* __oil_function_impl_clamphigh_u8_trick() {
1.1788 + return &_oil_function_impl_clamphigh_u8_trick;
1.1789 +}
1.1790 +#endif
1.1791 +
1.1792 +#ifdef __SYMBIAN32__
1.1793 +
1.1794 +OilFunctionImpl* __oil_function_impl_clamphigh_s16_trick() {
1.1795 + return &_oil_function_impl_clamphigh_s16_trick;
1.1796 +}
1.1797 +#endif
1.1798 +
1.1799 +#ifdef __SYMBIAN32__
1.1800 +
1.1801 +OilFunctionImpl* __oil_function_impl_clamphigh_u16_trick() {
1.1802 + return &_oil_function_impl_clamphigh_u16_trick;
1.1803 +}
1.1804 +#endif
1.1805 +
1.1806 +#ifdef __SYMBIAN32__
1.1807 +
1.1808 +OilFunctionImpl* __oil_function_impl_clamplow_s8_pointer() {
1.1809 + return &_oil_function_impl_clamplow_s8_pointer;
1.1810 +}
1.1811 +#endif
1.1812 +
1.1813 +#ifdef __SYMBIAN32__
1.1814 +
1.1815 +OilFunctionImpl* __oil_function_impl_clamplow_u8_pointer() {
1.1816 + return &_oil_function_impl_clamplow_u8_pointer;
1.1817 +}
1.1818 +#endif
1.1819 +
1.1820 +#ifdef __SYMBIAN32__
1.1821 +
1.1822 +OilFunctionImpl* __oil_function_impl_clamplow_s16_pointer() {
1.1823 + return &_oil_function_impl_clamplow_s16_pointer;
1.1824 +}
1.1825 +#endif
1.1826 +
1.1827 +#ifdef __SYMBIAN32__
1.1828 +
1.1829 +OilFunctionImpl* __oil_function_impl_clamplow_u16_pointer() {
1.1830 + return &_oil_function_impl_clamplow_u16_pointer;
1.1831 +}
1.1832 +#endif
1.1833 +
1.1834 +#ifdef __SYMBIAN32__
1.1835 +
1.1836 +OilFunctionImpl* __oil_function_impl_clamplow_s32_pointer() {
1.1837 + return &_oil_function_impl_clamplow_s32_pointer;
1.1838 +}
1.1839 +#endif
1.1840 +
1.1841 +#ifdef __SYMBIAN32__
1.1842 +
1.1843 +OilFunctionImpl* __oil_function_impl_clamplow_u32_pointer() {
1.1844 + return &_oil_function_impl_clamplow_u32_pointer;
1.1845 +}
1.1846 +#endif
1.1847 +
1.1848 +#ifdef __SYMBIAN32__
1.1849 +
1.1850 +OilFunctionImpl* __oil_function_impl_clamplow_s8_unroll4() {
1.1851 + return &_oil_function_impl_clamplow_s8_unroll4;
1.1852 +}
1.1853 +#endif
1.1854 +
1.1855 +#ifdef __SYMBIAN32__
1.1856 +
1.1857 +OilFunctionImpl* __oil_function_impl_clamplow_u8_unroll4() {
1.1858 + return &_oil_function_impl_clamplow_u8_unroll4;
1.1859 +}
1.1860 +#endif
1.1861 +
1.1862 +#ifdef __SYMBIAN32__
1.1863 +
1.1864 +OilFunctionImpl* __oil_function_impl_clamplow_s16_unroll4() {
1.1865 + return &_oil_function_impl_clamplow_s16_unroll4;
1.1866 +}
1.1867 +#endif
1.1868 +
1.1869 +#ifdef __SYMBIAN32__
1.1870 +
1.1871 +OilFunctionImpl* __oil_function_impl_clamplow_u16_unroll4() {
1.1872 + return &_oil_function_impl_clamplow_u16_unroll4;
1.1873 +}
1.1874 +#endif
1.1875 +
1.1876 +#ifdef __SYMBIAN32__
1.1877 +
1.1878 +OilFunctionImpl* __oil_function_impl_clamplow_s32_unroll4() {
1.1879 + return &_oil_function_impl_clamplow_s32_unroll4;
1.1880 +}
1.1881 +#endif
1.1882 +
1.1883 +#ifdef __SYMBIAN32__
1.1884 +
1.1885 +OilFunctionImpl* __oil_function_impl_clamplow_u32_unroll4() {
1.1886 + return &_oil_function_impl_clamplow_u32_unroll4;
1.1887 +}
1.1888 +#endif
1.1889 +
1.1890 +#ifdef __SYMBIAN32__
1.1891 +
1.1892 +OilFunctionImpl* __oil_function_impl_clamplow_s8_trick() {
1.1893 + return &_oil_function_impl_clamplow_s8_trick;
1.1894 +}
1.1895 +#endif
1.1896 +
1.1897 +#ifdef __SYMBIAN32__
1.1898 +
1.1899 +OilFunctionImpl* __oil_function_impl_clamplow_u8_trick() {
1.1900 + return &_oil_function_impl_clamplow_u8_trick;
1.1901 +}
1.1902 +#endif
1.1903 +
1.1904 +#ifdef __SYMBIAN32__
1.1905 +
1.1906 +OilFunctionImpl* __oil_function_impl_clamplow_s16_trick() {
1.1907 + return &_oil_function_impl_clamplow_s16_trick;
1.1908 +}
1.1909 +#endif
1.1910 +
1.1911 +#ifdef __SYMBIAN32__
1.1912 +
1.1913 +OilFunctionImpl* __oil_function_impl_clamplow_u16_trick() {
1.1914 + return &_oil_function_impl_clamplow_u16_trick;
1.1915 +}
1.1916 +#endif
1.1917 +