Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix interpretation of bswap at compile time #648

Closed
redstar opened this issue Jun 28, 2014 · 3 comments
Closed

Fix interpretation of bswap at compile time #648

redstar opened this issue Jun 28, 2014 · 3 comments

Comments

@redstar
Copy link
Member

redstar commented Jun 28, 2014

Check the behavior introduced with pull request #644.

@AlexeyProkhin
Copy link
Member

I agree with @redstar, the commit dc6b400 should be reverted: better to fail to compile some code than to behave incorrectly.
Another quick (and just as dirty) fix for the issue at hand would be to mangle intrinsics as D functions. Although, a proper fix, in my opinion, is to remove LINKintrinsic altogether. By doing that, not only we fix the issue, but also dispose of another ldc-specific frontend patch. However, right now I do not have any concrete proposals as to how exactly it should be done.

@dnadlinger
Copy link
Member

Since our intrinsics can live anywhere (intrinsic-ness is defined by pragma), going by mangled name is a fundamentally limited/broken approach. We should check the FuncDeclaration (llvmInternal/intrinsicName) instead.

redstar added a commit to redstar/ldc that referenced this issue Aug 7, 2014
Uses the llvmInternal member and the intrinsic name to identify an intrinsic.
Implements llvm.bswap, llvm.ctlz and llvm.cttz intrinsics as builtins and remove the core.bitop counterparts.
redstar added a commit to redstar/ldc that referenced this issue Aug 8, 2014
Uses the llvmInternal member and the intrinsic name to identify an intrinsic.
Implements llvm.bswap, llvm.ctpop, llvm.ctlz and llvm.cttz intrinsics as builtins and remove the core.bitop counterparts.

The implementation is complicated by the fact that the overloaded intrinsic name is resolved during code generation.
redstar added a commit to redstar/ldc that referenced this issue Aug 8, 2014
Uses the llvmInternal member and the intrinsic name to identify an intrinsic.
Implements llvm.bswap, llvm.ctpop, llvm.ctlz and llvm.cttz intrinsics as builtins and remove the core.bitop counterparts.

The implementation is complicated by the fact that the overloaded intrinsic name is resolved during code generation.
redstar added a commit to redstar/ldc that referenced this issue Aug 8, 2014
Uses the llvmInternal member and the intrinsic name to identify an intrinsic.
Implements llvm.bswap, llvm.ctpop, llvm.ctlz and llvm.cttz intrinsics as builtins and remove the core.bitop counterparts.

The implementation is complicated by the fact that the overloaded intrinsic name is resolved during code generation.
redstar added a commit to redstar/ldc that referenced this issue Aug 8, 2014
Uses the llvmInternal member and the intrinsic name to identify an intrinsic.
Implements llvm.bswap, llvm.ctpop, llvm.ctlz and llvm.cttz intrinsics as builtins and remove the core.bitop counterparts.

The implementation is complicated by the fact that the overloaded intrinsic name is resolved during code generation.
redstar added a commit that referenced this issue Aug 8, 2014
@redstar
Copy link
Member Author

redstar commented Sep 4, 2014

Fixed with commit b8a75be.

@redstar redstar closed this as completed Sep 4, 2014
redstar pushed a commit that referenced this issue Sep 27, 2014
Issue 11362 - Unit test assertion failure messages not printed
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

No branches or pull requests

3 participants