Assembler code improvements campaign

For general discussion related FlowStone
Post Reply
Exo
Posts: 426
Joined: Wed Aug 04, 2010 8:58 pm
Location: UK
Contact:

Assembler code improvements campaign

Post 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 ;)
Flowstone Guru. Blog and download site for Flowstone.
Best VST Plugins. Initial Audio.
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Assembler code improvements campaign

Post 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.
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Assembler code improvements campaign

Post 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.
Exo
Posts: 426
Joined: Wed Aug 04, 2010 8:58 pm
Location: UK
Contact:

Re: Assembler code improvements campaign

Post 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.
Flowstone Guru. Blog and download site for Flowstone.
Best VST Plugins. Initial Audio.
User avatar
MyCo
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany
Contact:

Re: Assembler code improvements campaign

Post by MyCo »

add

Code: Select all

cvttps2dq
to the list. It's like cvtps2dq but truncates only
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Assembler code improvements campaign

Post 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
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Assembler code improvements campaign

Post by KG_is_back »

I'm already giving it a test. It simplifies some structures significantly (and even makes some possible).
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Assembler code improvements campaign

Post by martinvicanek »

I am having trouble with psrld. Please could somebody post a working example?
User avatar
MyCo
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany
Contact:

Re: Assembler code improvements campaign

Post 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)
Post Reply