www.digitalmars.com         C & C++   DMDScript  

D - inline asm again

reply "Sean L. Palmer" <palmer.sean verizon.net> writes:
Another small problem:  the inline assembler doesn't support the "xmmword
ptr [x]" construct.

movdqa xmm0, xmmword ptr [eax]

I tried dqword ptr also;  no dice.  Is there an alternative or does this
just need added?

Sean
Apr 06 2003
next sibling parent "Serge K" <skarebo programmer.net> writes:
 movdqa xmm0, xmmword ptr [eax]

 I tried dqword ptr also;  no dice.  Is there an alternative or does this
 just need added?

How about "oword" (octa-word), as it was in the VAX assembly?
Apr 07 2003
prev sibling parent reply "Walter" <walter digitalmars.com> writes:
"Sean L. Palmer" <palmer.sean verizon.net> wrote in message
news:b6qldj$km5$1 digitaldaemon.com...
 Another small problem:  the inline assembler doesn't support the "xmmword
 ptr [x]" construct.

 movdqa xmm0, xmmword ptr [eax]

 I tried dqword ptr also;  no dice.  Is there an alternative or does this
 just need added?

movdqa xmm0, [eax]
Apr 07 2003
parent reply "Sean L. Palmer" <palmer.sean verizon.net> writes:
Already found that.  I think it's great that you don't have to use dword ptr
etc;  it's inferred from the register's size.  It's just not standard Intel
asm syntax.  dword ptr works, xmmword ptr doesn't.

I can't think of a reason why you'd ever need the 'byte ptr' syntax anyway.
It's entirely redundant, no?  I guess if you have a macro that moves memory
to memory or something you might need it.

Sean

"Walter" <walter digitalmars.com> wrote in message
news:b6tto4$1bmh$1 digitaldaemon.com...
 "Sean L. Palmer" <palmer.sean verizon.net> wrote in message
 news:b6qldj$km5$1 digitaldaemon.com...
 Another small problem:  the inline assembler doesn't support the


 ptr [x]" construct.

 movdqa xmm0, xmmword ptr [eax]

 I tried dqword ptr also;  no dice.  Is there an alternative or does this
 just need added?

movdqa xmm0, [eax]

Apr 08 2003
next sibling parent reply "Walter" <walter digitalmars.com> writes:
"Sean L. Palmer" <palmer.sean verizon.net> wrote in message
news:b6usdl$22g2$1 digitaldaemon.com...
 Already found that.  I think it's great that you don't have to use dword

 etc;  it's inferred from the register's size.  It's just not standard

 asm syntax.  dword ptr works, xmmword ptr doesn't.

 I can't think of a reason why you'd ever need the 'byte ptr' syntax

 It's entirely redundant, no?  I guess if you have a macro that moves

 to memory or something you might need it.

It's needed to distinguish: cmp [EAX],0 is it a byte, word or dword operation?
Apr 08 2003
parent reply "Sean L. Palmer" <palmer.sean verizon.net> writes:
Ah yes.  Well there are no immediate operands for XMM registers.  So the
only issue really is consistency.

Sean

"Walter" <walter digitalmars.com> wrote in message
news:b6v844$2b4q$1 digitaldaemon.com...
 "Sean L. Palmer" <palmer.sean verizon.net> wrote in message
 news:b6usdl$22g2$1 digitaldaemon.com...
 I can't think of a reason why you'd ever need the 'byte ptr' syntax

 It's entirely redundant, no?  I guess if you have a macro that moves

 to memory or something you might need it.

It's needed to distinguish: cmp [EAX],0 is it a byte, word or dword operation?

Apr 08 2003
parent reply "Walter" <walter digitalmars.com> writes:
The syntax is a poor choice, a better one would have been:

    cmpb [EAX],0
    cmpw [EAX],0
    cmpd [EAX],0

but oh well, the xxx ptr thing is how Intel did it.

"Sean L. Palmer" <palmer.sean verizon.net> wrote in message
news:b708vd$5n$1 digitaldaemon.com...
 Ah yes.  Well there are no immediate operands for XMM registers.  So the
 only issue really is consistency.

 Sean

 "Walter" <walter digitalmars.com> wrote in message
 news:b6v844$2b4q$1 digitaldaemon.com...
 "Sean L. Palmer" <palmer.sean verizon.net> wrote in message
 news:b6usdl$22g2$1 digitaldaemon.com...
 I can't think of a reason why you'd ever need the 'byte ptr' syntax

 It's entirely redundant, no?  I guess if you have a macro that moves

 to memory or something you might need it.

It's needed to distinguish: cmp [EAX],0 is it a byte, word or dword operation?


Apr 09 2003
parent "Sean L. Palmer" <palmer.sean verizon.net> writes:
I agree.  The Motorola way looks nicer.

Out of curiosity, do you have any plans to support SIMD registers as
intrinsic types, with intrinsic functions representing the XMM opcodes?  See
<xmmintrin.h> in the VC6 Processor Pack for an example of how MS/Intel did
it.

I just heard the new SN compiler for PS2 has intrinsics for its SIMD
capabilities.  It seems the right way to handle this stuff.  Then the
compiler can do what it does best... register allocation and pipelining.

The first step is done;  inline asm support for the registers and
instruction types.

The intrinsics are just the second step.  They allow us programmers to
access the low level machine types without resorting to asm any more than we
have to.

The next step is having the compiler emit SIMD automatically thru unrolling
loops or thru array operations.

Sean

"Walter" <walter digitalmars.com> wrote in message
news:b70k2m$8e1$1 digitaldaemon.com...
 The syntax is a poor choice, a better one would have been:

     cmpb [EAX],0
     cmpw [EAX],0
     cmpd [EAX],0

 but oh well, the xxx ptr thing is how Intel did it.

 "Sean L. Palmer" <palmer.sean verizon.net> wrote in message
 news:b708vd$5n$1 digitaldaemon.com...
 Ah yes.  Well there are no immediate operands for XMM registers.  So the
 only issue really is consistency.

 Sean


Apr 09 2003
prev sibling parent "chris jones" <flak clara.co.uk> writes:
you need it for..

movzx eax, [???]

is that a zero extended word or a zero extended byte?

chris




"Sean L. Palmer" <palmer.sean verizon.net> wrote in message
news:b6usdl$22g2$1 digitaldaemon.com...
 Already found that.  I think it's great that you don't have to use dword

 etc;  it's inferred from the register's size.  It's just not standard

 asm syntax.  dword ptr works, xmmword ptr doesn't.

 I can't think of a reason why you'd ever need the 'byte ptr' syntax

 It's entirely redundant, no?  I guess if you have a macro that moves

 to memory or something you might need it.

 Sean

 "Walter" <walter digitalmars.com> wrote in message
 news:b6tto4$1bmh$1 digitaldaemon.com...
 "Sean L. Palmer" <palmer.sean verizon.net> wrote in message
 news:b6qldj$km5$1 digitaldaemon.com...
 Another small problem:  the inline assembler doesn't support the


 ptr [x]" construct.

 movdqa xmm0, xmmword ptr [eax]

 I tried dqword ptr also;  no dice.  Is there an alternative or does



 just need added?

movdqa xmm0, [eax]


Apr 11 2003