← Înapoi la Urmăritori

Cel mai recent articol

Ultima verificare

Urmăritori 0 urmăritori
Articole: 174
  1. Rust is perfectly imperfect

    My sampling of the real world is performed via X, formerly Twitter.

  2. Change case of UTF-32-encoded strings

    Introduction Changing letters case is something that appear handy in many situations, for instance input normalization, parsing, and other text-related tasks.

  3. LoongArch64 subjective higlights

    Introduction I get back to work on simdutf recently, and noticed that the library gained support for LoongArch64.

  4. AVX512: printing u64 as binary

    Problem Printing 64-bit numbers in binary format can be done nicely with AVX-512 instructions.

  5. SIMD binary heap operations

    Introduction Binary heap is a binary tree data structure having some interesting properties.

  6. Drawing trees

    Problem We have a tree of any degree and depth.

  7. Building full-text search in Javascript

    Introduction I dedicated the last few days of 2024 on refreshing my website.

  8. SIMD parallel bits deposit/extract

    Introduction The BMI2 extension introduced two complementary instructions: parallel bits deposit (PDEP) and parallel bits extract (PEXT).

  9. Dividing unsigned 16-bit numbers

    Introduction This is a follow-up text for Dividing unsigned 8-bit numbers.

  10. Dividing unsigned 8-bit numbers

    Introduction Division is quite an expensive operation.

  11. Myriad sequences of RISC-V code

    Myriad sequences The RISC-V assembler defines the pseudo-instruction li that load an immediate into a register.

  12. RISC-V Vector Extension overview

    Introduction The goal of this text is to provide an overview of RISC-V Vector extension (RVV), and compare — when applicable — with widespread SIMD vector instruction sets: SSE, AVX, AVX-512, ARM Neon and SVE.

  13. Simple suggestions using popcount

    Introduction One great feature that some of CLI applications and compilers recently gained is providing suggestions in the case of misspellings arguments or options.

  14. Introduction One of the hardest problem in SIMD is dealing with non-continuous data accesses, that appear pretty common.

  15. Modern perfect hashing for strings

    Introduction Looking up in a static set of strings is a common problem we encounter when parsing any textual formats.

  16. SIMD-ized faster parse of IPv4 addresses

    Introduction Just for recap, an IPv4 address written in the textual form consists four decimal numbers separated by the dot character.

  17. SWAR find any byte from set

    Introduction When I was browsing the source code of project Ada (WHATWG-compliant and fast URL parser written in modern C++) the following procedure caught my attention: ada_really_inline size_t find_authority_delimiter_special(std::string_view view) noex…

  18. AVX512: finding first byte in lanes

    Introduction The problem is defined as follows: we have separate lanes (32-bit or 64-bit) and want to find the position of the first occurrence of the given byte in each lane.

  19. Converting binary fraction to ratio

    Introduction Suppose we have a binary fraction, that is positive and less than 1: 0.101011000┈┈┈ = 0.671875 | | |│ │ │ │└─╴ 1/2^6 │ │ └──╴ 1/2^5 │ └────╴ 1/2^3 └──────╴ 1/2^1 We want to express it as a ratio of two integer numbers.

  20. Faster fractional exponents

    Introduction A well known method of calculating powers of integers is based on the binary representation of an exponent.

  21. Finding lowest common ancestor of two nodes

    Introduction There are several approaches to find lowest common ancestor (LCA).

  22. AVX512: count trailing zeros

    Introduction AVX512 lacks of counting trailing zeros; it supports counting of leading zeros via instruction VPLZCNTD in 32- and 64-bit words.

  23. AVX512: check if value belongs to a set

    Introduction We want to check if a value belongs to a set.

  24. AVX512: generating constants

    Introduction AVX512 code often needs constants that repeat in 64-, 32-, 16- or 8-bit lanes.

  25. AVX512: histogram of sixteen nibbles

    Introduction At Sneller we had the following problem: there are sixteen 4-bit values, we need a histogram for that limited set.

  26. Faster hack

    The other day I came across the following line: len * ("11124811248484"[type < 14 ?

  27. DDoS-ed by a service runs on AWS

    Every year in January I download the Apache logs for my home page.

  28. Fast parsing HTTP verbs

    Introduction When we started to use boost::beast library at work, obviously I downloaded its source code.

  29. AVX512VBMI2 and packed varuint format

    Introduction A quite popular varuint format lets to save an arbitrary integer number on a sequence of bytes.

  30. Parsing hex numbers with validation

    Introduction A non-validating parsing from hexadecimal string can be vectorized: Using SSE to convert from hexadecimal ASCII to number.

  31. Bit test and reset vs compilers

    Problem The problem: there is a bitmask (16-, 32-, 64-bit).

  32. Introduction This is follow up to Daniel Lemire's Converting integers to fix-digit representations quickly.

  33. How to check if any word is zero

    Problem We want to check if at least one integer value is zero.

  34. Autovectorization status in MSVC in 2021

    Introduction This year I re-checked the status of autovectorization in the latest GCC and Clang.

  35. Introduction This is a follow up to article SIMDized counting byte in byte stream.

  36. Introduction We want to detect if all bytes stored in a SIMD register (SSE, AVX2, AVX512, Neon etc.) are the same.

  37. Introduction Almost two years ago I did an in-depth comparison of autovectorization abilities of popular compilers: GCC, clang, ICC and MSVC.

  38. Use AVX512 to calculate binomial coefficient

    Introduction The value of binomial coefficient kovern can be expressed as n!

  39. Introduction This article was inspired by Geoff Langdale's text Why Ice Lake is Important (a bit-basher’s perspective).

  40. Introduction Positional population count (pospopcnt) is a procedure that calculates the histogram for bits placed at given position in a byte, word or double word etc. from larger stream of such entities.

  41. Malloc internal memory fragmentation footprint

    Introduction When we allocate memory using malloc or another interface, like operator new in C++, we get a pointer and promise that nobody else would acquire the same memory area.

  42. SIMDization of switch statements

    Introduction There are two main purposes of a switch statement: Express simple function that translate from one set of values into another, like getting a string representation of enum values.

  43. Introduction Update 2021-02-17: please check the newest status of GCC & Clang, and MSVC.

  44. SIMDized counting byte in byte stream

    Introduction We want to count how many times given byte occurs in a byte stream; here is a C program doing this: #include <stdint.h> #include <stddef.h> size_t countbyte(uint8_t* data, size_t size, uint8_t b) { size_t result = 0; for (size_t i=0;…

  45. std::function and overloaded functions

    Overloaded functions Let us consider this simple use case, where we want to invoke a function: void invoke_callback(std::function<void(int, int)>); Everything works fine when a callback is a lambda. auto callback = [](int, int){}; invoke_callback(callbac…

  46. pyahocorasick stabilisation story

    Introduction pyahocorasick is a python module I started in 2011.

  47. C++ --- how to read a file into a string

    Introduction To my surprise I quite often need to read the whole contents of a file into a string.

  48. AVX512VBMI --- remove spaces from text

    Introduction Removing spaces from a string is a common task in text processing.

  49. Python --- file modification time perils

    I need to copy a file to another directory whenever it got changed.

  50. A short report from code::dive 2018

    Introduction In November this year there was new edition of code::dive, an IT conference in Wrocław, Poland.