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
Issue 8425 - Missing line number and module name that can't use core.simd #2879
Conversation
GCC has a |
Lazy man's implementation (can be done much better)
|
The question is: What does |
I thought D_SIMD meant that __simd is available (that's what I agreed with when I raised my concerns with core.simd, that is what I last recall reading in the spec). |
Do we really want to be emitting errors from Target? |
No we don't. :) Ideally those three errors should be squashed into one if possible. |
How about this? Multiple, specific errors, determined by Target. |
We can do that, now I'm just not sure about your test in testxmm.d and D_SIMD definition: |
I don't understand? |
Doesn't |
Yes. Is that a problem? |
The point of Evidently the spec needs more clarification. ;-) |
Hmm ok. How do you tell if |
Hmm... the problem is that is an over generalised question. There's no version condition for each possible |
You could however make assumptions on |
Ok, that's what I was thinking. But in that case - what should I use to version the aliases in core.simd? (In a way that will be non-dmd compatible) |
That is a good question - since I implemented vector support (literally hours after Walter added front-end support) I have not cared about hardware support, as gcc can safely emulate most vectors in the most natural way for the target. |
This is tricky. Do you add |
I believe I said this during my talk, I accidentally committed support for 8 and 32-byte vectors before at least 32-byte vectors were supported by dmd. D-Programming-GDC/gdc@018fb6d#diff-8f1c174f0ba2889fb08f2f7e8a287f4aL3435 Someone noticed and it's been left this way ever since. DMD doesn't support the 8 byte vectors, and has limited support for 32 byte vectors. But I don't think it will be a problem leaving it as is, the compiler (should) only error if you actually try to use the type. |
No, the compiler will error as soon as it runs semantic on the alias. |
then how does the dmd get away with defining 32 byte aliases in core.simd and not running into problems for non-supported platforms? |
unless of course it doesn't try to compile core.simd... :o) |
Because currently, the error is in the glue layer. This pull moves it into semantic. |
ah ha hmm... Maybe go down door number three and request that lack of hardware support be downgraded to a warning? |
This would be:
Also, we need an enum for these numbers |
I don't think a warning will do it. The compiler need to tell you "don't use this type, I can't generate code for it". Heh, could always do |
That is what |
I don't see how that helps anything. |
With LDC, vector types are always valid. If there is no hardware support then the operations are simulated. I know that this is somewhat against the spirit of the vector types in D. But there is no real way to find out which backend supports which instructions. |
I'm leaning toward just doing |
Doesn't work, maybe can't work. It's trying to move a glue error into the frontend, which would be fine, except this error is really just a limitation of the dmd backend and not a real language error. I'm hoping a solution will come to me, but it doesn't seem to be working. |
redping |
Hmm, if |
Someone needs to get on Issue 8728. |
I agree, the preference would be For clarification, is it correct that D_SIMD refers only to __simd (as I understand it?). That should be clarified in the spec... @ibuclaw @klickverbot From the bottom of the spec, there is a bunch of info supposedly for x86 and x64 showing supported types, and also supported operations on those types. |
Yeah. I'm leaning towards just doing it and letting the error message suck. You only see it if you use |
I just tried something like this:
But I was surprised to find that:
doesn't work. It complains
Why doesn't the default template arg allow omission of the template argument list? |
Because then there's no way to refer to the template symbol. It would be quite useful in this case though. |
OT: That's the reason? Hmm, surely that's surmountable... what are some common uses to reference the template symbol rather than an instantiation? I can't imagine very many uses for that case, perhaps that should require some special syntax to be explicit, given it's the rare case? |
dlang/druntime#795 will fix the druntime failure |
Needs dlang/phobos#2490 |
c4917c5
to
f70159a
Compare
Finally green! |
Auto-merge toggled on |
Issue 8425 - Missing line number and module name that can't use core.simd
Great work @yebblies! |
Fix-up for pull rqeuest dlang#2879.
Why all lower-case and the magic integer constants instead of an enum? |
@AndrejMitrovic Thanks! |
Could always raise a new pull to fix that. |
Fix the line number, fix
is(__vector(XXX))
, fix-o-
@ibuclaw @redstar @klickverbot
How should I fix it so it works for compilers that support more than x86?
Do you need more fine-grained support variables or what?
https://d.puremagic.com/issues/show_bug.cgi?id=8425