MSCOFF32: remove dependency on druntime for long divisions#7261
MSCOFF32: remove dependency on druntime for long divisions#7261dlang-bot merged 1 commit intodlang:masterfrom
Conversation
|
Thanks for your pull request, @rainers! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
src/ddmd/backend/cod1.c
Outdated
| s = symboly("_ms_aullrem", ALLREGS); | ||
| cinfo->retregs32 = mDX|mAX; | ||
| // use implementation in rt.llmath | ||
| s = symboly("__ULDIV__", mAX|mBX|mCX|mDX); |
There was a problem hiding this comment.
@WalterBright : the OpenBSD/Solaris version calls the signed version instead, seems like a typo. see https://github.com/dlang/dmd/blob/master/src/ddmd/backend/cod1.c#L1995
|
Unfortunately, this will fail with -betterC, which doesn't link with druntime. Perhaps add a check for -betterC to determine which to call? |
|
Having the same object file format is only part of the battle. Each C compiler is different in how they connect to their respective runtime libraries. The only viable solution is to add switches. |
It will fail right now, too, as the
This is about symbols in the VC runtime that are not available via dynamic linkage. An alternative would be to use |
|
Changed the calls to directly invoke the VC runtime functions. This now actually removed the dependency on druntime for long divisions for better-C. It doesn't help replacing the C runtime, though. I've added the division functions from rt.llmath to my stub instead. |
by calling div/mod functions from the VC runtime directly.
The ms* functions in rt.llmath can be removed if this is merged.
As we don't have an autotester for -m32mscoff: tests pass locally, but the dmd testsuite doesn't seem to exercise it that much. A bad version failed the druntime unittests, though.