SynthMaker

SSE registers

Archive · 2007 7 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

TheAudiophileDutchman ·

Let's talk Assembler today: 😉

Is it possible to keep register values in place when moving from stage0 to stage1 while using the assembler module? This would be very benefical for efficient precalculation of values and more important: keeping them out of the inner loop!! (what about push/pop for SSE regs?). To the Devs: what is in general the overhead of a single assembler module? I'm asking this because the speed gain of relatively short assembler code seems limited (as reported before by others).

Simple example:

float x=3.14;

stage0: movaps xmm0,x;

stage1: movaps xmm1,xmm0; // xmm1 expected to be 3.14

Something else: a simple instruction I would like to see is

xorps xmm0,xmm0

instead of having to declare a variable first:

float ZERO=0.0; movaps xmm0,ZERO;

infuzion ·

I think the point of the different stages is that they are independent of each other. I may be wrong though.

matti ·

TheAudiophileDutchman wrote: Let's talk Assembler today: 😉

Is it possible to keep register values in place when moving from stage0 to stage1 while using the assembler module? This would be very benefical for efficient precalculation of values and more important: keeping them out of the inner loop!! (what about push/pop for SSE regs?). To the Devs: what is in general the overhead of a single assembler module? I'm asking this because the speed gain of relatively short assembler code seems limited (as reported before by others).

Simple example:

float x=3.14;

stage0: movaps xmm0,x;

stage1: movaps xmm1,xmm0; // xmm1 expected to be 3.14

The problem with your suggested register value keeping is that this is not the only code the processor needs to run. So when it initializes the code and calculates the stage0 and runs the stage1 once(or the amount of the buffer perhaps?) it continues with other code parts(or other programs running in the background that might use the xmm registers). So you can't rely on your computer to keep the register values intact.

TheAudiophileDutchman ·

I see, and as far as I know for SSE, there is no (easy) way to push/pop all SSE-regs to/from the stack (similar to a pusha/popa in x86-asm)... 🙁 😉

infuzion ·

...but you can transfer numbers back & forth between SSE & x86 registers; that is how sin1() etc works. Has anyone tried that?

TheAudiophileDutchman ·

.....the SM implementation of SIN1() unfortunately uses a *load of FPU instructions (actually repeated 4x). Wouldn't a combination of MOVSS and SHUFPS SSE-instructions be possible? 😇

By the way, I also miss a more flexible way of declaring variables in 128-bit mem like 4x32bit floats e.g. x= 1.0 | 2.0 | 3.0 | 4.0 instead of only x=1.0 which yields x= 1.0 | 1.0 | 1.0 | 1.0

matti ·

TheAudiophileDutchman wrote: .....the SM implementation of SIN1() unfortunately uses a *load of FPU instructions (actually repeated 4x). Wouldn't a combination of MOVSS and SHUFPS SSE-instructions be possible? 😇

By the way, I also miss a more flexible way of declaring variables in 128-bit mem like 4x32bit floats e.g. x= 1.0 | 2.0 | 3.0 | 4.0 instead of only x=1.0 which yields x= 1.0 | 1.0 | 1.0 | 1.0

The point of having the float[4] to have all it's internals as the same, is to do with the polyphonic usage of the SSE in SM. If you'd have a way to declare all the four floats inside a "packed 128bit register" the polyphony trick couldn't be used.

But if you need to have four different values you can use the "pack" primitive and connect four different float primitives to it's mono inputs.. and then connect that to a code components stream input. I'm not sure how much this affects the cpu usage, but i haven't noticed big problems with it myself.

Oh yeah and i forgot to mention that you can use this only in mono things.. not in polyphonic synth stuff.

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.