Skip to content

Conversation

@thewilsonator
Copy link
Contributor

cc @ibuclaw

Since you were changing the intrinsic detection I thought I’d have one last crack at getting it to work like this.

Rebases #8942

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @thewilsonator! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + dmd#10656"

@thewilsonator thewilsonator force-pushed the intrinsic-op branch 8 times, most recently from 735ed0a to 1ebb8fb Compare December 11, 2019 02:54
@ibuclaw
Copy link
Member

ibuclaw commented Dec 11, 2019

@thewilsonator - thanks, I always get mild irritation whenever I amend this list. ;-)

@thewilsonator
Copy link
Contributor Author

Np problems. Next I suppose is the same thing in builtin.d. This is good to go with approval as it is green. Buildkite (or rather digitalmars.com) is having network issues, and Azure somehow got cancelled.

Copy link
Member

@ibuclaw ibuclaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me.

@rainers
Copy link
Member

rainers commented Dec 11, 2019

I agree this is easier to maintain than the list of mangled names and decoupled op arrays. It is dropping the check for function attributes and arguments, though. Is that unnecessary or can it cause trouble later on?

@thewilsonator
Copy link
Contributor Author

It is dropping the check for function attributes and arguments, though.

Attributes, yes. Arguments, sometimes, when there is no 64-bit version available (either outright, or because we're targeting a 32bit CPU).

Is that unnecessary or can it cause trouble later on?

Modulo availability (described above), I think it is unnecessary. Also it should be easy to add back if for some reason it is determined to be important.

if (op == OPbsf || op == OPbsr ) {
//_D4core5bitop3bsfFNaNbNiNfxZi
// index of x == 26, m == ulong
if (mangleExact(fd)[26] == 'm')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the attributes of core.bitop.bsf change, this might read garbage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I don't like that either, but its much faster than a strcmp and for some reason I couldn't get a type check on fd to do what I wanted: const bool isFirstArgUlong = fd.parameters && (*fd.parameters)[0].type == Type.tuns64;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR already avoids a lot of string comparisons, so I think adding one is fine here. You could implement a small local endsWith to skip the attribute checks.

int op = NotIntrinsic;
fd = fd.toAliasFunc();
const char *name = mangleExact(fd);
if (fd.isDeprecated())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this additional check necessary?

@thewilsonator
Copy link
Contributor Author

@rainers I'll fix those in another PR. No need to keep @ibuclaw waiting.

@thewilsonator thewilsonator merged commit f5f0b68 into dlang:master Dec 11, 2019
@MoonlightSentinel
Copy link
Contributor

MoonlightSentinel commented Dec 12, 2019

This broke Azure pipelines (Windows_VisualD_Debug x64-debug-dmd) and the failure is reproducable locally:

../dmd/generated/windows/release/64/dmd -conf= -g -m64 -O -w -preview=dip1000 -transition=complex -I../druntime\import -unittest -c -ofunittest3.obj std/complex.d
-1073740791: Assertion failed: cast(int)(*e).Ecomsub <= cast(int)(*e).Ecount, file dmd\src\dmd\backend\cgcod.d, line 2491

EDIT: Reduced to std.complex. Debugging output in cgcod.dyields:

el:0000026DD7C1C660 std\complex.d(575) cnt=1 cs=255 var  TYint  __key891

https://github.com/dlang/phobos/blob/e92a0877b7546313733e809f745d2ef216845a9d/std/complex.d#L575-L582

@thewilsonator
Copy link
Contributor Author

#10660

@RazvanN7
Copy link
Contributor

Maybe we should revert this until we come up with a solution? Having our PR pipeline stalled for so long is counter-productive.

@rainers
Copy link
Member

rainers commented Dec 17, 2019

Maybe we should revert this until we come up with a solution? Having our PR pipeline stalled for so long is counter-productive.

The issues of this PR should be fixed by #10665. AFAICT the PR queue is plagued by networking issues.

@WalterBright
Copy link
Member

This caused a regression: https://issues.dlang.org/show_bug.cgi?id=20446

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants