-
-
Notifications
You must be signed in to change notification settings - Fork 379
orthogonalize MIPS version identifiers #207
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
Conversation
also see the corresponding GDC pull D-Programming-GDC/gdc#39 |
@@ -266,16 +266,15 @@ version($(I identifier)) // add in version code if version | |||
$(TR $(TD $(B PPC_HardFP)) $(TD The PowerPC hard float ABI)) | |||
$(TR $(TD $(B PPC64)) $(TD The PowerPC architecture, 64-bit)) | |||
$(TR $(TD $(B IA64)) $(TD The Itanium architecture (64-bit))) | |||
$(TR $(TD $(B MIPS)) $(TD The MIPS architecture, 32-bit)) | |||
$(TR $(TD $(B MIPS)) $(TD The MIPS architecture)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the 32-bit
? Remember, the 32-bit and 64-bit identifiers are mutually exclusive (as with X86
and X86_64
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's supposed to be always defined, even for MIPS64. This is similar to __mips__
in C and GNU handling them both under the same architecture.
Having separate Identifiers for 32/64 is extremely unhandy and forced me to add boilerplate version = AnyMIPS
everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But on the other hand it will be confusing to D programmers. Because X86
is not defined on X86_64
, people write code like this:
version (X86)
{
32-bit x86 code ...
}
else version (X86_64)
{
64-bit x86 code ...
}
The equivalent code for MIPS would then be wrong.
I get your point about boilerplate but consistency is more important IMHO.
As an alternative, we could have MIPS
, MIPS32
, and MIPS64
. That approach still suffers from the consistency issue but not as much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll add the complementary MIPS32
.
The X86
approach is equally flawed. One third of the version =
statements in druntime join X86_64 and X86. Keeping the current approach doesn't scale, think of this module with 10 more architectures.
We also need orthogonal subsets rather than specialized sets (MIPS_N32_SoftFP
) because nesting version blocks performs an intersection where the latter requires a join.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dawgfoto: +1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't necessarily think the way X86
and X86_64
work is flawed, but I do think our version
system is flawed in any case. The fact that we don't support logical and/or in them is very silly and many people have complained about this, but Walter in particular calls it "too complex" even though there are real use cases... /rant
(I'm not against the changes to the FP ABI identifiers in any way, by the way.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My proposal in bug 7417 would fix the version system without causing the complexity problems. In fact it would reduce complexity.
See comments, otherwise LGTM. |
Also, is the MIPS EABI a separate ABI from O32 and friends? |
Out of curiosity, why does each target have it's own _HardFP/_SoftFP, isn't the generic D_HardFloat/D_SoftFloat identifiers enough? |
@ibuclaw The original reason was that those two don't cover all the possible ABIs used on various archs (e.g. ARM has 3 FP ABIs). In the case of MIPS, though, they may be enough and we could consider getting rid of the MIPS-specific ones. |
Those don't seem to suffice. |
orthogonalize MIPS version identifiers
Yes, but in what situation would the front end language / programmer need |
It would be relevant if you're writing inline assembly, for instance. |
The old identifiers suffered from combinatorial explosion. The new ones are closely modeled after gcc options and predefines and are thus less cumbersome to work with when porting headers.