From 0f851a1c1fe88caf88e7f7e617435dbfc830ead9 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Tue, 29 Jun 2010 00:58:20 +0200 Subject: [PATCH] probdist_alloca(): Align the arrays more generously Should reduce the number of unaligned accesses. --- probdist.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/probdist.h b/probdist.h index cc44675..dc56899 100644 --- a/probdist.h +++ b/probdist.h @@ -28,8 +28,8 @@ struct probdist { /* Declare pd_ corresponding to board b_ in the local scope. */ #define probdist_alloca(pd_, b_) \ - double pd_ ## __pdi[board_size2(b_)]; memset(pd_ ## __pdi, 0, sizeof(pd_ ## __pdi)); \ - double pd_ ## __pdr[board_size(b_)]; memset(pd_ ## __pdr, 0, sizeof(pd_ ## __pdr)); \ + double pd_ ## __pdi[board_size2(b_)] __attribute__((aligned(32))); memset(pd_ ## __pdi, 0, sizeof(pd_ ## __pdi)); \ + double pd_ ## __pdr[board_size(b_)] __attribute__((aligned(32))); memset(pd_ ## __pdr, 0, sizeof(pd_ ## __pdr)); \ struct probdist pd_ = { .b = b_, .items = pd_ ## __pdi, .rowtotals = pd_ ## __pdr, .total = 0 }; /* Get the value of given item. */ -- 2.11.4.GIT