mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-19 18:44:24 +03:00
simd_utils: setbit/clearbit by loading 1-bit mask
This commit is contained in:
committed by
Matthew Barr
parent
790683b641
commit
49bb3b5c82
@@ -26,6 +26,10 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* \brief Lookup tables to support SIMD operations.
|
||||
*/
|
||||
|
||||
#include "simd_utils.h"
|
||||
|
||||
const char vbs_mask_data[] ALIGN_CL_DIRECTIVE = {
|
||||
@@ -38,3 +42,19 @@ const char vbs_mask_data[] ALIGN_CL_DIRECTIVE = {
|
||||
0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
|
||||
0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
|
||||
};
|
||||
|
||||
#define ZEROES_8 0, 0, 0, 0, 0, 0, 0, 0
|
||||
#define ZEROES_31 ZEROES_8, ZEROES_8, ZEROES_8, 0, 0, 0, 0, 0, 0, 0
|
||||
#define ZEROES_32 ZEROES_8, ZEROES_8, ZEROES_8, ZEROES_8
|
||||
|
||||
/** \brief LUT for the mask1bit functions. */
|
||||
const u8 simd_onebit_masks[] ALIGN_CL_DIRECTIVE = {
|
||||
ZEROES_31, 0x01, ZEROES_32,
|
||||
ZEROES_31, 0x02, ZEROES_32,
|
||||
ZEROES_31, 0x04, ZEROES_32,
|
||||
ZEROES_31, 0x08, ZEROES_32,
|
||||
ZEROES_31, 0x10, ZEROES_32,
|
||||
ZEROES_31, 0x20, ZEROES_32,
|
||||
ZEROES_31, 0x40, ZEROES_32,
|
||||
ZEROES_31, 0x80, ZEROES_32,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user