Some SSE questions
- KVRAF
- 12555 posts since 7 Dec, 2004
No idea, if the thing crashes on exit you need to use the debugger and find out where. If it is crashing in the heap check routine it means you've probably walked past the end of some buffer.
If you're getting access violation reading zero, which functions are you in when that read occurs?
You're not going to be able to figure out what is happening without running a capable debugger.
If you're mangling the buffers from the host you need to write your own host to test this.
That should be easy to identify, just check the call stack and see which function you're in.
If you're getting access violation reading zero, which functions are you in when that read occurs?
You're not going to be able to figure out what is happening without running a capable debugger.
If you're mangling the buffers from the host you need to write your own host to test this.
That should be easy to identify, just check the call stack and see which function you're in.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
- KVRian
- 1091 posts since 8 Feb, 2012 from South - Africa
As I've said before - TDM is 'non-standard' gcc...camsr wrote:I am using TDM-GCC (MingW64) because, well, it's as close to GCC as I want to get on Windowsmystran wrote: If you get a crash because of stack misalignment then really you have a buggy compiler
In any way - there's an easy way to check if it's the stack that is getting smashed ( are you getting segfaults? ), add -mstackrealign to your compile options, if the problem persists, the problem is not on the stack.
On a slightly related note - most info on SSE talks about data like [y, y[-1], y[-2], y[-3]] , but there is very little info on processing data [w, x, y, z], was wondering how to get simple 4x LFO in the latter data context(?). Any links that describes this 'parallel data' processing in a practical manner would be appreciated.
@camsr - sorry for the slight hijack.
Regards
Andrew
-
- KVRAF
- Topic Starter
- 7402 posts since 17 Feb, 2005
...Annnd That was it. I forgot that buffers may be very small.camsr wrote:Good point. I should also check sampleframes to verify if 4 samples even exists before entering the vector loop.tony tony chopper wrote: You should never assume that your plugin will be asked to processed a 4-sample-aligned length.
-
- KVRAF
- Topic Starter
- 7402 posts since 17 Feb, 2005
Which I think might be why my x64 plugins have problems in some hosts.Ichad.c wrote: As I've said before - TDM is 'non-standard' gcc...
OR it could be I haven't enabled some important VST method that some hosts may rely on.
- KVRAF
- 7894 posts since 12 Feb, 2006 from Helsinki, Finland
The "access violation for address 0" is how at least MSVC debugger shows the alignment faults. With a half decent debugger, ask for the disassembly and you'll see what operation is causing it.
Regarding aligning stuff manually: yeah you can do that, but it doesn't really work in all cases (unless you actually write assembler directly), because compilers can spill temporaries as well (as part of register allocation; it's not too common if you can fit in registers, but it can happen) and this won't work unless the compiler knows how to align stuff on stack.
As for GCC on Windows .. it's kinda like trying to eat noodles with a fork .. sure you can do it, but using chopsticks (=one of the compilers where Windows isn't a second priority hack) would make the experience a lot smoother.
Regarding aligning stuff manually: yeah you can do that, but it doesn't really work in all cases (unless you actually write assembler directly), because compilers can spill temporaries as well (as part of register allocation; it's not too common if you can fit in registers, but it can happen) and this won't work unless the compiler knows how to align stuff on stack.
As for GCC on Windows .. it's kinda like trying to eat noodles with a fork .. sure you can do it, but using chopsticks (=one of the compilers where Windows isn't a second priority hack) would make the experience a lot smoother.
-
- KVRAF
- Topic Starter
- 7402 posts since 17 Feb, 2005
mystran, lol
Newest strange behavior,
Everything works fine now when the plugin is loaded into a mixer track in FL.
But loading it into Patcher, or MuTools MUX, no audio is processed.
MUX gave a warning "User Thread Wait Timeout Error @ REP[12]
Newest strange behavior,
Everything works fine now when the plugin is loaded into a mixer track in FL.
But loading it into Patcher, or MuTools MUX, no audio is processed.
MUX gave a warning "User Thread Wait Timeout Error @ REP[12]
-
- KVRAF
- Topic Starter
- 7402 posts since 17 Feb, 2005
Well, actually -mstackrealign has helped a great deal, but every so often the plugin still crashes on exit, less frequently than before. Must I use the heap and aligned sections?
-
- KVRian
- 1379 posts since 26 Apr, 2004 from UK
You can try Boost.SIMD to let you write proper SSE code on any compiler (provided you check alignment), without having to learn intrinsics or modify your code if you want to upgrade to a different vectorization size.
-
- KVRAF
- Topic Starter
- 7402 posts since 17 Feb, 2005
Yeah Boost is inticing for SIMD. I read they will be integrating it into the standard library! Wondering how that one will work outMiles1981 wrote:You can try Boost.SIMD to let you write proper SSE code on any compiler (provided you check alignment), without having to learn intrinsics or modify your code if you want to upgrade to a different vectorization size.
-
- KVRer
- 4 posts since 7 Dec, 2011
Hi,
You can also have a look on the Agner Fog C++ vector class library. There is a template class which let you implement readable SSE2, SSE3, SSSE3, AVX etc code. Should work on your compiler.
Even debug performance is not so good. Maybe there are some alignment hints also.
You can also have a look on the Agner Fog C++ vector class library. There is a template class which let you implement readable SSE2, SSE3, SSSE3, AVX etc code. Should work on your compiler.
Even debug performance is not so good. Maybe there are some alignment hints also.