summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_tile_shuffle_mask.py
blob: ea2fc0f3758af348857b870f063011fadee8ec7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

tile =  [[0,1,4,5],
	 [2,3,6,7],
	 [8,9,12,13],
	 [10,11,14,15]]
shift = 0
align = 1
value = 0L
holder = []

import sys

basemask = [0x
fd = sys.stdout
indent = " "*9
for c in range(4):
   fd.write(indent + "*pdst++ = \n");
   for l,line in enumerate(tile):
	fd.write(indent + "   %s_mm_shuffle_epi8(line%d, (__m128i){"%(l and '+' or ' ',l))
	for i,pos in enumerate(line):
	    mask = 0x00ffffffff & (~(0xffL << shift))
	    value = mask | ((pos) << shift)
	    holder.append(value)
            if holder and (i + 1) %2 == 0:
		fd.write("0x%8.0x"%(holder[0] + (holder[1] << 32)))
		holder = []
		if (i) %4 == 1:
			fd.write( ',')
	        
        fd.write("})%s\n"%((l == 3) and ';' or ''))
   print
   shift += 8