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

Implement Double type #10

Closed
vtereshkov opened this issue Feb 28, 2020 · 3 comments
Closed

Implement Double type #10

vtereshkov opened this issue Feb 28, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@vtereshkov
Copy link
Owner

Currently XD Pascal supports only one (32-bit) floating-point type, Real, which is equivalent to Single in Delphi. All other types, Single, Double, and Extended, are formally equivalent to this Real. Thus, the actual computation precision is always limited to 32-bit representations.

While the Extended type is not very practical (as it is too large and not portable to non-x87 platforms), the Double type could be really useful. The difficulty is that any procedure parameter or temporary value in XD Pascal is stored in a single 32-bit stack cell or register, and all function results are returned via eax. The introduction of the Double type may destroy this homogeneity.

The alternative approach is to switch to 64-bit code generation (#9) and get the Double type 'out-of-the-box'.

@vtereshkov vtereshkov added the enhancement New feature or request label Feb 28, 2020
@vtereshkov vtereshkov changed the title Double type implementation Implement Double type Feb 28, 2020
@Mazdaywik
Copy link

А закрыто почему? Сделано или лень делать?

@vtereshkov
Copy link
Owner Author

Done. Now XD Pascal correctly solves the N body benchmark problem (though with rather poor performance) and supports GetTime() in Raylib.

@Mazdaywik
Copy link

Можно было в сообщение коммита 94acbc4 добавить #10 и коммит привязался бы к задаче.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants