summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-02-26 11:28:05 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-02-26 11:37:10 +0000
commit08747292b717fcea84ce3adc455b0161e5517e84 (patch)
tree91a0908389e857aa2163b14c6aa713a7f721339e /src
parent9c63ddd9f14588bcec8275e2a64e56cc5b661a5a (diff)
sna: Conditionally compile sse2 routines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/compiler.h2
-rw-r--r--src/sna/gen3_render.c16
-rw-r--r--src/sna/gen4_vertex.c4
3 files changed, 12 insertions, 10 deletions
diff --git a/src/sna/compiler.h b/src/sna/compiler.h
index fed9bc0d..0e0be90e 100644
--- a/src/sna/compiler.h
+++ b/src/sna/compiler.h
@@ -55,8 +55,6 @@
#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 4)
#define sse2 __attribute__((target("sse2,fpmath=sse+387")))
#define sse4_2 __attribute__((target("sse4.2,sse2,fpmath=sse+387")))
-#else
-#define sse2
#endif
#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 7)
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index 1c6d0ec5..79233ca3 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -3625,7 +3625,7 @@ gen3_emit_composite_spans_primitive_identity_gradient__boxes(const struct sna_co
} while (--nbox);
}
-#ifndef __x86_64__
+#if defined(sse2) && !defined(__x86_64__)
sse2 fastcall static void
gen3_emit_composite_spans_primitive_constant__sse2(struct sna *sna,
const struct sna_composite_spans_op *op,
@@ -4380,7 +4380,7 @@ gen3_render_composite_spans(struct sna *sna,
case SHADER_WHITE:
case SHADER_CONSTANT:
if (no_offset) {
-#ifndef __x86_64__
+#if defined(sse2) && !defined(__x86_64__)
if (sna->cpu_features & SSE2) {
tmp->box = gen3_render_composite_spans_constant_box__sse2;
tmp->thread_boxes = gen3_render_composite_spans_constant_thread__sse2__boxes;
@@ -4395,7 +4395,7 @@ gen3_render_composite_spans(struct sna *sna,
tmp->emit_boxes = gen3_emit_composite_spans_primitive_constant_no_offset__boxes;
}
} else {
-#ifndef __x86_64__
+#if defined(sse2) && !defined(__x86_64__)
if (sna->cpu_features & SSE2) {
tmp->prim_emit = gen3_emit_composite_spans_primitive_constant__sse2;
tmp->emit_boxes = gen3_emit_composite_spans_primitive_constant__sse2__boxes;
@@ -4410,11 +4410,11 @@ gen3_render_composite_spans(struct sna *sna,
case SHADER_LINEAR:
case SHADER_RADIAL:
if (tmp->base.src.transform == NULL) {
-#ifndef __x86_64__
+#if defined(sse2) && !defined(__x86_64__)
if (sna->cpu_features & SSE2) {
tmp->prim_emit = gen3_emit_composite_spans_primitive_identity_gradient__sse2;
tmp->emit_boxes = gen3_emit_composite_spans_primitive_identity_gradient__sse2__boxes;
- } else
+ } else
#endif
{
tmp->prim_emit = gen3_emit_composite_spans_primitive_identity_gradient;
@@ -4422,7 +4422,7 @@ gen3_render_composite_spans(struct sna *sna,
}
} else if (tmp->base.src.is_affine) {
tmp->base.src.scale[1] = tmp->base.src.scale[0] = 1. / tmp->base.src.transform->matrix[2][2];
-#ifndef __x86_64__
+#if defined(sse2) && !defined(__x86_64__)
if (sna->cpu_features & SSE2) {
tmp->prim_emit = gen3_emit_composite_spans_primitive_affine_gradient__sse2;
tmp->emit_boxes = gen3_emit_composite_spans_primitive_affine_gradient__sse2__boxes;
@@ -4436,7 +4436,7 @@ gen3_render_composite_spans(struct sna *sna,
break;
case SHADER_TEXTURE:
if (tmp->base.src.transform == NULL) {
-#ifndef __x86_64__
+#if defined(sse2) && !defined(__x86_64__)
if (sna->cpu_features & SSE2) {
tmp->prim_emit = gen3_emit_composite_spans_primitive_identity_source__sse2;
tmp->emit_boxes = gen3_emit_composite_spans_primitive_identity_source__sse2__boxes;
@@ -4449,7 +4449,7 @@ gen3_render_composite_spans(struct sna *sna,
} else if (tmp->base.src.is_affine) {
tmp->base.src.scale[0] /= tmp->base.src.transform->matrix[2][2];
tmp->base.src.scale[1] /= tmp->base.src.transform->matrix[2][2];
-#ifndef __x86_64__
+#if defined(sse2) && !defined(__x86_64__)
if (sna->cpu_features & SSE2) {
tmp->prim_emit = gen3_emit_composite_spans_primitive_affine_source__sse2;
tmp->emit_boxes = gen3_emit_composite_spans_primitive_affine_source__sse2__boxes;
diff --git a/src/sna/gen4_vertex.c b/src/sna/gen4_vertex.c
index c307a6b1..35f772e9 100644
--- a/src/sna/gen4_vertex.c
+++ b/src/sna/gen4_vertex.c
@@ -34,6 +34,10 @@
#include "sna_render_inline.h"
#include "gen4_vertex.h"
+#ifndef sse2
+#define sse2
+#endif
+
void gen4_vertex_flush(struct sna *sna)
{
DBG(("%s[%x] = %d\n", __FUNCTION__,