Update contrib.
7 /* This file is autogenerated. Do not edit. */
9 * LIBOIL - Library of Optimized Inner Loops
10 * Copyright (c) 2005 David A. Schleef <ds\@schleef.org>
11 * All rights reserved.
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
31 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
41 #include <liboil/liboil.h>
42 #include <liboil/liboilclasses.h>
55 ($kernel eq "clamphigh") and $low = 0;
56 ($kernel eq "clamplow") and $high = 0;
60 ${kernel}_${type}_pointer (oil_type_${type} *dest, oil_type_${type} *src1,
65 $low && print (" , oil_type_${type} *low\n");
66 $high && print (" , oil_type_${type} *high\n");
72 oil_type_${type} x = *src1;
75 ($low) and print (" if (x < *low) x = *low;\n");
76 ($high) and print (" if (x > *high) x = *high;\n");
85 OIL_DEFINE_IMPL (${kernel}_${type}_pointer, ${kernel}_${type});
98 ($kernel eq "clamphigh") and $low = 0;
99 ($kernel eq "clamplow") and $high = 0;
102 $low and $proto .= ", oil_type_${type} *low";
103 $high and $proto .= ", oil_type_${type} *high";
106 $low and $clamp .= " if (x < *low) x = *low;\n";
107 $high and $clamp .= " if (x > *high) x = *high;\n";
111 ${kernel}_${type}_unroll4 (oil_type_${type} *dest, oil_type_${type} *src,
142 OIL_DEFINE_IMPL (${kernel}_${type}_unroll4, ${kernel}_${type});
155 ($kernel eq "clamphigh") and $low = 0;
156 ($kernel eq "clamplow") and $high = 0;
159 $low and $proto .= ", oil_type_${type} *low";
160 $high and $proto .= ", oil_type_${type} *high";
163 $low and $clamp .= " x = x - (((x-*low)>>31)&(x-*low));\n";
164 $high and $clamp .= " x = x + (((*high-x)>>31)&(*high-x));\n";
168 ${kernel}_${type}_trick (oil_type_${type} *dest, oil_type_${type} *src,
199 OIL_DEFINE_IMPL (${kernel}_${type}_trick, ${kernel}_${type});
206 clamp_pointer("clamp", "s8");
207 clamp_pointer("clamp", "u8");
208 clamp_pointer("clamp", "s16");
209 clamp_pointer("clamp", "u16");
210 clamp_pointer("clamp", "s32");
211 clamp_pointer("clamp", "u32");
213 clamp_unroll4("clamp", "s8");
214 clamp_unroll4("clamp", "u8");
215 clamp_unroll4("clamp", "s16");
216 clamp_unroll4("clamp", "u16");
217 clamp_unroll4("clamp", "s32");
218 clamp_unroll4("clamp", "u32");
220 clamp_trick("clamp", "s8");
221 clamp_trick("clamp", "u8");
222 clamp_trick("clamp", "s16");
223 clamp_trick("clamp", "u16");
225 clamp_pointer("clamphigh", "s8");
226 clamp_pointer("clamphigh", "u8");
227 clamp_pointer("clamphigh", "s16");
228 clamp_pointer("clamphigh", "u16");
229 clamp_pointer("clamphigh", "s32");
230 clamp_pointer("clamphigh", "u32");
232 clamp_unroll4("clamphigh", "s8");
233 clamp_unroll4("clamphigh", "u8");
234 clamp_unroll4("clamphigh", "s16");
235 clamp_unroll4("clamphigh", "u16");
236 clamp_unroll4("clamphigh", "s32");
237 clamp_unroll4("clamphigh", "u32");
239 clamp_trick("clamphigh", "s8");
240 clamp_trick("clamphigh", "u8");
241 clamp_trick("clamphigh", "s16");
242 clamp_trick("clamphigh", "u16");
244 clamp_pointer("clamplow", "s8");
245 clamp_pointer("clamplow", "u8");
246 clamp_pointer("clamplow", "s16");
247 clamp_pointer("clamplow", "u16");
248 clamp_pointer("clamplow", "s32");
249 clamp_pointer("clamplow", "u32");
251 clamp_unroll4("clamplow", "s8");
252 clamp_unroll4("clamplow", "u8");
253 clamp_unroll4("clamplow", "s16");
254 clamp_unroll4("clamplow", "u16");
255 clamp_unroll4("clamplow", "s32");
256 clamp_unroll4("clamplow", "u32");
258 clamp_trick("clamplow", "s8");
259 clamp_trick("clamplow", "u8");
260 clamp_trick("clamplow", "s16");
261 clamp_trick("clamplow", "u16");