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

Make DMD work with a struct as the main integral type #6743

Closed
wants to merge 1 commit into from

Conversation

yebblies
Copy link
Member

@yebblies yebblies commented May 6, 2017

@ibuclaw
Copy link
Member

ibuclaw commented May 7, 2017

Seems reasonable, though this is proof of concept by the looks.

@WalterBright
Copy link
Member

What is the purpose of this?

@redstar
Copy link
Contributor

redstar commented May 10, 2017

It is the base of my cent/ucent implementation. As I can't use a cent/ucent I need to use a struct for emulation. This PR introduces the struct only.

@ibuclaw
Copy link
Member

ibuclaw commented May 10, 2017

This is also the case for real_t too - all frontend code interacting with floating point already looks like this.

@@ -465,13 +465,13 @@ extern (C++) MATCH implicitConvTo(Expression e, Type t)
{
if (e.type.isunsigned())
{
const f = real_t(value);
const f = cast(real_t)value;
Copy link
Member

Choose a reason for hiding this comment

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

Potentially casting between two software emulation types, yummy. 😋

@yebblies
Copy link
Member Author

Yes, the intent is to find all uses of implicit construction and conversion where a struct implementing 128bit support can't be dropped in. If we are going to move forward with cent/ucent then this will need to be done, and it will be easier to debug and review without the actual 128bit changes.

@andralex
Copy link
Member

I like this, it's akin to dogofooding. Less magic keeps us all more honest. Any chance this can be revived?

@wilzbach wilzbach added the Review:Orphaned The author of the PR is no longer available and this PR can be adopted by anyone. label Dec 26, 2017
@ibuclaw ibuclaw self-assigned this Dec 26, 2017
@AndrewEdwards
Copy link
Contributor

@ibuclaw @yebblies

Besides being placed on the back-burner and completely forgotten, it is unclear why this PR is still open. @yebblies, please rebase. @ibuclaw, request finalization of review.

@ibuclaw
Copy link
Member

ibuclaw commented Sep 9, 2020

The PR needs to be broken down into manageable pieces. As and if I get round to it. It's important for supporting cent types, and for using GCC types software integer types in GDC.

@ibuclaw
Copy link
Member

ibuclaw commented Dec 14, 2021

Made some headway a number of years ago, rebased the branch on master now.

https://github.com/ibuclaw/dmd/tree/ctinteger

@dkorpel dkorpel added the Review:Phantom Zone Has value/information for future work, but closed for now label Mar 25, 2022
@dkorpel
Copy link
Contributor

dkorpel commented Mar 25, 2022

Closing this considering it is orphaned, and cent/ucent are deprecated now.

@dkorpel dkorpel closed this Mar 25, 2022
@deadalnix
Copy link
Contributor

Reopening this.

Friend don't let friend make completely r*****ed decision such as deprecating cent/ucent. You might as well deprecate D with such a decision, unless you expect people to stop using 64bits CPU any time soon.

@deadalnix deadalnix reopened this Jan 9, 2023
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @yebblies!

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 run digger -- build "master + dmd#6743"

@dkorpel
Copy link
Contributor

dkorpel commented Jan 11, 2023

I understand you're upset that there's no plan to implement cent and ucent, but I don't see how re-opening an abandoned PR accomplishes anything. Perhaps you can make a case for it in the news group, or e-mail Mike Parker and ask if you can discuss this in a monthly Foundation meeting.

@dkorpel dkorpel closed this Jan 11, 2023
@ibuclaw
Copy link
Member

ibuclaw commented Jan 11, 2023

This is work that we're going to do at some point in the future anyway, irrespective of cent/ucent actually being in the language, having internal N-bit emulation of integers at compile-time would make a few things easier - just as we have N-bit emulation of floating point (well, gdc has, sorry to say ldc hasn't, neither dmd but meh)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review:Needs Rebase Review:Needs Work Review:Orphaned The author of the PR is no longer available and this PR can be adopted by anyone. Review:Phantom Zone Has value/information for future work, but closed for now
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants