Page 1 of 1

Assembler code improvements campaign

Posted: Tue Oct 21, 2014 9:02 pm
by Exo
Assembler is great for writing fast DSP code it can do many things that DSP code cannot and enables some great optimizations.

I think if we can get the devs to implement some more opcodes and improvements then the Assembler component can reach its full potential. And with the ability to Write our own functions then we would be on to a real winner.

These improvements will keep us audio/DSP geeks happy and if we get the ability to write our functions for DSP code then we can also extend its abilities for the community.

Here I want to focus on extending the Assembler component with more opcodes. Writing functions is a major wish of mine but it will obviously require a lot more work than adding more opcodes.

So far the wanted/needed opcodes are......

Code: Select all

PSRLD xmm1, xmm2/m128   
Shift doublewords in xmm1 right by amount specified in xmm2/m128 while shifting in 0s.
(Would be handy for some IEE 754 trickey in log and exp approximations)

PMULUDQ xmm1, xmm2/m128   
Multiply packed unsigned doubleword integers in xmm1 by packed unsigned doubleword integers in xmm2/m128, and store the quadword results in xmm1.
(Useful for linear congrugential random number generator)

PADDD xmm1, xmm2   
Add packed doubleword integers from xmm2/m128 and xmm1.
(Current implementation only supports PADDD xmm1, m128)

SUB reg,reg/var32
Subract integer

PSUBD xmm0,xmm1/m128
Subtract packed integers

Other fixes improvements...

The long standing ANDNPS syntax colouring bug (all code goes black after this opcode but it works)

...............

Please post any opcodes or improvements you would like to see implemented. Only for Assembler though we can focus on DSP code later in another thread ;)

Re: Assembler code improvements campaign

Posted: Wed Oct 22, 2014 6:23 pm
by KG_is_back
maybe also unconditional jump ( jmp; ) would be cool. Not that we can't live without it (there is a simple workaround to mimic it) but it's really a basic opcode, I think.

Re: Assembler code improvements campaign

Posted: Tue Dec 23, 2014 5:19 pm
by KG_is_back
:( still no luck... No new opcodes, no coloring bugfixes... In fact I think I have found a new one. "sub reg,reg;" is colored as valid opcode, yet it doesn't work.

Re: Assembler code improvements campaign

Posted: Tue Dec 23, 2014 6:04 pm
by Exo
KG_is_back wrote::( still no luck... No new opcodes, no coloring bugfixes... In fact I think I have found a new one. "sub reg,reg;" is colored as valid opcode, yet it doesn't work.


Yes I forgot to remind him about this, and wasn't expecting another release before Christmas.

Re: Assembler code improvements campaign

Posted: Tue Dec 23, 2014 7:02 pm
by MyCo
add

Code: Select all

cvttps2dq
to the list. It's like cvtps2dq but truncates only

Re: Assembler code improvements campaign

Posted: Fri Apr 24, 2015 10:56 pm
by martinvicanek
Version 3.0.8 SKYLARK

LIST OF NEW OPCODES

psrld xmm, xmm / xmm, var
pmuludq xmm, xmm / xmm, var
paddd xmm, xmm
sub reg, reg / reg, var
psubd xmm, xmm / xmm, var
jmp label / int
mulpd xmm, xmm / xmm, var
xorps xmm, xmm / xmm, var
andnps xmm, xmm
movd xmm, reg / xmm, var / var, xmm
movss xmm, var / var, xmm / xmm, xmm
cvttps2dq xmm, xmm / xmm, var

You can also now use ebx, ecx and edx in the following opcodes:

add reg, reg
add reg, var
sub reg, reg

:D

Re: Assembler code improvements campaign

Posted: Fri Apr 24, 2015 11:38 pm
by KG_is_back
I'm already giving it a test. It simplifies some structures significantly (and even makes some possible).

Re: Assembler code improvements campaign

Posted: Sat Apr 25, 2015 7:59 am
by martinvicanek
I am having trouble with psrld. Please could somebody post a working example?

Re: Assembler code improvements campaign

Posted: Sat Apr 25, 2015 8:25 am
by MyCo
yeah, seems like it's not working. Its opcode is:
66 0F D2
whitch would mean:
PSRLD xmm1, xmm2/m128

I guess it should be more like the pslld version anyway (with a constant, rather than a register / variable)