summaryrefslogtreecommitdiff
path: root/liboil/ref
diff options
context:
space:
mode:
authorDavid Schleef <ds@ginger.bigkitten.com>2008-03-13 13:29:46 -0700
committerDavid Schleef <ds@ginger.bigkitten.com>2008-03-13 13:29:46 -0700
commit3297a4ee2e5a8f27f89206c79335c8af82ba863f (patch)
tree40368f3e7e033d150c4fd7e845baec1c419505af /liboil/ref
parent873b7f253cf57730911da1716855541b28aedd9f (diff)
downloadliboil-3297a4ee2e5a8f27f89206c79335c8af82ba863f.tar.gz
Add scalarmult_f64_ns. From Sebastian Dröge <slomo@circular-chaos.org>, Bug #14878
Diffstat (limited to 'liboil/ref')
-rw-r--r--liboil/ref/math.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/liboil/ref/math.c b/liboil/ref/math.c
index a31acaa..44ec929 100644
--- a/liboil/ref/math.c
+++ b/liboil/ref/math.c
@@ -274,6 +274,18 @@ OIL_DEFINE_CLASS (scalaradd_f32_ns, "float *d, float *s1, float *s2_1, int n");
*/
OIL_DEFINE_CLASS (scalarmultiply_f32_ns, "float *d, float *s1, float *s2_1, int n");
+/**
+ * oil_scalarmultiply_f64_ns:
+ * @d: destination
+ * @s1: source
+ * @s2_1: source
+ * @n: number of elements
+ *
+ * Multiplies the constant value @s2_1 and each source element and places
+ * the result in @d.
+ */
+OIL_DEFINE_CLASS (scalarmultiply_f64_ns, "double *d, double *s1, double *s2_1, int n");
+
static void
add_s16_ref (int16_t *d, int16_t *src1, int16_t *src2, int n)
{
@@ -514,4 +526,14 @@ scalarmultiply_f32_ns_ref (float *dest, float *src1, float *src2, int n)
}
OIL_DEFINE_IMPL_REF (scalarmultiply_f32_ns_ref, scalarmultiply_f32_ns);
+static void
+scalarmultiply_f64_ns_ref (double *dest, double *src1, double *src2, int n)
+{
+ int i;
+
+ for(i=0;i<n;i++){
+ dest[i] = src1[i] * src2[0];
+ }
+}
+OIL_DEFINE_IMPL_REF (scalarmultiply_f64_ns_ref, scalarmultiply_f64_ns);