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

More ^^ related improvements. #344

Merged
merged 3 commits into from
Sep 26, 2011
Merged

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Aug 27, 2011

Added constant folding on raised powers of integers in frontend (so don't need to rely on importing std.math).
Handle ^^ array operations in backend (bugzilla6548).

Regards

@donc
Copy link
Collaborator

donc commented Aug 28, 2011

Nice. We will need to add some tests (ctorpowtests.d has the existing ones). Should be enough to have most of them of the form
static assert(2^^8 == 256);

@ibuclaw
Copy link
Member Author

ibuclaw commented Aug 29, 2011

Should I bundle them up into ctorpowtests, or create a new test that doesn't import std.math?

Also, given that (x ^^ 0.5) and x is known at compile time, would it be ok to call eval_builtin(sqrt) directly knowing that it is a compiler builtin and not require to setup a call to .std.math.sqrt?

Was thinking of putting it below here: ibuclaw@411010b#L0R558

Regards

@ibuclaw
Copy link
Member Author

ibuclaw commented Sep 2, 2011

I'll put them into constfold - and ensure that the std.math import only pulls in what it needs.

Will finish this over the weekend.

Regards

@ibuclaw
Copy link
Member Author

ibuclaw commented Sep 11, 2011

On passing, had noticed a typo in checking which value is negative (whoops). Fixed that.

WalterBright added a commit that referenced this pull request Sep 26, 2011
@WalterBright WalterBright merged commit aca624f into dlang:master Sep 26, 2011
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.

3 participants