Modern X86 Assembly Language Programming: Covers x86 64-bit, AVX, AVX2, and AVX-512
Book information
Description
Gain the fundamentals of x86 64-bit assembly language programming and focus on the updated aspects of the x86 instruction set that are most relevant to application software development. This book covers topics including x86 64-bit programming and Advanced Vector Extensions (AVX) programming. The focus in this second edition is exclusively on 64-bit base programming architecture and AVX programming. Modern X86 Assembly Language Programming’s structure and sample code are designed to help you quickly understand x86 assembly language programming and the computational capabilities of the x86 platform. After reading and using this book, you’ll be able to code performance-enhancing functions and algorithms using x86 64-bit assembly language and the AVX, AVX2 and AVX-512 instruction set extensions. What You Will Learn • Discover details of the x86 64-bit platform including its core architecture, data types, registers, memory addressing modes, and the basic instruction set • Use the x86 64-bit instruction set to create performance-enhancing functions that are callable from a high-level language (C++) • Employ x86 64-bit assembly language to efficiently manipulate common data types and programming constructs including integers, text strings, arrays, and structures • Use the AVX instruction set to perform scalar floating-point arithmetic • Exploit the AVX, AVX2, and AVX-512 instruction sets to significantly accelerate the performance of computationally-intense algorithms in problem domains such as image processing, computer graphics, mathematics, and statistics • Apply various coding strategies and techniques to optimally exploit the x86 64-bit, • AVX, AVX2, and AVX-512 instruction sets for maximum possible performance Who This Book Is For Software developers who want to learn how to write code using x86 64-bit assembly language. It’s also ideal for software developers who already have a basic understanding of x86 32-bit or 64-bit assembly language programming and are interested in learning how to exploit the SIMD capabilities of AVX, AVX2 and AVX-512. Contents About the Author About the Technical Reviewer Acknowledgments Introduction Chapter 1: X86-64 Core Architecture Historical Overview Data Types Fundamental Data Types Numerical Data Types SIMD Data Types Miscellaneous Data Types Internal Architecture General-Purpose Registers RFLAGS Register Instruction Pointer Instruction Operands Memory Addressing Differences Between x86-64 and x86-32 Programming Invalid Instructions Deprecated Instructions Instruction Set Overview Summary Chapter 2: X86-64 Core Programming – Part 1 Simple Integer Arithmetic Addition and Subtraction Logical Operations Shift Operations Advanced Integer Arithmetic Multiplication and Division Calculations Using Mixed Types Memory Addressing and Condition Codes Memory Addressing Modes Condition Codes Summary Chapter 3: X86-64 Core Programming – Part 2 Arrays One-Dimensional Arrays Accessing Elements Using Elements in Calculations Two-Dimensional Arrays Accessing Elements Row-Column Calculations Structures Strings Counting Characters String Concatenation Comparing Arrays Array Reversal Summary Chapter 4: Advanced Vector Extensions AVX Overview SIMD Programming Concepts Wraparound vs. Saturated Arithmetic AVX Execution Environment Register Set Data Types Instruction Syntax AVX Scalar Floating-Point Floating-Point Programming Concepts Scalar Floating-Point Register Set Control-Status Register Instruction Set Overview AVX Packed Floating-Point Instruction Set Overview AVX Packed Integer Instruction Set Overview Differences Between x86-AVX and x86-SSE Summary Chapter 5: AVX Programming – Scalar Floating-Point Scalar Floating-Point Arithmetic Single-Precision Floating-Point Double-Precision Floating-Point Scalar Floating-Point Compares and Conversions Floating-Point Compares Floating-Point Conversions Scalar Floating-Point Arrays and Matrices Floating-Point Arrays Floating-Point Matrices Calling Convention Basic Stack Frames Using Non-Volatile General-Purpose Registers Using Non-Volatile XMM Registers Macros for Prologs and Epilogs Summary Chapter 6: AVX Programming – Packed Floating-Point Packed Floating-Point Arithmetic Packed Floating-Point Compares Packed Floating-Point Conversions Packed Floating-Point Arrays Packed Floating-Point Square Roots Packed Floating-Point Array Min-Max Packed Floating-Point Least Squares Packed Floating-Point Matrices Matrix Transposition Matrix Multiplication Summary Chapter 7: AVX Programming – Packed Integers Packed Integer Addition and Subtraction Packed Integer Shifts Packed Integer Multiplication Packed Integer Image Processing Pixel Minimum-Maximum Values Pixel Mean Intensity Pixel Conversions Image Histograms Image Thresholding Summary Chapter 8: Advanced Vector Extensions 2 AVX2 Execution Environment AVX2 Packed Floating-Point AVX2 Packed Integer X86 Instruction Set Extensions Half-Precision Floating-Point Fused-Multiply-Add (FMA) General-Purpose Register Instruction Set Extensions Summary Chapter 9: AVX2 Programming – Packed Floating-Point Packed Floating-Point Arithmetic Packed Floating-Point Arrays Simple Calculations Column Means Correlation Coefficient Matrix Multiplication and Transposition Matrix Inversion Blend and Permute Instructions Data Gather Instructions Summary Chapter 10: AVX2 Programming – Packed Integers Packed Integer Fundamentals Basic Arithmetic Pack and Unpack Size Promotions Packed Integer Image Processing Pixel Clipping RGB Pixel Min-Max Values RGB to Grayscale Conversion Summary Chapter 11: AVX2 Programming – Extended Instructions FMA Programming Convolutions Scalar FMA Packed FMA General-Purpose Register Instructions Flagless Multiplication and Shifts Enhanced Bit Manipulation Half-Precision Floating-Point Conversions Summary Chapter 12: Advanced Vector Extensions 512 AVX-512 Overview AVX-512 Execution Environment Register Sets Data Types Instruction Syntax Conditional Execution and Merging Embedded Broadcast Instruction Level Rounding Instruction Set Overview AVX512F AVX512CD AVX512BW AVX512DQ Opmask Registers Summary Chapter 13: AVX-512 Programming – Floating-Point Scalar Floating-Point Merge Masking Zero Masking Instruction-Level Rounding Packed Floating-Point Packed Floating-Point Arithmetic Packed Floating-Point Compares Packed Floating-Point Column Means Vector Cross Products Matrix-Vector Multiplication Convolutions Summary Chapter 14: AVX-512 Programming – Packed Integers Basic Arithmetic Image Processing Pixel Conversions Image Thresholding Image Statistics RGB to Grayscale Conversion Summary Chapter 15: Optimization Strategies and Techniques Processor Microarchitecture Processor Architecture Overview Microarchitecture Pipeline Functionality Execution Engine Optimizing Assembly Language Code Basic Techniques Floating-Point Arithmetic Program Branches Data Alignment SIMD Techniques Summary Chapter 16: Advanced Programming CPUID Instruction Non-Temporal Memory Stores Data Prefetch Multiple Threads Summary Appendix A Software Utilities for x86 Processors Visual Studio Running a Source Code Example Creating a Visual Studio C++ Project Create a C++ Project Enable MASM Support Add an Assembly Language File Set Project Properties Edit the Source Code Build and Run the Project References X86 Programming Reference Manuals X86 Programming and Microarchitecture References Ancillary Resources Algorithm References C++ References Index
Similar books
Practical C++ STL Programming : Real-World Applications with C++20 and C++23
2024 · EPUB
Practical C++ STL Programming : Real-World Applications with C++20 and C++23
2024 · PDF
Practical C++ STL Programming: Real-World Applications with C++20 and C++23
2024 · PDF
Modern X86 Assembly Language Programming: Covers X86 64-bit, AVX, AVX2, and AVX-512, 3rd Edition
2023 · PDF
Modern X86 Assembly Language Programming: Covers X86 64-bit, AVX, AVX2, and AVX-512
2023 · PDF
Modern Parallel Programming with C++ and Assembly Language: X86 SIMD Development Using AVX, AVX2, and AVX-512
2022 · PDF
Modern Arm Assembly Language Programming: Covers Armv8-A 32-bit, 64-bit, and SIMD
2020 · PDF
Modern X86 Assembly Language Programming. Covers x86 64-bit, AVX, AVX2 and AVX-512 [2nd ed.]
2018 · PDF