Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
29th January 2017, 16:56 | #42 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
that's weird...
please modify the source code manually and report back.. line 139: replace Code:
_mm256_store_ps(reinterpret_cast<float *>(&YMMField), _mm256_add_ps(reinterpret_cast<const __m256 &>(srcp[y][x]), YMMField)); Code:
_mm256_store_ps(reinterpret_cast<float *>(&YMMField), _mm256_add_ps(*reinterpret_cast<const __m256 *>(&srcp[y][x]), YMMField)); |
29th January 2017, 18:28 | #44 | Link | ||
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
Quote:
there's something wrong with your compiling settings Quote:
damn, now I get how nice that Visual Studio compiler is (from the user's point of view), I never had any sort of shit like this with Visual Studio... Last edited by feisty2; 29th January 2017 at 18:30. |
||
29th January 2017, 18:37 | #47 | Link |
Pajas Mentales...
Join Date: Dec 2004
Location: Spanishtán
Posts: 496
|
my processor is westmere/ep (+/- nehalem)
with -msse4.1 https://sl1pkn07.wtf/paste/view/9516661b EDIT: with -march=haswell build ok. but i think is incompatible with my processor Last edited by sl1pkn07; 29th January 2017 at 18:40. |
29th January 2017, 18:45 | #48 | Link | |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
Quote:
|
|
29th January 2017, 18:59 | #51 | Link |
Pajas Mentales...
Join Date: Dec 2004
Location: Spanishtán
Posts: 496
|
something like:
Code:
#ifdef VAPOURSYNTH_H static void VS_CC VapourSynthPluginViInit(VSMap *in, VSMap *out, void **instanceData, VSNode *node, VSCore *core, const VSAPI *vsapi) { NLMVapoursynth *d = (NLMVapoursynth*) * instanceData; vsapi->setVideoInfo(d->vi, 1, node); } #endif //__VAPOURSYNTH_H__ but with CPU capabilities EDIT: better example EDIT: that is called conditionals? (sorry, im not coder, idk what is a real name of this) Last edited by sl1pkn07; 29th January 2017 at 21:28. |
29th January 2017, 19:21 | #52 | Link | |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
Quote:
Anyways, it's called conditional compilation and I know how to do it theoretically but still can't do it, because it involves whole lot of compiler-specific macros that are not part of the C++ standard... And since your compilation worked, I assume you figured out how to get yasm to work? And does the compiled binary run correctly? (Checking if the "opt" parameter actually works) |
|
29th January 2017, 19:48 | #53 | Link |
Pajas Mentales...
Join Date: Dec 2004
Location: Spanishtán
Posts: 496
|
about yasm
something like this? Code:
diff --git a/Source.cpp b/Source.cpp index 5409d6e..3dbd174 100644 --- a/Source.cpp +++ b/Source.cpp @@ -1,12 +1,13 @@ -#include "VapourSynth.h" -#include "VSHelper.h" -#include "cpufeatures.hpp" +#include <VapourSynth.h> +#include <VSHelper.h> #include <cmath> #include <cstring> #include <algorithm> #include <immintrin.h> #include <malloc.h> +extern "C++" int CPUFeatures(); + struct FixFadesData final { const VSAPI *vsapi = nullptr; VSNodeRef *node = nullptr; but i get https://sl1pkn07.wtf/paste/view/f32ca689 (takEN (XD) from https://github.com/vapoursynth/vapou...ore/x86utils.h (with this help http://wiki.osdev.org/C%2B%2B_to_ASM_linkage_in_GCC) about of test, give me time |
29th January 2017, 20:00 | #55 | Link |
Pajas Mentales...
Join Date: Dec 2004
Location: Spanishtán
Posts: 496
|
em, is the same as i tried before (only work with -march=haswell)(?)
or you mean convert the cpu.asm to object with yasm* and include it in the linker step? * Code:
yasm -f elf -m ${_m} -DARCH_X86_64=${_darch} -o cpu.o cpu.asm Last edited by sl1pkn07; 29th January 2017 at 21:11. |
30th January 2017, 00:02 | #57 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
Now you see why asm is kinda your friend.
There's a pile of pitfalls here you missed. And some you found. 1. You compile the whole file with avx2/whatever instrction set you selected. That means avx2 instructions may be emitted for you plain C++ code too. Solve it by placing the avx2 code in a separate file and use different compiler settings. 2. You can't put sse and avx intrinsics in the same file either. For example subps can get turned into vsubps to reduce register copies. So then the sse path needs avx too... 3. Cpuid is horrible in intrinsics, that's why I use asm. Lrn2yasm. Or write code that requires gcc or clang where convenient intrinsics are available. Clang is even available as a simple dropin for visual studio nowadays.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
30th January 2017, 05:40 | #59 | Link | ||
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
Quote:
Quote:
no they are not, but I can google this individual function and learn to use it, I can't however google thousands of compiler-specific macros and memorize them all. |
||
30th January 2017, 05:59 | #60 | Link | |
Guest
Posts: n/a
|
Quote:
http://stackoverflow.com/questions/2...ang-with-macro That was the first link in googling "how to detect gcc vs msvc" |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|