ArticleslgStudy

computer science

Advanced Vector Extensions

Advanced Vector Extensions is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Advanced Vector Extensions rather than just read about it. In short: Advanced Vector Extensions (AVX, also known as Gesher New Instructions and then Sandy Bridge New Instructions) 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 microarchitecture shipping in Q1 2011 and later by AMD with the Bulldozer microarchitectur…

Key takeaways

  • Advanced Vector Extensions belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Advanced Vector Extensions to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Advanced Vector Extensions from memory before moving on to harder problems.

Reference excerpt

Advanced Vector Extensions (AVX, also known as Gesher New Instructions and then Sandy Bridge New Instructions) 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 microarchitecture shipping in Q1 2011 and later by AMD with the Bulldozer microarchitecture shipping in Q4 2011. AVX provides new features, new instructions, and a new coding scheme. AVX2 (also known as Haswell New Instructions) expands most integer commands to 256 bits and introduces new instructions. They were first supported by Intel with the Haswell microarchitecture, which shipped in 2013. AVX-512 expands AVX to 512-bit support using a new EVEX prefix encoding proposed by Intel in July 2013 and first supported by Intel with the Knights Landing co-processor, which shipped in 2016. In conventional processors, AVX-512 was introduced with Skylake server and HEDT processors in 2017.

Advanced Vector Extensions AVX uses sixteen YMM registers to perform a single instruction on multiple pieces of data (see SIMD). Each YMM register can hold and do simultaneous operations (math) on:

eight 32-bit single-precision floating-point numbers or four 64-bit double-precision floating-point numbers. The width of the SIMD registers is increased from 128 bits to 256 bits, and renamed from XMM0–XMM7 to YMM0–YMM7 (in x86-64 mode, from XMM0–XMM15 to YMM0–YMM15). The legacy SSE instructions can still be utilized via the VEX prefix to operate on the lower 128 bits of the YMM registers.

AVX introduces a three-operand SIMD instruction format called VEX coding scheme, where the destination register is distinct from the two source operands. For example, an SSE instruction using the conventional two-operand form a ← a + b can now use a non-destructive three-operand form c ← a + b, preserving both source operands. Originally, AVX's three-operand format was limited to the instructions with SIMD operands (YMM), and did not include instructions with general purpose registers (e.g. EAX). It was later used for coding new instructions on general purpose registers in later extensions, such as BMI. VEX coding is also used for instructions operating on the k0-k7 mask registers that were introduced with AVX-512. The alignment requirement of SIMD memory operands is relaxed. Unlike their non-VEX coded counterparts, most VEX coded vector instructions no longer require their memory operands to be aligned to the vector size. Notably, the VMOVDQA instruction still requires its memory operand to be aligned. The new VEX coding scheme introduces a new set of code prefixes that extends the opcode space, allows instructions to have more than two operands, and allows SIMD vector registers to be longer than 128 bits. The VEX prefix can also be used on the legacy SSE instructions giving them a three-operand form, and making them interact more efficiently with AVX instructions without the need for VZEROUPPER and VZEROALL. The AVX instructions support both 128-bit and 256-bit SIMD. The 128-bit versions can be useful to improve old code without needing to widen the vectorization, and avoid the penalty of going from SSE to AVX; they are also faster on some early AMD implementations of AVX. This mode is sometimes known as AVX-128. Compared to SSE series, AVX further enhanced performance for digital media playback, web browsing, asymmetric encryption, and others.

New instructions These AVX instructions are in addition to the ones that are 256-bit extensions of the legacy 128-bit SSE instructions; most are usable on both 128-bit and 256-bit operands.

CPUs with AVX Intel Sandy Bridge processors (Q1 2011) and newer, except models branded as Celeron and Pentium. Pentium and Celeron branded processors starting with Tiger Lake (Q3 2020) and newer. AMD: Bulldozer processors (Q4 2011) and newer, including Jaguar and Puma. Issues regarding compatibility between future Intel and AMD processors are discussed under XOP instruction set.

VIA: Nano QuadCore Eden X4 Zhaoxin: WuDaoKou-based processors (KX-5000 and KH-20000)

Compiler and assembler support Absoft supports with -mavx flag. The Free Pascal compiler supports AVX and AVX2 with the -CfAVX and -CfAVX2 switches from version 2.7.1. RAD studio (v11.0 Alexandria) supports AVX2 and AVX-512. The GNU Assembler (GAS) inline assembly functions support these instructions (accessible via GCC), as do Intel primitives and the Intel inline assembler (closely compatible to GAS, although more general in its handling of local references within inline code). GAS supports AVX starting with binutils version 2.19. GCC starting with version 4.6 (although there was a 4.3 branch with certain support) and the Intel Compiler Suite starting with version 11.1 support AVX. The Open64 compiler version 4.5.1 supports AVX with -mavx flag. PathScale supports via the -mavx flag. The Vector Pascal compiler supports AVX via the -cpuAVX32 flag. The Visual Studio 2010/2012 compiler supports AVX via intrinsic and /arch:AVX switch. NASM starting with version 2.03 and newer. There were numerous bug fixes and updates related to AVX in version 2.04. Other assemblers such as Microsoft Macro Assembler VS2010 version, YASM, Flat Assembler, and JWASM.

Operating system support AVX adds new register-state through the 256-bit wide YMM register file, so explicit operating system support is required to properly save and restore AVX's expanded registers between context switches. The following operating system versions support AVX:

DragonFly BSD: support added in early 2013. FreeBSD: support added in a patch submitted on January 21, 2012, which was included in the 9.1 stable release. Linux: supported since kernel version 2.6.30, released on June 9, 2009. macOS: support added in 10.6.8 (Snow Leopard) update released on June 23, 2011. In fact, macOS Ventura does not support x86 processors without the AVX2 instruction set. OpenBSD: support added on March 21, 2015. Solaris: supported in Solaris 10 Update 10 and Solaris 11. Windows: supported since Windows 7 SP1 and Windows Server 2008 R2 SP1. Windows Server 2008 R2 SP1 with Hyper-V requires a hotfix to support AMD AVX (Opteron 6200 and 4200 series) processors, KB2568088 Windows XP and Windows Server 2003 do not support AVX in both kernel drivers and user applications. Support for AVX-512 was added in Windows 10 and Windows Server 2016.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Advanced Vector Extensions

Start with the simplest possible case. Write down what Advanced Vector Extensions claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Advanced Vector Extensions before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Advanced Vector Extensions ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Advanced Vector Extensions

In research
Advanced Vector Extensions appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Advanced Vector Extensions in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Advanced Vector Extensions is common in secondary-school and first-year university syllabi. It links to neighbouring topics AMD technologies, Instruction set extensions, SIMD computing, so understanding it makes those chapters shorter.
In everyday life
Look for Advanced Vector Extensions outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Advanced Vector Extensions” →

How to study Advanced Vector Extensions in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Advanced Vector Extensions means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Advanced Vector Extensions out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Advanced Vector Extensions in simple terms?

Advanced Vector Extensions (AVX, also known as Gesher New Instructions and then Sandy Bridge New Instructions) 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 b…

Why does Advanced Vector Extensions matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Advanced Vector Extensions?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Advanced Vector Extensions.

Tags

  • AMD technologies
  • Instruction set extensions
  • SIMD computing
  • X86 instructions

Keep exploring