The following code writes a 16×16 bitmap to a framebuffer using up to
AVX2 instuctions. I’m sure it can be improved with
AVX512 but I’m only interested in improvements using
AVX2 and below. Specifically, I want to know if there is a more efficient way of doing it. Each bit in the bitmap represents a pixel and requires a dword attribute to be written. Each 2 byte word of the 32 byte data does one 16 pixel row for a total of 16 rows. The below code does 8 loads and 32 stores for each 16×16 written.
FColor dd 0x00ffffff ; white BColor dd 0x000000ff ; blue ALIGN 32 bitshift_to_MSB dd 24, 25, 26, 27, 28, 29, 30, 31 ; 95 * 32 byte bitmaps (SPACE to '~') CH_ARIAL db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, . . . 0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00, ; rdi = framebuffer address to write to ; edx = printable ascii character (assumed to be between 32 and 126 sub edx, 32 shl edx, 5 mov ecx, 8 vpbroadcastd ymm4, [FColor] vpbroadcastd ymm3, [BColor] vmovdqa ymm2, yword [bitshift_to_MSB] @@: vpbroadcastd ymm0, dword [CH_ARIAL + edx] ; broadcasts dword (32 bits, for 2 x 16 pixel rows) vpsllvd ymm1, ymm0, ymm2 ; shifts left according to ymm2 to set dword MSB based on 1st byte vblendvps ymm1, ymm3, ymm4, ymm1 ; set dwords in ymm1 = (each dword MSB)?ymm4:ymm3 vmovdqa [rdi], ymm1 vpsrld ymm0, ymm0, 8 ; shift 2nd byte of each dword to first position vpsllvd ymm1, ymm0, ymm2 vblendvps ymm1, ymm3, ymm4, ymm1 vmovdqa [rdi+32], ymm1 add rdi, 1920*4 ; mov down to next row of pixels vpsrld ymm0, ymm0, 8 vpsllvd ymm1, ymm0, ymm2 vblendvps ymm1, ymm3, ymm4, ymm1 vmovdqa [rdi], ymm1 vpsrld ymm0, ymm0, 8 vpsllvd ymm1, ymm0, ymm2 vblendvps ymm1, ymm3, ymm4, ymm1 vmovdqa [rdi+32], ymm1 add edx, 4 add rdi, 1920*4 dec ecx jnz @b
✓ Extra quality
ExtraProxies brings the best proxy quality for you with our private and reliable proxies
✓ Extra anonymity
Top level of anonymity and 100% safe proxies – this is what you get with every proxy package
✓ Extra speed
1,ooo mb/s proxy servers speed – we are way better than others – just enjoy our proxies!
USA proxy location
We offer premium quality USA private proxies – the most essential proxies you can ever want from USA
Our proxies have TOP level of anonymity + Elite quality, so you are always safe and secure with your proxies
Use your proxies as much as you want – we have no limits for data transfer and bandwidth, unlimited usage!
Superb fast proxy servers with 1,000 mb/s speed – sit back and enjoy your lightning fast private proxies!
99,9% servers uptime
Alive and working proxies all the time – we are taking care of our servers so you can use them without any problems
No usage restrictions
You have freedom to use your proxies with every software, browser or website you want without restrictions
Perfect for SEO
We are 100% friendly with all SEO tasks as well as internet marketing – feel the power with our proxies
Buy more proxies and get better price – we offer various proxy packages with great deals and discounts
We are working 24/7 to bring the best proxy experience for you – we are glad to help and assist you!