fix brain dead computation of the aligned bit.

When using a max-size that is fixed and not a multiple of 16 bit, we're not aligned.
This commit is contained in:
Benoit Jacob 2010-06-21 21:07:53 -04:00
parent ad8b6c2342
commit eaa81c135a

View File

@ -96,8 +96,12 @@ class ei_compute_matrix_flags
row_major_bit = Options&RowMajor ? RowMajorBit : 0,
inner_max_size = row_major_bit ? MaxCols : MaxRows,
is_big = inner_max_size == Dynamic,
is_packet_size_multiple = (Cols*Rows) % ei_packet_traits<Scalar>::size == 0,
aligned_bit = ((Options&AutoAlign) && (is_big || is_packet_size_multiple)) ? AlignedBit : 0,
storage_has_fixed_size = MaxRows != Dynamic && MaxCols != Dynamic,
storage_has_aligned_fixed_size = storage_has_fixed_size
&& ( (MaxCols*MaxRows) % ei_packet_traits<Scalar>::size == 0 ),
aligned_bit = ( (Options&AutoAlign)
&& (is_big || storage_has_aligned_fixed_size)
) ? AlignedBit : 0,
packet_access_bit = ei_packet_traits<Scalar>::size > 1 && aligned_bit ? PacketAccessBit : 0
};