Can I use SSE2 extention in RadAsm??
If I can PLEEEEAASE tell me how:)) I've to use XMMS and a few SSE2 Instruction in my project : "Optimalizing in Large Arrays Addition"...
Posted on 2003-05-17 12:07:41 by marcio
and why in masm.ini there is only 4 XMM registers (XMM0 XMM1 XMM2 XMM3), while there is 8 of them:)??
and ther is almost non of SSE2 instruction?? I want only MOVNTDQ, MOVDQA, MOVDQU:grin: :grin: :grin:
Posted on 2003-05-17 12:27:08 by marcio
Please add them and post your changes for the rest.
I've done some, but don't use SSE, yet.
Posted on 2003-05-17 13:05:01 by bitRAKE
RadASM is an IDE and editor it does not compile or assemble anything so it does not "support" any registers at all or any instructions. The table you see in Masm.ini is governed by the Keyword editor and you can add "Gobbledy-Gook" and it will be highlighted. If you wish to have RadASM syntax highlight your SSE registers add them to a Keyword list using the Keyword Editor found in the Options menu. See the Customizing RadASM / Keywords section of the Help file for more information on how to do this. In all cases if your assembler can hadle them then RadASM handles them, in the case of MASM it already does (V7)

Generally Registers are kept in group #00
Posted on 2003-05-17 14:14:26 by donkey
Thx for understanding ... i'm not very good at low level languages .... yet:grin:


Codito Ergo Sum my brothers!!:alright: :alright: :alright:
Posted on 2003-05-17 16:42:46 by marcio
No probs marcio, that's why we're here :)
Posted on 2003-05-17 17:48:56 by donkey
it's me again:)

I've done everything what you say: in keywords adding menu i've added XMM4 ... XMM7, and in section C5 - ;XMM/K3D Instructions: MOVDQA, MOVDQU and MOVNTDQ ... and this is what assembler shows me:

Assembling: optymalizacja.asm
optymalizacja.asm(430) : error A2008: syntax error : xmm
optymalizacja.asm(431) : error A2008: syntax error : xmm
optymalizacja.asm(433) : error A2008: syntax error : xmm
optymalizacja.asm(434) : error A2008: syntax error : xmm
optymalizacja.asm(436) : error A2008: syntax error : xmm
optymalizacja.asm(437) : error A2008: syntax error : xmm
optymalizacja.asm(439) : error A2008: syntax error : xmm
optymalizacja.asm(440) : error A2008: syntax error : xmm
optymalizacja.asm(443) : error A2008: syntax error : [
optymalizacja.asm(444) : error A2008: syntax error : [
optymalizacja.asm(445) : error A2008: syntax error : [
optymalizacja.asm(446) : error A2008: syntax error : [
optymalizacja.asm(501) : error A2006: undefined symbol : IDC_BUTTON1
optymalizacja.asm(502) : error A2006: undefined symbol : przycisk1

Make error(s) occured.

and this is procedure where this errors occured:



alg7 proc SRC1: DWORD, SRC2: DWORD, DEST: DWORD, LENGHT: DWORD

;this function alloc "LENGHT" bytes to 3 arrays
;lpSrc1, lpSrc2, lpDest - ptrs to first elements of this 3 arrays
invoke Alloc, LENGHT
mov esi, [lpSrc1]
mov ebx, [lpSrc2]
mov edi, [lpDest]

mov ecx, LENGHT ;lenght of array in bytes
shr ecx, 2 ;number of DWORDS in array - LENGHT/4

lea esi, [esi+ecx*4]
lea ebx, [ebx+ecx*4]
lea edi, [edi+ecx*4]

neg ecx

addloop:
movdqa xmm0, [esi+ecx*8] ; <------ 430 LINE ... 16 bytes of fitst array to xmm0
movdqa xmm1, [ebx+ecx*8] ; 16 bytes of second array to xmm1
paddd xmm0, xmm1 ; add packed dword
movdqa xmm2, [esi+ecx*8+16]
movdqa xmm3, [ebx+ecx*8+16]
paddd xmm2, xmm3
movdqa xmm4, [esi+ecx*8+16]
movdqa xmm5, [bx+ecx*8+16]
paddd xmm4, xmm5
movdqa xmm6, [esi+ecx*8+24]
movdqa xmm7, [ebx+ecx*8+24]
paddd xmm6, xmm7

movntdq [edi+ecx*8], xmm0 ;store in Dest array
movntdq [edi+ecx*8+8], xmm2
movntdq [di+ecx*8+16], xmm4
movntdq [edi+ecx*8+24], xmm6



add ecx, 8
jnz addloop

;my proc to free alloced memory
invoke FreeMem, lpSrc1, lpSrc2, lpDest

ret
alg7 endp



what i'm doing wrong?? maybe i should include some other "magic" .inc files ...
my include section

include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
Posted on 2003-05-18 06:24:47 by marcio
Did you tell the assembler you are using SSE2?
.XMM
By adding the words to the list you are only telling the editor that you'd like the words to look pretty. MASM is color blind. :)
Posted on 2003-05-18 09:58:50 by bitRAKE
Of course i told ... i tell even more ... .686 and .XMM :tongue:
Posted on 2003-05-18 10:24:07 by marcio
Try using CAPS for the registers XMM0, XMM1, etc... I had a problem where MASM would only take capital letters for these and MMX registers, but it appears to be fixed now - I don't remember what fixed it. I using:
	.686p

.MMX
.K3D
.XMM
...with MASM 7.0

The only error I got from your PROC is "cannot mix 16-bit and 32-bit registers."
		movntdq [di+ecx*8+16],	xmm4
...this is wrong, must use EDI.
Posted on 2003-05-18 11:04:25 by bitRAKE
Niether the include files nor RadASM is causing this problem. I suspect that the version of the assembler you are using may not support SSE. What is the version number returned from ML.EXE ? I copied and pasted your code with ML.EXE v7 :

.686
.XMM
.model flat, stdcall
option casemap:none

the errors I got were :

Assembling: TestDialog.asm
TestDialog.asm(289) : error A2082: cannot mix 16- and 32-bit registers
TestDialog.asm(297) : error A2082: cannot mix 16- and 32-bit registers

Make error(s) occured.

The errors were the result of these lines :
movdqa xmm5, [bx+ecx*8+16]
movntdq [di+ecx*8+16], xmm4
Posted on 2003-05-18 11:12:54 by donkey
Thx again ... where can i get this version of masm??
Posted on 2003-05-18 14:34:42 by marcio
I already have it ... but BIIIIIG thx:)
Posted on 2003-05-18 14:38:29 by marcio