flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2 |
Author |
|
vid 22 Jan 2007, 06:05
so anyone could create thread for "Speed testing code" and put it all together?
![]() |
|||
![]() |
|
Plue 24 Jan 2007, 16:10
> I mainly use BT for small code
But BT is larger than TEST?!? |
|||
![]() |
|
f0dder 24 Jan 2007, 16:43
Plue wrote: > I mainly use BT for small code Nah, you need more than just a TEST instruction to perform the sam as BT [mem32], reg32 - BT is small here. _________________ ![]() |
|||
![]() |
|
MCD 25 Jan 2007, 11:40
f0dder wrote:
You absolutely right. BTx instructions are useful when you need to test a bit at a position not know at compile-time and if you only have a few bits to test. if bit position is know at compile time => use TEST or something if you have lots of bits to test => try building a mask, maybe with some look up table and perform a TEST with that BTW: BTx is almost as fast as TEST (except for the memory version) on my Athlon XP, but was way slower than TEST on a PII _________________ MCD - the inevitable return of the Mad Computer Doggy -||__/ .|+-~ .|| || |
|||
![]() |
|
Tomasz Grysztar 25 Jan 2007, 11:42
BTx instructions other than BT are also useful because the allow to test the bit and alter it at the same time.
|
|||
![]() |
|
16bitPM 23 Oct 2022, 15:44
Tomasz Grysztar wrote: BTx instructions other than BT are also useful because the allow to test the bit and alter it at the same time. I would also say for bit and bit string manipulation, because BT effectively copies a bit to the carry flag, you can use it directly in arithmetic and shift operations. Other than that specific use case, BT reg,imm seems rather superfluous to me. |
|||
![]() |
|
Furs 24 Oct 2022, 13:15
16bitPM wrote:
|
|||
![]() |
|
revolution 24 Oct 2022, 13:20
Furs wrote: Here's another one: in 64-bit mode, immediates are 32-bit sign extended, so if you want to test a bit in the upper 32-bit half of the 64-bit register, only BT can do that with an immediate. This instruction is valid: Code: bt rax,rcx |
|||
![]() |
|
16bitPM 24 Oct 2022, 14:20
revolution wrote:
No, he was replying on my comment on the specific case of BT with an immediate operand and a register. |
|||
![]() |
|
Furs 25 Oct 2022, 13:01
Yeah, basically you can't do:
Code: test rax, 1 shl 42 Code: bt rax, 42 |
|||
![]() |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.