Use AVX instruction

Hello, why you do not want to use the default AVX instructions for 64-bit processors? Easy installation architecture VCToolChain, allows the use of almost all the power of modern processors, thus facilitating the lives of developers who have no idea about such wonderful things as AVX / AVX2.

All modern Intel processors starting with Intel Core i3 have the support of SSE4.1 / SSE4.2 and AVX

After all, it can give a huge boost in performance, and in some places up to 10 times!


My request on github: https://github.com/EpicGames/UnrealEngine/pull/1157

[HR][/HR]

[HR][/HR]

My request on github: https://github.com/EpicGames/UnrealEngine/pull/1157

This should be optional architecture as you proposed in last message (i got Q9300 which does not support AVX, so i wish i would able to build SEE2 version without me needed to edit the UBT code).
Also i can’t view your commit, as you pull request are flooded with other commits and i can’t find yours, thats probably because you doing pull request on release branch and all master branch commits of others trying to flood in to it.

Intel’s compiler generates code as the AVX’s instructions, and later (SSE 4/3/2); How does the compiler UE4 - I unfortunately do not know;
Intel® Compiler Options for Intel® SSE and Intel® AVX generation (SSE2, SSE3, SSSE3, ATOM_SSSE3, SSE4.1, SSE4.2, ATOM_SSE4.2, AVX, AVX2, AVX-512) and processor-specific optimizations

and

The significance of SIMD, SSE and AVX

I’m not 100%, but you should be able to set your CPU arch to AVX or AVX2 setting the global CL or CL environment variables.

These env vars are supposed to add the defined switches to every invocation of cl.exe. Add a new env var CL or CL and give it the value /arch:AVX or /arch:AVX2 or whatever else, I also give it the /MP switch, tho that can cause problems.

Note that you will need a Bulldozer, Sandy Bridge or Haswell to run these executables.

Tho, I’m not 100% because I’m not sure what happens if the CL var appends /arch:AVX then UBT appends say /arch:SSE3 . I’m sure it’s documented, I think the superseding (/arch:avx2 also enables SSE/2/3/4/AVX instructions) arch is used, but don’t quote me on that.

Note that the default mechanism, the C++ properties page doesn’t exist for UE4 projects, UBT invokes the cl.exe command, not Visual Studio, thus my suggestion to use CL and CL global env vars and AVX2 SSE4 or AVX etc preproessor macros to alter all invocations of cl.exe, (in theory) invoked by UBT and otherwise.

I don’t have the skill to read the executable in a hex editor, but If someone knows of a tool to check what arch a program is compiled for I’d love to check into it.