Open in app

Sign In

Write

Sign In

EventHelix
EventHelix

1.8K Followers

Home

About

Published in Software Design

·Jul 28, 2022

Rust bool vector to a string slice vector

Understand the assembly code for a Vec<bool> to Vec<& 'static str> transformation. — We have already looked at assembly code generated for a vector iteration. We will build on that knowledge to understand the assembly code generated when mapping a Rust vector to a string slice vector. Example code: Map a vector of bools to a vector of string slices with static lifetime The following code shows two functions:

Růst

4 min read

Rust bool vector to a string slice vector
Rust bool vector to a string slice vector
Růst

4 min read


Published in Software Design

·Jun 17, 2022

Map Rust vector iteration to assembly

Learn how the compiler optimizes iteration for different vector lengths — Vectors in Rust contain a pointer to a heap vector buffer ( buf) and a length ( len). The vector buffer is a pointer to a buffer of the type T. The length is the number of elements in the vector. Here is an excerpt from the std::vec::Vec implementation: Sample vector handling code

Rust

3 min read

Map Rust vector iteration to assembly
Map Rust vector iteration to assembly
Rust

3 min read


Published in Software Design

·Jun 4, 2022

Rust to assembly: Arrays, Tuples, Box, and Option handling

Map the Rust array, tuple, Box, and Option to assembly. See how the Rust compiler inlines functions. — We have already seen how Rust handles enums under the hood. We also looked at the code generation for the Box smart pointer. …

Rust

3 min read

Rust to assembly: Arrays, Tuples, Box, and Option handling
Rust to assembly: Arrays, Tuples, Box, and Option handling
Rust

3 min read


Published in Software Design

·May 30, 2022

Rust enum-match code generation

Understand the generated assembly code for enum discriminated unions — Matching an enum and associated fields Enums in Rust are discriminated unions that can save one of the multiple variants. The enum discriminator identifies the current interpretation of the discriminated union. The following code shows a simple enum in Rust that represents a generalized Number that can be an Integer, a Float or Complex. Here Number…

Rust

2 min read

Rust enum-match code generation
Rust enum-match code generation
Rust

2 min read


Published in Software Design

·May 29, 2022

Assembly code generated from Rust for parameter passing

Understand the assembly code generated for passing a parameter by value, reference, Box, Rc, and Arc — Here we will be exploring the performance implications of the passing the self parameter by value, reference, and smart pointers (Box, Rc and Arc). The generated assembly code will help us understand what happens under the hood. We will be working with the Complex struct defined below. The code shows…

Rust

5 min read

Assembly code generated from Rust for parameter passing
Assembly code generated from Rust for parameter passing
Rust

5 min read


Published in Software Design

·Dec 31, 2021

Auto-vectorize C and C++ code

Auto-vectorization of for loops results in significant performance improvement — Developers can take advantage of built-in auto-vectorization support in GCC. Let’s explore vectorization with the GCC 11.2 compiler with the following compiler options to enable auto-vectorization. -O3 -march=skylake-avx512 -mno-vzeroupper Vector operations with 8 iterations Let’s start with the following code. We are performing vector operations where the compiler knows that the code will loop 8…

Vectorization

6 min read

Auto-vectorize C and C++ code
Auto-vectorize C and C++ code
Vectorization

6 min read


Published in 5G NR

·Oct 5, 2019

5G NR RLC Acknowledged Mode

Deep dive into the 5G Radio Link Control in Acknowledged Mode — The RLC layer in the 5G NR stack is responsible for: Transfer of upper layer PDUs in Acknowledged Mode (AM), Unacknowledged Mode (UM) and Transparent Mode (TM) Error correction via retransmission of lost RLC PDUs (AM) Segmentation and reassembly of RLC SDUs (UM and AM) Re-segmentation of RLC data PDUs…

5g

12 min read

5G NR RLC Acknowledged Mode
5G NR RLC Acknowledged Mode
5g

12 min read


Published in Software Design

·Aug 24, 2019

likely — unlikely directives

Assisting the compiler in optimizing if conditions — A look at the Linux kernel code will show many if conditions enclosed in likely and unlikely macros. These macros invoke compiler directives that give the compiler a hint on the code leg that should be optimized for performance. For example, the following translation lookaside buffer (TLB) insert function from…

Programming

7 min read

likely — unlikely directives
likely — unlikely directives
Programming

7 min read


Published in Software Design

·Jun 29, 2019

C++ Lambda Under the Hood

Understand the closure generated from a lambda expression — Lambda expressions in C++ let developers define anonymous functions that can be used to inject code. Lambda expressions are more than just functions, they can capture the context from the code enclosing the lambda function. …

Programming

9 min read

C++ Lambda Under the Hood
C++ Lambda Under the Hood
Programming

9 min read


Published in 5G NR

·Apr 22, 2019

Polar codes

Develop an intuitive understanding of polar codes — 3GPP has selected polar codes as the error correcting code on the 5G NR control channels. Polar codes are unique in the way they split the channel into good and bad bit-channels. We will learn about the channel splitting by running experiments using Linux tools awk and gnuplot. …

5g

8 min read

Polar codes
Polar codes
5g

8 min read

EventHelix

EventHelix

1.8K Followers

@EventHelix — 5G | LTE | Networking

Following
  • Intel

    Intel

  • Daryl Pereira

    Daryl Pereira

  • Ethan Siegel

    Ethan Siegel

  • A. S. Deller

    A. S. Deller

  • Microsoft Design

    Microsoft Design

See all (202)

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech