[Issue 11418] bit test pattern not inlined core.bitop.bt useless

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 8 14:48:24 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=11418

Dennis <dkorpel at live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dkorpel at live.nl
         Resolution|---                         |FIXED

--- Comment #1 from Dennis <dkorpel at live.nl> ---
Issue 10985 is now fixed, so testing with:

-O -inline
```
import core.bitop: bt;

int foo(ulong* p, ulong bitnum) 
{
    return bt(p, bitnum);
}
```

ASM:
```
int onlineapp.foo(ulong*, ulong):
        push    RBP
        mov     RBP,RSP
        mov     RCX,RDI
        shr     RCX,6
        mov     EDX,EDI
        and     EDX,03Fh
        bt      [RCX*8][RSI],EDX
        setb    AL
        and     EAX,1
        pop     RBP
        ret
        add     [RAX],AL
```

The function is inlined and a bt instruction is generated, so it looks like
this issue is fixed as well.

--


More information about the Digitalmars-d-bugs mailing list