www.digitalmars.com         C & C++   DMDScript  

D - asm section

reply "Rui Lopes" <ruidlopes netcabo.pt> writes:
Just a small thought...

Why not provide interfaces to _ANY_ assembler (as86, gas, masm, tasm)
defined in some sort of "compiler inline assembler section configuration
file" ;)

-> assemblers.conf:

  <assembler id="masm">
    <exec>c:\masm\bin\ml.exe</exec>
    <param>-c</param>
  </assembler>

-> test.d:

  .
  .
  .

  version(X86) {
    asm(masm) {
      ...
    }
  }
  version(SparcIII) {
    asm(gas) {
      ...
    }
  }
  else
  {
    ...
  }

  .
  .
  .


Benefits:

-> Inline assembly code easier to port
-> Cutting-edge opcodes are always supported using latest assembler versions
(e.g. Intel's SSE)
Jan 12 2003
next sibling parent "Walter" <walter digitalmars.com> writes:
That would require the D compiler to emit assembler source for everything
else, for feeding to the assembler. It's less work to just build the
assembler right into the compiler, and the result is much faster
compilation, and no bugs due to mismatched assembler/compiler combinations.

"Rui Lopes" <ruidlopes netcabo.pt> wrote in message
news:avsj02$bbi$1 digitaldaemon.com...
 Just a small thought...

 Why not provide interfaces to _ANY_ assembler (as86, gas, masm, tasm)
 defined in some sort of "compiler inline assembler section configuration
 file" ;)

 -> assemblers.conf:

   <assembler id="masm">
     <exec>c:\masm\bin\ml.exe</exec>
     <param>-c</param>
   </assembler>

 -> test.d:

   .
   .
   .

   version(X86) {
     asm(masm) {
       ...
     }
   }
   version(SparcIII) {
     asm(gas) {
       ...
     }
   }
   else
   {
     ...
   }

   .
   .
   .


 Benefits:

 -> Inline assembly code easier to port
 -> Cutting-edge opcodes are always supported using latest assembler
versions
 (e.g. Intel's SSE)
Jan 12 2003
prev sibling parent Theodore Reed <rizen surreality.us> writes:
On Sun, 12 Jan 2003 20:28:27 -0000
"Rui Lopes" <ruidlopes netcabo.pt> wrote:

   version(X86) {
     asm(masm) {
       ...
     }
   }
   version(SparcIII) {
     asm(gas) {
       ...
     }
   }
   else
   {
     ...
   }
I think, rather than do that, asm() should accept the CPU type, and can either use an internal assembler or whatever is available for that arch. -- Theodore Reed (rizen/bancus) -==- http://www.surreality.us/ ~OpenPGP Signed/Encrypted Mail Preferred; Finger me for my public key!~ "We were born with a curse. It has always driven us to thoughts which men may not wish. We know that we are evil, but there is no will in us and no power to resist it. This is our wonder and our secret fear, that we know and do not resist." -- Equality 7-2521, Ayn Rand's Anthem
Jan 13 2003