Differences Between Compiler Optimization Levels -O0 and -O1 in ARMv8

Differences Between Compiler Optimization Levels -O0 and -O1 in ARMv8

This article explores the differences between the compiler optimization levels <span><span>-O0</span></span> and <span><span>-O1</span></span> under the ARMv8 architecture. While the core concepts are consistent with architectures like x86, there are ARM-specific behaviors in terms of register usage, instruction set features, and more. Overview of ARMv8 Architecture Rich Register Set: ARMv8 has 31 general-purpose registers <span><span>X0-X30</span></span> (64-bit) … Read more

A Detailed Explanation of Sequence Points in C Language

A Detailed Explanation of Sequence Points in C Language Author: Luo Guangxuan In the C language, a sequence point is a “time point” in the execution process of a program, with the core rule being: all side effects of expressions (such as variable modifications) must be completely executed before the sequence point; new side effects … Read more

How Does the C Language Standard Describe and Require ‘const’?

The following content is from deepseek. In the C standard, ‘const’ is primarily a compile-time constraint and commitment that informs the compiler of the programmer’s intention not to modify this object. It does not directly specify the storage location of the object or its immutability at runtime. 1. Core Description of the C Standard (C11 … Read more

Introduction to Delphi Programming (91): Inline Assembly – Assembly Process and Functions

This article mainly covers the following content: Compiler Optimization Function Results Exceptions Complete programs and functions can be written using inline assembly language code without the need to include<span>begin…end</span> statements. Compiler Optimization The compiler performs various optimizations: For example, the types of functions that can be written are as follows: function LongMul(X, Y: Integer): Longint;asm … Read more

What is the Use of ‘volatile’ in C Language?

What is the Use of 'volatile' in C Language?

Hello everyone, I am Xiao Feng Ge. When learning C language, there is a strange keyword volatile, what is its use? volatile and the Compiler First, let’s look at this piece of code: int busy = 1; void wait() { while(busy) { ; }} Compile it, and note that O2 optimization is used here:Let’s take … Read more

What is the Use of ‘volatile’ in C Language?

What is the Use of 'volatile' in C Language?

Code Xiaobian MillionFans CertifiedAccount By clicking follow, you not only gain a tool for finding resources but also an interesting soul ▶ ▶ ▶ When learning C language, there is a strange keyword ‘volatile’. What is its use? volatile and the Compiler First, let’s look at this piece of code: int busy = 1; void … Read more

An Overview of GCC Compiler Optimization

An Overview of GCC Compiler Optimization

GCC (GNU Compiler Collection) is one of the most commonly used C/C++ compilers on Linux, supporting multiple languages and platforms. This article introduces the working principles of GCC, commonly used commands, optimization options, and best practices based on relevant materials. Differences and Connections Between gcc and g++ gcc processes source files in C language by … Read more

The Use of the ‘volatile’ Keyword in Embedded C Language

The Use of the 'volatile' Keyword in Embedded C Language

In embedded system development, the ‘volatile’ keyword is a very important modifier that tells the compiler that the value of a variable may change outside the control of the program. Correctly using the volatile keyword can prevent errors caused by compiler optimizations, ensuring the correctness and reliability of the code. This article will detail the … Read more

What is the Use of C++ noexcept?

What is the Use of C++ noexcept?

<span>noexcept</span> is a keyword introduced in C++11, used to specify that a function will not throw exceptions. It serves as both a specifier and an operator, playing an important role in performance optimization, code safety, and compiler optimization. 1. <span><span>noexcept</span></span> Basic Usage 1. As a Function Specifier void my_function() noexcept { // This function promises … Read more

In-Depth Analysis of TiFlash: Compiler-Based Automatic Vectorization Acceleration

In-Depth Analysis of TiFlash: Compiler-Based Automatic Vectorization Acceleration

SIMD (Single Instruction Multiple Data) is a technology that uses a single controller to manage multiple processors, executing the same operation on each element of a set of data (also known as a “data vector”), thereby achieving spatial parallelism. It is an important means of program acceleration. This article will briefly introduce some basic knowledge … Read more