# simd

Published articles for simd.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Underrust: How does u128 work on a 64-bit processor?

DevFeed: [Underrust: How does u128 work on a 64-bit processor?](<https://devfeed.tech/articles/underrust-how-does-u128-work-on-a-64-bit-processor-35481.md>)

Original publisher: [Read original article](<https://darkcoding.net/software/underrust-u128/>)

Author: Graham King

Published: 2025-04-05T20:45:00Z

Content type: tutorial

Language: en

Sources: [Graham King](<https://devfeed.tech/sources/graham-king.md>)

Topics: [cpu](<https://devfeed.tech/topics/cpu.md>), [x86](<https://devfeed.tech/topics/x86.md>), [Rust](<https://devfeed.tech/topics/rust.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Assembly](<https://devfeed.tech/topics/assembly.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [assembly](<https://devfeed.tech/tags/assembly.md>), [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [processors](<https://devfeed.tech/tags/processors.md>), [rust](<https://devfeed.tech/tags/rust.md>), [simd](<https://devfeed.tech/tags/simd.md>), [software](<https://devfeed.tech/tags/software.md>), [sse](<https://devfeed.tech/tags/sse.md>), [underrust](<https://devfeed.tech/tags/underrust.md>), [x86](<https://devfeed.tech/tags/x86.md>)

### AI overview

The article explains how Rust u128 values work on x86-64 processors whose general-purpose registers are limited to 64 bits. It describes splitting values across two registers and distinguishes this from the use of 128-bit SSE registers for SIMD operations.

### Source excerpt

Wherein our hero learns the arcane secrets of the u128 sword in the depths of the Underrust.

## Packing Matrix-Vector Multiplication in Fully Homomorphic Encryption

DevFeed: [Packing Matrix-Vector Multiplication in Fully Homomorphic Encryption](<https://devfeed.tech/articles/packing-matrix-vector-multiplication-in-fully-homomorphic-encryption-40487.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2024/09/06/packing-matrix-vector-multiplication-in-fhe/>)

Published: 2024-09-07T04:18:09Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [homomorphic encryption](<https://devfeed.tech/topics/homomorphic-encryption.md>), [FHE](<https://devfeed.tech/topics/fhe.md>), [Encryption](<https://devfeed.tech/topics/encryption.md>), [layout](<https://devfeed.tech/topics/layout.md>), [parallel](<https://devfeed.tech/topics/parallel.md>), [Python](<https://devfeed.tech/topics/python.md>)

Tags: [arithmetic](<https://devfeed.tech/tags/arithmetic.md>), [code](<https://devfeed.tech/tags/code.md>), [cryptography](<https://devfeed.tech/tags/cryptography.md>), [data](<https://devfeed.tech/tags/data.md>), [encryption](<https://devfeed.tech/tags/encryption.md>), [fhe](<https://devfeed.tech/tags/fhe.md>), [github-repository](<https://devfeed.tech/tags/github-repository.md>), [homomorphic-encryption](<https://devfeed.tech/tags/homomorphic-encryption.md>), [layout](<https://devfeed.tech/tags/layout.md>), [linear-algebra](<https://devfeed.tech/tags/linear-algebra.md>), [lwe](<https://devfeed.tech/tags/lwe.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [packing](<https://devfeed.tech/tags/packing.md>), [parallel](<https://devfeed.tech/tags/parallel.md>), [programming](<https://devfeed.tech/tags/programming.md>), [python](<https://devfeed.tech/tags/python.md>), [rlwe](<https://devfeed.tech/tags/rlwe.md>), [simd](<https://devfeed.tech/tags/simd.md>), [strategies](<https://devfeed.tech/tags/strategies.md>)

### AI overview

This article explains packing for SIMD-style fully homomorphic encryption. It describes how to arrange plaintext data in RLWE ciphertexts so matrix-vector multiplication requires fewer alignment multiplications and rotations, then introduces two basic packing techniques and a computational model.

### Source excerpt

In my recent overview of homomorphic encryption, I underemphasized the importance of data layout when working with arithmetic (SIMD-style) homomorphic encryption schemes. In the FHE world, the name given to data layout strategies is called "packing," because it revolves around putting multiple plaintext data into RLWE ciphertexts in carefully-chosen ways that mesh well with the operations you'd like to perform. By "mesh well" I mean it reduces the number of extra multiplications and rotations required merely to align data elements properly, rather than doing the actual computation you care about.

## Converting Between Packings in SIMD-Style FHE

DevFeed: [Converting Between Packings in SIMD-Style FHE](<https://devfeed.tech/articles/shift-networks-40486.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2024/09/02/shift-networks/>)

Published: 2024-09-02T21:01:03Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [FHE](<https://devfeed.tech/topics/fhe.md>), [homomorphic encryption](<https://devfeed.tech/topics/homomorphic-encryption.md>), [data](<https://devfeed.tech/topics/data.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [compilers](<https://devfeed.tech/tags/compilers.md>), [encryption](<https://devfeed.tech/tags/encryption.md>), [fhe](<https://devfeed.tech/tags/fhe.md>), [github](<https://devfeed.tech/tags/github.md>), [graph-coloring](<https://devfeed.tech/tags/graph-coloring.md>), [heir](<https://devfeed.tech/tags/heir.md>), [homomorphic-encryption](<https://devfeed.tech/tags/homomorphic-encryption.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [packing](<https://devfeed.tech/tags/packing.md>), [permutation](<https://devfeed.tech/tags/permutation.md>), [programming](<https://devfeed.tech/tags/programming.md>), [rlwe](<https://devfeed.tech/tags/rlwe.md>), [simd](<https://devfeed.tech/tags/simd.md>)

### AI overview

This article explains packing in SIMD-style fully homomorphic encryption and focuses on converting between established packings. It introduces a computational model involving RLWE ciphertext vectors, elementwise operations, cyclic rotations, and differing operation costs.

### Source excerpt

In my recent overview of homomorphic encryption, I underemphasized the importance of data layout when working with arithmetic (SIMD-style) homomorphic encryption schemes. In the FHE world, the name given to data layout strategies is called "packing," because it revolves around putting multiple plaintext data into RLWE ciphertexts in carefully-chosen ways that mesh well with the operations you'd like to perform. By "mesh well" I mean it reduces the number of extra multiplications and rotations required merely to align data elements properly, rather than doing the actual computation you care about.

## Underrust: Multiple Return Values

DevFeed: [Underrust: Multiple Return Values](<https://devfeed.tech/articles/underrust-multiple-return-values-35460.md>)

Original publisher: [Read original article](<https://darkcoding.net/software/rust-multiple-return-types/>)

Author: Graham King

Published: 2022-10-18T07:00:00Z

Content type: tutorial

Language: en

Sources: [Graham King](<https://devfeed.tech/sources/graham-king.md>)

Topics: [Rust](<https://devfeed.tech/topics/rust.md>), [Assembly](<https://devfeed.tech/topics/assembly.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>)

Tags: [assembly](<https://devfeed.tech/tags/assembly.md>), [avx](<https://devfeed.tech/tags/avx.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [rust](<https://devfeed.tech/tags/rust.md>), [simd](<https://devfeed.tech/tags/simd.md>), [software](<https://devfeed.tech/tags/software.md>), [underrust](<https://devfeed.tech/tags/underrust.md>)

### AI overview

This article examines how Rust returns values at the ABI and assembly levels. It covers integer and floating-point returns, multiple values, structs, function pointers, caller-stack returns, return-value optimization, and an LLVM SIMD optimization using AVX registers.

### Source excerpt

How does Rust return values, and does it make any difference to us programmers?

## Overthinking Leetcode's Two Sum with SIMD

DevFeed: [Overthinking Leetcode's Two Sum with SIMD](<https://devfeed.tech/articles/overthinking-leetcode-s-two-sum-with-simd-35478.md>)

Original publisher: [Read original article](<https://darkcoding.net/software/two-sum/>)

Author: Graham King

Published: 2022-10-09T07:00:00Z

Content type: tutorial

Language: en

Sources: [Graham King](<https://devfeed.tech/sources/graham-king.md>)

Topics: [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [Code](<https://devfeed.tech/topics/code.md>), [Rust](<https://devfeed.tech/topics/rust.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [algorithms](<https://devfeed.tech/tags/algorithms.md>), [array](<https://devfeed.tech/tags/array.md>), [avx](<https://devfeed.tech/tags/avx.md>), [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [code](<https://devfeed.tech/tags/code.md>), [complexity](<https://devfeed.tech/tags/complexity.md>), [interview](<https://devfeed.tech/tags/interview.md>), [performance](<https://devfeed.tech/tags/performance.md>), [rust](<https://devfeed.tech/tags/rust.md>), [simd](<https://devfeed.tech/tags/simd.md>), [software](<https://devfeed.tech/tags/software.md>)

### AI overview

This article examines the Two Sum problem by comparing a brute-force linear scan with a map-based solution. It discusses their complexity, implementation costs, and when the linear approach may be faster, including the possibility of using AVX-512 instructions.

### Source excerpt

When is the linear scan Two Sum solution faster than a map? What if we use AVX-512 instructions?

## Bitsliced SipHash

DevFeed: [Bitsliced SipHash](<https://devfeed.tech/articles/bitsliced-siphash-38922.md>)

Original publisher: [Read original article](<https://idea.popcount.org/2013-01-30-bitsliced-siphash>)

Author: Marek

Published: 2013-01-29T23:00:00Z

Content type: tutorial

Language: en

Sources: [Marek Majkowski](<https://devfeed.tech/sources/marek-majkowski.md>)

Topics: [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [parallel](<https://devfeed.tech/topics/parallel.md>), [implementation](<https://devfeed.tech/topics/implementation.md>), [C](<https://devfeed.tech/topics/c.md>), [Python](<https://devfeed.tech/topics/python.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [c](<https://devfeed.tech/tags/c.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [cycles](<https://devfeed.tech/tags/cycles.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [matrix](<https://devfeed.tech/tags/matrix.md>), [parallel](<https://devfeed.tech/tags/parallel.md>), [simd](<https://devfeed.tech/tags/simd.md>), [speed](<https://devfeed.tech/tags/speed.md>), [sse](<https://devfeed.tech/tags/sse.md>)

### AI overview

This article explains bitslicing through a SipHash implementation. It describes rewriting an algorithm as simple bit-level logical operations applied to wide SIMD vectors, which can reduce repeated parallel computations. It also discusses the substantial cost of transposing input and output bit matrices.

### Source excerpt

Bitsliced SipHash Few days ago I presented a Python and a C implementation of SipHash. This time for no reason whatsoever I implemented a bitsliced version of it. Bitslicing a crypto algorithm is usually done to speed it up when doing massively parallel operations. For example when trying to find a collision with brute force. Bitsliced implementation is only useful if you have a large number of exactly the same mathematical operations to be computed in parallel.