Skip to content

Comments

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

Closed
complexmath wants to merge 3 commits intodlang:masterfrom
complexmath:issue-4360
Closed

Issue 4360 - Allow intrinsics in core.bitop to operate as intrinsics#5
complexmath wants to merge 3 commits intodlang:masterfrom
complexmath:issue-4360

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

The following druntime pull request should be applied as well:

dlang/druntime#6

@WalterBright
Copy link
Member

folded in

braddr pushed a commit to braddr/dmd that referenced this pull request Sep 15, 2011
MartinNowak pushed a commit that referenced this pull request Mar 19, 2016
adapt changelog to modified -transition=import/checkimports
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Aug 13, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Aug 31, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Sep 1, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Sep 4, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Sep 19, 2016
UplinkCoder added a commit to UplinkCoder/dmd that referenced this pull request Sep 25, 2016
skl131313 pushed a commit to skl131313/dmd that referenced this pull request Jan 24, 2017
Fix dlang#2 - incorrect construct of typeinfo for tuple
MartinNowak added a commit to MartinNowak/dmd that referenced this pull request Feb 25, 2017
ntrel added a commit to ntrel/dmd that referenced this pull request Apr 14, 2025
After dlang#5, without `-preview=tuples`, the parser would cause an assert
error when finding tokens that satisfy `isTupleNotation`.
ntrel added a commit to ntrel/dmd that referenced this pull request Apr 14, 2025
After dlang#5, without `-preview=tuples`, the parser would cause an assert
error when finding tokens that satisfy `isTupleNotation`.
ntrel added a commit to ntrel/dmd that referenced this pull request Apr 14, 2025
…dlang#7)

* Fix parsing tuple notation without `-preview=tuples`

After dlang#5, without `-preview=tuples`, the parser would cause an assert
error when finding tokens that satisfy `isTupleNotation`.

* Fix parsing malformed auto declaration starting with `(`

Change preview check to an assert after last commit.
Handle a tuple declaration that doesn't have `=` after the last `)`. The
`peekPastParen(&token).value == TOK.assign` check is not needed because
the `parseInitializer` parameter is true so `check(TOK.assign)` does the
job and provides a good error message if missing.
Add test for malformed auto and non-auto tuple declarations.

* Remove unnecessary preview check
ntrel added a commit to ntrel/dmd that referenced this pull request Apr 14, 2025
…dlang#7)

* Fix parsing tuple notation without `-preview=tuples`

After dlang#5, without `-preview=tuples`, the parser would cause an assert
error when finding tokens that satisfy `isTupleNotation`.

* Fix parsing malformed auto declaration starting with `(`

Change preview check to an assert after last commit.
Handle a tuple declaration that doesn't have `=` after the last `)`. The
`peekPastParen(&token).value == TOK.assign` check is not needed because
the `parseInitializer` parameter is true so `check(TOK.assign)` does the
job and provides a good error message if missing.
Add test for malformed auto and non-auto tuple declarations.

* Remove unnecessary preview check
ntrel added a commit to ntrel/dmd that referenced this pull request Apr 16, 2025
…dlang#7)

* Fix parsing tuple notation without `-preview=tuples`

After dlang#5, without `-preview=tuples`, the parser would cause an assert
error when finding tokens that satisfy `isTupleNotation`.

* Fix parsing malformed auto declaration starting with `(`

Change preview check to an assert after last commit.
Handle a tuple declaration that doesn't have `=` after the last `)`. The
`peekPastParen(&token).value == TOK.assign` check is not needed because
the `parseInitializer` parameter is true so `check(TOK.assign)` does the
job and provides a good error message if missing.
Add test for malformed auto and non-auto tuple declarations.

* Remove unnecessary preview check
ntrel added a commit to ntrel/dmd that referenced this pull request Apr 27, 2025
…dlang#7)

* Fix parsing tuple notation without `-preview=tuples`

After dlang#5, without `-preview=tuples`, the parser would cause an assert
error when finding tokens that satisfy `isTupleNotation`.

* Fix parsing malformed auto declaration starting with `(`

Change preview check to an assert after last commit.
Handle a tuple declaration that doesn't have `=` after the last `)`. The
`peekPastParen(&token).value == TOK.assign` check is not needed because
the `parseInitializer` parameter is true so `check(TOK.assign)` does the
job and provides a good error message if missing.
Add test for malformed auto and non-auto tuple declarations.

* Remove unnecessary preview check
ntrel added a commit to ntrel/dmd that referenced this pull request May 15, 2025
…dlang#7)

* Fix parsing tuple notation without `-preview=tuples`

After dlang#5, without `-preview=tuples`, the parser would cause an assert
error when finding tokens that satisfy `isTupleNotation`.

* Fix parsing malformed auto declaration starting with `(`

Change preview check to an assert after last commit.
Handle a tuple declaration that doesn't have `=` after the last `)`. The
`peekPastParen(&token).value == TOK.assign` check is not needed because
the `parseInitializer` parameter is true so `check(TOK.assign)` does the
job and provides a good error message if missing.
Add test for malformed auto and non-auto tuple declarations.

* Remove unnecessary preview check
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
```
ntrel added a commit to ntrel/dmd that referenced this pull request Nov 14, 2025
…dlang#7)

* Fix parsing tuple notation without `-preview=tuples`

After dlang#5, without `-preview=tuples`, the parser would cause an assert
error when finding tokens that satisfy `isTupleNotation`.

* Fix parsing malformed auto declaration starting with `(`

Change preview check to an assert after last commit.
Handle a tuple declaration that doesn't have `=` after the last `)`. The
`peekPastParen(&token).value == TOK.assign` check is not needed because
the `parseInitializer` parameter is true so `check(TOK.assign)` does the
job and provides a good error message if missing.
Add test for malformed auto and non-auto tuple declarations.

* Remove unnecessary preview check
ntrel added a commit to ntrel/dmd that referenced this pull request Dec 14, 2025
…dlang#7)

* Fix parsing tuple notation without `-preview=tuples`

After dlang#5, without `-preview=tuples`, the parser would cause an assert
error when finding tokens that satisfy `isTupleNotation`.

* Fix parsing malformed auto declaration starting with `(`

Change preview check to an assert after last commit.
Handle a tuple declaration that doesn't have `=` after the last `)`. The
`peekPastParen(&token).value == TOK.assign` check is not needed because
the `parseInitializer` parameter is true so `check(TOK.assign)` does the
job and provides a good error message if missing.
Add test for malformed auto and non-auto tuple declarations.

* Remove unnecessary preview check
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