source: proto/lz4d/bitwise_op_helper.py @ 5539

Last change on this file since 5539 was 5539, checked in by xwa163, 22 months ago

lz4d_prototype: add prototype for sequential_pablo_kernel, modify lz4d prototype to use sequential_pablo_kernel

File size: 282 bytes
Line 
1# Bitwise Operation
2def bit_test(bit, index):
3    return bit >> index & 1
4
5
6def bit_clear(bit, index):
7    return bit & ~(1 << index);
8
9
10def bit_set(bit, index):
11    return bit | (1 << index)
12
13
14def bit_set_value(bit, value, index):
15    return bit & ~(1 << index) | (value << index)
Note: See TracBrowser for help on using the repository browser.