flat assembler
Message board for the users of flat assembler.
Index
> Main > shl + first bit, or shr + carry flag? |
Author |
|
revolution 09 Feb 2018, 09:31
vivik wrote: I need to pack a texture into a bit array. I now have a bunch of pixels, each is either ff000000 or ffffffff. Looks like a good place to compress. vivik wrote: Can I use SIMD here somehow? |
|||
09 Feb 2018, 09:31 |
|
vivik 09 Feb 2018, 12:05
Which SIMD instructions/intrisics?
|
|||
09 Feb 2018, 12:05 |
|
revolution 09 Feb 2018, 12:54
vivik wrote: Which SIMD instructions/intrisics? |
|||
09 Feb 2018, 12:54 |
|
Ali.Z 09 Feb 2018, 14:02
vivik wrote: What is the better way to extract bits from a byte? if the least significant bit is '1' then shr will take off that bit and set carry flag to '1' so its not recommended to use that. instead you can use rol and ror. if you wanna use shr and shl without losing the least significant bit, then you need CC (condition code) like cmovpe cmovpo jpe jpo setpe setpo pe = if parity flag is even po = if parity flag is odd even if you lost the LSB and carry set to '1' you can move it into a register. there are many choices tho, depends on your need or how you wanna do your things. |
|||
09 Feb 2018, 14:02 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.