www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Using an external Assembler with D

reply solidstate1991 <laszloszeremi outlook.com> writes:
In order to make one of my own code more readable (and hopefully 
to avoid a lot of compiling errors under LDC, which don't happen 
in DMD for some reason), I'm planning to put my assembly 
functions into separate files for each system that needs them, 
mainly due to the lack of proper SIMD support, mainly due to 
these functions are relatively easy to implement. Here's a few 
questions of mine:

- Can I return vectors in XMM registers and accept arguments as 
vectors in them?
- How much is the D ABI differs on DMD and LDC for x86? I'm 
planning to support both (with mainly using DMD as a debug 
compiler for its speed), and want the most universal solution 
possible.
Apr 24 2018
parent reply Stefan Koch <uplink.coder googlemail.com> writes:
On Tuesday, 24 April 2018 at 21:02:07 UTC, solidstate1991 wrote:
 In order to make one of my own code more readable (and 
 hopefully to avoid a lot of compiling errors under LDC, which 
 don't happen in DMD for some reason), I'm planning to put my 
 assembly functions into separate files for each system that 
 needs them, mainly due to the lack of proper SIMD support, 
 mainly due to these functions are relatively easy to implement. 
 Here's a few questions of mine:

 - Can I return vectors in XMM registers and accept arguments as 
 vectors in them?
 - How much is the D ABI differs on DMD and LDC for x86? I'm 
 planning to support both (with mainly using DMD as a debug 
 compiler for its speed), and want the most universal solution 
 possible.
Pass stuff on the stack ;) and use extern (C) functions.
Apr 25 2018
parent reply solidstate1991 <laszloszeremi outlook.com> writes:
On Wednesday, 25 April 2018 at 15:25:42 UTC, Stefan Koch wrote:
 Pass stuff on the stack ;)
 and use extern (C) functions.
Thanks! What about extern (D)? Is there a big chaos in the D ABI under x86?
Apr 25 2018
parent Stefan Koch <uplink.coder googlemail.com> writes:
On Wednesday, 25 April 2018 at 20:31:46 UTC, solidstate1991 wrote:
 On Wednesday, 25 April 2018 at 15:25:42 UTC, Stefan Koch wrote:
 Pass stuff on the stack ;)
 and use extern (C) functions.
Thanks! What about extern (D)? Is there a big chaos in the D ABI under x86?
I think the D abi is not actually properly spec'd. But I may be wrong about that.
Apr 26 2018