# Use AVX instruction

**URL:** <https://forums.unrealengine.com/t/use-avx-instruction/30378>\
**Category:** Feedback & Requests\
**Tags:** unreal-engine\
**Created:** [May 18, 2015, 2:08am UTC](https://forums.unrealengine.com/t/use-avx-instruction/30378 "2015-05-18T02:08:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_589bfbc4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_589bfbc4](https://forums.unrealengine.com/u/anonymous_user_589bfbc4)\
**Post date:** [May 18, 2015, 2:08am UTC](https://forums.unrealengine.com/t/use-avx-instruction/30378/1 "2015-05-18T02:08:43Z")

</div>

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!

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/d/b/8db983e9af8137c60642bd93220f15bc1c6056ae.png)

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/7/8/a7879543af31aabaa601908e2e8478587bd2158f.png)

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/4/b/94b3158275355b87fa5c18fbd652b9e46a54d171.png)  
My request on github: [https://github.com/EpicGames/UnrealEngine/pull/1157](https://github.com/EpicGames/UnrealEngine/pull/1157)

[HR][/HR]

> [@](#):
>
> Здравствуйте, почему вы не хотите по умолчанию использовать AVX инструкции для 64 разрядных процессоров? Простая установка архитектуры в VCToolChain, позволяет использовать почти всю мощь современных процессоров, при этом облегчая жизнь разработчиков, которые не догадываются о таких прекрасных вещах, как AVX/AVX2.
> 
> Все современные процессоры Intel, начиная с IntelКоре Core i3 имеют поддержку SSE4.1/SSE4.2 и AVX
> 
> Ведь это может дать колоссальный прирост в производительности, причем в некоторых местах почти в 10 раз!
> 
> Updated:  
> Например, скорость загрузки редактора выросла почти в 3 раза! С 60 секунд до ~20. Большенство циклов были векторизованы, из за высокой оптимизации UE4

> **[SSE2](https://en.wikipedia.org/wiki/SSE2)**
>
> SSE2 (Streaming SIMD Extensions 2) is one of the Intel SIMD (Single Instruction, Multiple Data) processor supplementary instruction sets introduced by Intel with the initial version of the Pentium 4 in 2000. It extends the earlier SSE instruction set, and is intended to fully replace MMX. Intel extended SSE2 to create SSE3 in 2004. SSE2 added 144 new instructions to SSE, which has 70 instructions. Competing chip-maker AMD added support for SSE2 with the introduction of their Opteron and Athlon...

> **[Advanced Vector Extensions](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions)**
>
> Advanced Vector Extensions (AVX) are SIMD extensions to the x86 instruction set architecture for microprocessors from Intel and Advanced Micro Devices (AMD). They were proposed by Intel in March 2008 and first supported by Intel with the Sandy Bridge processor shipping in Q1 2011 and later by AMD with the Bulldozer processor shipping in Q3 2011. AVX provides new features, new instructions, and a new coding scheme.
> AVX2 (also known as Haswell New Instructions) expands most integer commands to 2...

[HR][/HR]

My request on github: [https://github.com/EpicGames/UnrealEngine/pull/1157](https://github.com/EpicGames/UnrealEngine/pull/1157)

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [May 18, 2015, 3:27am UTC](https://forums.unrealengine.com/t/use-avx-instruction/30378/2 "2015-05-18T03:27:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_589bfbc4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_589bfbc4](https://forums.unrealengine.com/u/anonymous_user_589bfbc4)\
**Post date:** [May 18, 2015, 5:33am UTC](https://forums.unrealengine.com/t/use-avx-instruction/30378/3 "2015-05-18T05:33:24Z")

</div>

> [@;294028](#):
>
> 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](https://software.intel.com/en-us/articles/performance-tools-for-software-developers-intel-compiler-options-for-sse-generation-and-processor-specific-optimizations)

and

[The significance of SIMD, SSE and AVX](http://www.polyhedron.com/web_images/intel/productbriefs/3a_SIMD.pdf)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0dc1700e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0dc1700e](https://forums.unrealengine.com/u/anonymous_user_0dc1700e)\
**Post date:** [August 21, 2015, 4:27pm UTC](https://forums.unrealengine.com/t/use-avx-instruction/30378/4 "2015-08-21T16:27:33Z")

</div>

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.

> **[/arch (x86)](https://learn.microsoft.com/en-us/cpp/build/reference/arch-x86?redirectedfrom=MSDN&view=msvc-170)**
>
> Learn more about: /arch (x86)

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.

---

<div class="post-metadata">

**Author:** ![DaveTheFreak](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DaveTheFreak](https://forums.unrealengine.com/u/DaveTheFreak)\
**Post date:** [April 3, 2025, 8:05am UTC](https://forums.unrealengine.com/t/use-avx-instruction/30378/5 "2025-04-03T08:05:35Z")

</div>

Hey there, I have been experimenting with this for the last few weeks and, at least for compiling, I have found out a few things. Maybe this will help:

> **[UE5: Enable SIMD](https://davesdeveloperblog.blogspot.com/2025/04/unreal-engine-simd.html)**
>
> 1. Build Configuration In order to enable SIMD instructions, besides SSE, for Unreal Engine, the follow entry must first be added to the "\[....
