Skip to content

Conversation

redstar
Copy link
Member

@redstar redstar commented Apr 2, 2013

Shifting of vectors is a common operation. This extensions supports shifting a vector by an integral type or another vector.

Shifting of vectors is a common operation. This extensions supports
shifting a vector by an integral type or another vector.
@dnadlinger
Copy link
Member

IIRC you filed a Bugzilla issue about this in the meantime – could you please add a reference to it here?

@redstar
Copy link
Member Author

redstar commented Apr 4, 2013

DMD enhancement request is here: http://d.puremagic.com/issues/show_bug.cgi?id=9860

@redstar
Copy link
Member Author

redstar commented Apr 4, 2013

The discussion on the mailing list revealed the following:

  1. Only the operations which map directly to native instructions are allowed.
  2. Generation of "workaround" code is disallowed.

The consequences of 1) are:

  • It is a dauting task to collect the allowed operators. The missing support for the shift operator can be a sign of this complexity.
  • The x86_64 SSE SIMD model is hard-coded into the semantic pass. Even modern approaches like AVX/AVX2 are not supported by this model.

The consequences of 2) are that the LDC implementation is incomplete (we do not support all legal operators) and at the same time is not legal D because LLVM generates "workaround" code.

What I like to do is to extend the frontend to support vector types in all arithmetic operations (guarded by a -extended-simd switch) and use this to disprove the "100x times slower" argument from Walter (at least on average). I still have this paper on mind which reports only an increase of 15% compared to hand-coded assembler.
Since LDC does not the support the DMD SIMD implementation anyway (the "map the assembler opcode directly to D") I think that causes no harm.

I also feel the requirement to allow only the operations supported by the hardware is not possible to implement. It would require a decision matrix index by operator, type, target cpu and enabled features.

What do you think about it?

@dnadlinger
Copy link
Member

Huh, I was pretty sure I already responded to this? So, here we go again:

I'm a bit weary of actually changing the language on a compiler-dependent basis, because those changes tend to cause more harm than good in the long run. So, the safest way would just be to implement the functionality in the library (e.g. ldc.simd). However, on the other hand, as you said vector types are somewhat special already, and differ in implementation between the various DMD taret platforms. Thus, I'm rather torn on this one…

@dnadlinger
Copy link
Member

Kai, you are at the wheel here.

@redstar
Copy link
Member Author

redstar commented May 9, 2013

As discussed at DConf I close this pull request and try to get the change integrated into DMD.

@redstar redstar closed this May 9, 2013
redstar pushed a commit that referenced this pull request Sep 27, 2014
Fix issue #5593 - add dladdr, dlvsym, and Dl_info to core.sys.posix.dlfcn.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants