Skip to content

Comments

Issue 4360 - Allow intrinsics in core.bitop to operate as intrinsics#4

Closed
complexmath wants to merge 2 commits intodlang:masterfrom
complexmath:master
Closed

Issue 4360 - Allow intrinsics in core.bitop to operate as intrinsics#4
complexmath wants to merge 2 commits intodlang:masterfrom
complexmath:master

Conversation

@complexmath
Copy link
Contributor

druntime currently has to include std.intrinsic so its modules can use intrinsic operations, but the routines are exposed via core.bitop. DMD should recognize core.bitop.bsr as an alias for std.intrinsic.bsr, etc.

http://d.puremagic.com/issues/show_bug.cgi?id=4360

@complexmath
Copy link
Contributor Author

If this pull request is accepted, the following druntime pull request should be accepted as well:

dlang/druntime#5

@braddr
Copy link
Member

braddr commented Feb 8, 2011

looks like your source tree is in an odd state. This wasn't a small diff, it was a file add.

I'm in favor of it. imho, the entire compiler interface belongs in druntime, and this is clearly part of that interface. Included in what I think should move is the std.math intrinsics.

@complexmath
Copy link
Contributor Author

The pull should happen from my branch issue-4360 instead. That is in the correct state.

braddr pushed a commit to braddr/dmd that referenced this pull request Sep 15, 2011
UplinkCoder referenced this pull request in UplinkCoder/dmd Aug 13, 2016
UplinkCoder referenced this pull request in UplinkCoder/dmd Aug 31, 2016
UplinkCoder referenced this pull request in UplinkCoder/dmd Sep 1, 2016
UplinkCoder referenced this pull request in UplinkCoder/dmd Sep 4, 2016
UplinkCoder referenced this pull request in UplinkCoder/dmd Sep 19, 2016
UplinkCoder referenced this pull request in UplinkCoder/dmd Sep 25, 2016
MartinNowak pushed a commit to MartinNowak/dmd that referenced this pull request Feb 15, 2017
Revert "Merge pull request #2 from MartinNowak/test-pr-2"
thewilsonator added a commit to thewilsonator/dmd that referenced this pull request Sep 22, 2022
The test checks the stack frame of `_Dmain` is in the backtrace, however if unused locals are optimised out and`test` is inlined into `main` 
```d
void test()
{
    int innerLocal = 20;
    throw new Exception("foo");
}
void main(string[] args)
{
    string myLocal = "bar";
    test();
}
```
then the point at which the untapped exception is thrown is at the start of D main - not somewhere in the middle of it - and so GDB prints 
```
...
dlang#4 D main (args=...)
```
rather than 
```
...
dlang#4 0xSOMEADDRESS in D main (args=...)
```
thewilsonator added a commit to thewilsonator/dmd that referenced this pull request Nov 2, 2022
The test checks the stack frame of `_Dmain` is in the backtrace, however if unused locals are optimised out and`test` is inlined into `main` 
```d
void test()
{
    int innerLocal = 20;
    throw new Exception("foo");
}
void main(string[] args)
{
    string myLocal = "bar";
    test();
}
```
then the point at which the untapped exception is thrown is at the start of D main - not somewhere in the middle of it - and so GDB prints 
```
...
dlang#4 D main (args=...)
```
rather than 
```
...
dlang#4 0xSOMEADDRESS in D main (args=...)
```
dlang-bot pushed a commit that referenced this pull request Nov 2, 2022
The test checks the stack frame of `_Dmain` is in the backtrace, however if unused locals are optimised out and`test` is inlined into `main` 
```d
void test()
{
    int innerLocal = 20;
    throw new Exception("foo");
}
void main(string[] args)
{
    string myLocal = "bar";
    test();
}
```
then the point at which the untapped exception is thrown is at the start of D main - not somewhere in the middle of it - and so GDB prints 
```
...
#4 D main (args=...)
```
rather than 
```
...
#4 0xSOMEADDRESS in D main (args=...)
```
deadalnix pushed a commit to deadalnix/dmd that referenced this pull request Sep 2, 2024
__sd_run_finalizer => __sd_gc_finalize
gorsing referenced this pull request in gorsing/dmd Jul 14, 2025
# This is the 1st commit message:

refactoring

# This is the commit message #2:

refactoring

# This is the commit message #3:

refactoring

# This is the commit message #4:

refactoring

# This is the commit message #5:

refactoring

# This is the commit message #6:

refactoring

# This is the commit message #7:

refactoring

# This is the commit message #8:

refactor/irstate-attrs

refactoring

add pragma(inline, true)

change pragma(inline, true) -> pragma(inline, false)

introduce root.Array.only and test it out in expressionsem (dlang#21520)

[attrib.d] remove unused semantic import

[dstruct.d] remove unused import

[aggregate.d] move `searchCtor` to `expressionsem.d`

remove some now unused semantic symbols from the import list.

[cond.d] remove unused `typesem` import (dlang#21538)

[expression.d] restrict `typesem` import

fix dlang#19587 No debug line info for simple code blocks (dlang#21544)

set location info on return statement, not only on return expression

[dsymbol.d] remove dependance on glue layer (dlang#21532)

move `loadModuleFromLibrary` to `dsymbolsem.d` (dlang#21535)

remove `dmodule.d` dependance of a few more `dsymbolsem.d` symbols.

[func.d] remove dependance on glue layer (dlang#21534)

[aggregate.d] move `checkOverlappedFields` to `dsymbolsem.d` (dlang#21542)

and make private

Templatize `_adEq2` (dlang#21513)

* Mark array literals as `on-stack` to bypass `@nogc` analysis

* Update `fail_compilation` test output

After updating the memcmp-ability criteria, now dynamic array can also
be compared using `memcmp` if their element type is comparable bit by
bit.

refactor: use new array constructor throughout expressionsem

refactoring

refactoring

refactoring

refactoring

refactoring

refactoring

refactoring

refactoring

refactoring
ibuclaw added a commit to ibuclaw/dmd that referenced this pull request Sep 11, 2025
Limit the number of platforms that this is done on.  A inspection of
some libc implementations of fork has identified the main culprits,
don't need to apply this to any others.

MacOS testsuite also regressed as a result on calling this code, it's
not clear why, but the backtrace is:
```
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
  * frame #0: 0x00007ff81abe6ee3 libsystem_platform.dylib`_os_unfair_lock_recursive_abort + 23
    frame #1: 0x00007ff81abe12da libsystem_platform.dylib`_os_unfair_lock_lock_slow + 247
    frame #2: 0x00007ff81abccd44 libsystem_pthread.dylib`_pthread_atfork_prepare_handlers + 48
    frame dlang#3: 0x00007ff825dc2705 libSystem.B.dylib`libSystem_atfork_prepare + 25
    frame dlang#4: 0x00007ff81aac17e1 libsystem_c.dylib`fork + 24
    frame dlang#5: 0x0000000101f730ee test_runner`core.internal.backtrace.dwarf.resolveAddressesWithAtos(Location[]) + 210
```
thewilsonator pushed a commit that referenced this pull request Sep 11, 2025
Limit the number of platforms that this is done on.  A inspection of
some libc implementations of fork has identified the main culprits,
don't need to apply this to any others.

MacOS testsuite also regressed as a result on calling this code, it's
not clear why, but the backtrace is:
```
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
  * frame #0: 0x00007ff81abe6ee3 libsystem_platform.dylib`_os_unfair_lock_recursive_abort + 23
    frame #1: 0x00007ff81abe12da libsystem_platform.dylib`_os_unfair_lock_lock_slow + 247
    frame #2: 0x00007ff81abccd44 libsystem_pthread.dylib`_pthread_atfork_prepare_handlers + 48
    frame #3: 0x00007ff825dc2705 libSystem.B.dylib`libSystem_atfork_prepare + 25
    frame #4: 0x00007ff81aac17e1 libsystem_c.dylib`fork + 24
    frame #5: 0x0000000101f730ee test_runner`core.internal.backtrace.dwarf.resolveAddressesWithAtos(Location[]) + 210
```
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants