Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Assembler optimization suggestion

For general discussion related FlowStone

Assembler optimization suggestion

Postby TrojakEW » Sat Jun 25, 2016 3:12 pm

Hi there,
I need some help here from assembler gurus. Have two mono4 inputs. I need to combine them together into:
1 input channel [0]+[2] = out[0]
1 input channel [1]+[3] = out[2]
2 input channel [0]+[2] = out[1]
2 input channel [1]+[3] = out[2]

Here is how I have it now:
Code: Select all
streamin l;
streamin r;
streamout out;

movaps xmm0,l;movaps xmm1,xmm0;
shufps xmm1,xmm1,14;
addps xmm0,xmm1;movaps l,xmm0;

movaps xmm0,r;movaps xmm1,xmm0;
shufps xmm1,xmm1,14;
addps xmm0,xmm1;movaps r,xmm0;

mov eax,l[0];mov out[0],eax;
mov eax,l[1];mov out[2],eax;
mov eax,r[0];mov out[1],eax;
mov eax,r[1];mov out[3],eax;

See also attached schematic.

My question is - Is there better solution for this and avoid packing and using additonal variables? I need to use it few time in code and I want to avoid useless reading and writing to registers.
Attachments
mono4comb.fsm
(1.25 KiB) Downloaded 807 times
User avatar
TrojakEW
 
Posts: 111
Joined: Sat Dec 25, 2010 10:12 am
Location: Slovakia

Re: Assembler optimization suggestion

Postby adamszabo » Sat Jun 25, 2016 4:32 pm

perhaps like this?
Attachments
mono4comb_2.fsm
(1.23 KiB) Downloaded 830 times
adamszabo
 
Posts: 667
Joined: Sun Jul 11, 2010 7:21 am

Re: Assembler optimization suggestion

Postby TrojakEW » Sat Jun 25, 2016 4:56 pm

Yes this is it. Thank you.
User avatar
TrojakEW
 
Posts: 111
Joined: Sat Dec 25, 2010 10:12 am
Location: Slovakia


Return to General

Who is online

Users browsing this forum: No registered users and 44 guests