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

Bool Help Please

For general discussion related FlowStone

Bool Help Please

Postby BobF » Wed Sep 23, 2015 8:43 pm

Bool Help.fsm
(51.64 KiB) Downloaded 728 times

Hello Gang,

Again I need a little help! Why does the 7 input (or lower) AND gate work, but 8 or more inputs do NOT. This is probably something really simple , yes?

At this time I need the 8 input AND gate to work for me.

Many thanks in advance!

Later then, BobF.....
BobF
 
Posts: 598
Joined: Mon Apr 20, 2015 9:54 pm

Re: Bool Help Please

Postby KG_is_back » Wed Sep 23, 2015 9:00 pm

It is a limitation of the DSP code - you can't have more than 8 operations in the same line. It is explained in the manual... Just put few parentheses between the and statements.
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Bool Help Please

Postby Nubeat7 » Wed Sep 23, 2015 10:16 pm

the reason for it is that the dsp code gets translated to assembler code where it produces a lot of (often unneeded) register movings
Code: Select all
movaps xmmB,xmmA
, after you only have 8 registers it gets fucked up when you do more then 8 operations in a row..

connect a text primitive to the "c" output of the dsp code primitive and you will find
Code: Select all
xmm999
which shows you that you are out of the valid registers 0-7

make the parentheses KG assumed and watch again, now only the registers from xmm0-xmm7 are used and it works

further you can copy the text code into an assembler code primitive and optimize it, there you can get rid of the most movaps and end up like this
Code: Select all
streamin in1;streamin in2;
streamin in3;streamin in4;
streamin in5;streamin in6;
streamin in7;streamin in8;

streamout out;

float F1=1;

movaps xmm0,in1;
andps xmm0,in2;
andps xmm0,in3;
andps xmm0,in4;
andps xmm0,in5;
andps xmm0,in6;
andps xmm0,in7;
andps xmm0,in8;
cmpps xmm0,F1,0;
movaps xmm1,F1;
andps xmm1,xmm0;
movaps out,xmm1;


with this version of the code you can add as many inputs you want with just appending the
Code: Select all
streamin inX;
and
Code: Select all
andps xmm0,inX;
before the cmpps...

if the chain is very long it maybe would make sense to use more registers to check up to 7 groups in parallel for faster processing.
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna


Return to General

Who is online

Users browsing this forum: No registered users and 71 guests