Skip to content

Attempt to use longdouble_soft everywhere I can see.#14696

Open
maxhaton wants to merge 1 commit intodlang:masterfrom
maxhaton:longdoubleeverywhere
Open

Attempt to use longdouble_soft everywhere I can see.#14696
maxhaton wants to merge 1 commit intodlang:masterfrom
maxhaton:longdoubleeverywhere

Conversation

@maxhaton
Copy link
Member

This does not yet mean that we are truly emulating things yet but this makes it much easier to emulate things when the code to do so is ready.

The fstp fld mixins were wrong for 64 bit linux (at least) and have been changed. Now we see what the test-suite says

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @maxhaton!

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#14696"

@maxhaton
Copy link
Member Author

Slightly apprehensive about windows dmd builds

@maxhaton maxhaton force-pushed the longdoubleeverywhere branch 2 times, most recently from 71ee538 to 55c5fba Compare December 15, 2022 00:13
This does not yet mean that we are truly emulating things yet but this makes it much easier to emulate things when the code to do so is ready.

The fstp fld mixins were wrong for 64 bit linux (at least) and have been changed. Now we see what the test-suite says

Minor change/s have had to be made to enable betterC compilation on older compiler for bootstrapping
@maxhaton maxhaton force-pushed the longdoubleeverywhere branch from 55c5fba to 7852d4b Compare December 15, 2022 03:00
Comment on lines -232 to -239
return "asm nothrow @nogc pure @trusted { mov RAX, " ~ arg ~ "; fld real ptr [RAX]; }";
return "asm nothrow @nogc pure @trusted { lea RAX, " ~ arg ~ "; fld real ptr [RAX]; }";
}
string fstp_arg(string arg)()
{
return "asm nothrow @nogc pure @trusted { lea RAX, " ~ arg ~ "; fstp real ptr [RAX]; }";
}
string fld_parg(string arg)()
{
return "asm nothrow @nogc pure @trusted { mov RAX, " ~ arg ~ "; fld real ptr [RAX]; }";
}
string fstp_parg(string arg)()
{
return "asm nothrow @nogc pure @trusted { mov RAX, " ~ arg ~ "; fstp real ptr [RAX]; }";
}
alias fld_parg = fld_arg;
alias fstp_parg = fstp_arg;
Copy link
Member

@ibuclaw ibuclaw Dec 15, 2022

Choose a reason for hiding this comment

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

You likely are going to have to split this between MSVC and X86 (mov), and Posix x86_64 (lea).

https://d.godbolt.org/z/WzG4qzKT7

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there a gdc friendly equivalent of the version(LDC) code? Don't really want so much inline asm if possible

Copy link
Member

Choose a reason for hiding this comment

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

I think this is equivalent, LDC also accepts it and compiles to the same code.

https://d.godbolt.org/z/aee3asT15

@RazvanN7
Copy link
Contributor

@maxhaton any updates on this?

@maxhaton
Copy link
Member Author

maxhaton commented Dec 21, 2022 via email

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.

4 participants

Comments