🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #14990

SSE/Assembler/BCB5 - Problems

#14990
From: JMM
Date: Fri, 25 Jul 2003 10:50
45 lines
2140 bytes
Hi,

hope anyone can help me. I'm trying to speed up my
application via assembler inlines. MMX is supported,
but not SSE. Trying to work with xmm0 and so on the BCB throws several
errors. Using .mmx doesn't help. Interesting the same code in VC++7 works!
But Borland claims that BCB5 supports SSE. Please help me and thanks in
advance.

here's a small example that works (at least in VC++7):

void blahblah()
{
  float a[]={ 1.0, 2.0, 3.0, 4.0,
     5.0, 6.0, 7.0, 8.0 };
  float b[]={ 1.0, 2.0, 3.0, 4.0,
       1.5, 2.5, 3.5, 4.5 };
  float c[8];

 __asm {
  push esi
  push edi
  mov edi, a ; Address of A
  mov esi, b ; Address of B
  mov edx, c ; Address of C
  mov ecx, 2 ; Counter

  L1:      ; Set up for loop
  movaps xmm0, edi ; Load from A
  movaps xmm1, esi ; Load from B
  mulps xmm0, xmm1 ; Multiply
  movaps edx, xmm0 ; Store into C
  add edi, 16 ; Incr. ptr to A
  add esi, 16 ; Incr. ptr to B
  add edx, 16 ; Incr. ptr to C
  sub ecx, 1 ; Decr. counter
  jnz L1 ; Loop if not done

  pop edi
  pop esi
 }
}

ciao,
johann
Technical Details
Message-ID: <3f210afd$2@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!priapus.visi.com!hermes.visi.com!news-out.visi.com!petbe.visi.com!in.100proofnews.com!in.100proofnews.com!news-xfer.cox.net!peer01.cox.net!cox.net!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,a24086449ffcc1f8,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-25 04:04:31 PST
From: "JMM" <westworld@web.de>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: SSE/Assembler/BCB5 - Problems
Date: Fri, 25 Jul 2003 12:50:55 +0200
Lines: 48
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 213.6.255.248
Message-ID: <3f210afd$2@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1059130109 213.6.255.248 (25 Jul 2003 03:48:29 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!priapus.visi.com!hermes.visi.com!news-out.visi.com!petbe.visi.com!in.100proofnews.com!in.100proofnews.com!news-xfer.cox.net!peer01.cox.net!cox.net!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail