summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-03-08 18:06:51 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-03-08 18:06:51 +0000
commit635c604b787625f93763001951f8bdf66482c682 (patch)
tree204d3e8cc0ad828f0a111c1424e116832896f485
parenta087430ad99c06e79249d2cdd019cb8bf7f955d3 (diff)
sna/traps: Unroll insertion sort
As the compiler cannot know the loop is bounded by a sentinel, manually unroll it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_trapezoids.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index 33ea3bbb..8e735efe 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -556,6 +556,14 @@ cell_list_find(struct cell_list *cells, int x)
break;
tail = tail->next;
+ if (tail->next->x > x)
+ break;
+
+ tail = tail->next;
+ if (tail->next->x > x)
+ break;
+
+ tail = tail->next;
} while (1);
if (tail->x != x)