Înapoi la articole →

Cel mai recent articol

Ultima verificare

Urmăritori 0 urmăritori
Articole: 174
  1. How many uops are there?

    The current Intel CPUs translate instructions into so called uops (micro-ops), which is a kind of internal ISA.

  2. Introduction This is the second part of SIMDized sum of all bytes in the array.

  3. Introduction One step of k-means algorithm is calculating the distance between all centroids and all samples.

  4. Introduction When work with SSE/AVX2/AVX512 it's virtually impossible not to use some vector constants, which are defined by _mm_set_epi32 or similar intrinsic functions.

  5. SIMDized sum of all bytes in the array

    Introduction I was curious how GCC vectorizes function that sums bytes from an array.

  6. SIMDized check which bytes are in a set

    Introduction The problem is defined as follows: there's a stream of bytes and we want to get a byte-mask (or a bit-mask) that indicates which bytes are in the predefined set.

  7. Introduction The goal is to find the first index of the minimum value in a non-empty sequence.

  8. AVX512 mask registers support in compilers

    Introduction AVX-512 introduced the set of 64-bit mask registers, called in assembler k0 ... k7.

  9. Introduction One of steps in JPEG compression is zigzag transformation which linearises pixels from 8x8 block into 64-byte array.

  10. Be careful with directory_iterator

    C++17 finally introduced filesystem library, which is pretty nice.

  11. Parsing series of integers with SIMD

    1 Introduction While conversion from a string into an integer value is feasible with SIMD instructions, this application is unpractical.

  12. Accidental recursion

    Another bug I bumped into.

  13. Is sorted using SIMD instructions

    Introduction Recently, I came across a function that checks whether an array is sorted, i.e. if there is no element which would be greater than its successor.

  14. When lock does not lock --- C++ story

    A few days ago I had compiled fresh GCC 8.0 from trunk and then compiled our product, just to see what we will have to fix in the future.

  15. An awful part of C++17

    The current state I was really happy when saw that C++17 finally introduced standard functions to parse integers and floats.

  16. Intersection of ordered sets

    Introduction The intersection of two sets represented by sorted collections (like lists or arrays) can be done in linear time.

  17. Is power of two --- BMI1 version

    To check if a number is a power of two, the instruction BLSR from BMI1 extension can be used.

  18. With signed numbers it is really easy.

  19. A short report from code::dive 2017

    FPGA for a software developer It was one of my favourite talks.

  20. ARM Neon and Base64 encoding & decoding

    Introduction Base64 algorithms were subject of my interest last year and I proposed a few different SIMD approaches for both encoding and encoding.

  21. AVX512 --- first bit set in a large array

    Problem There is an array of 64-bit values, we want to find the first bit set; the array is sparse.

  22. SWAR check if all chars are digits

    Problem We have a string and want to check if all its characters are ASCII digits.

  23. Population count using XOP instructions

    Introduction AMD XOP defines instruction VPTERNB which does lookup in a pair of SSE registers.

  24. Introduction Popular programming languages provide methods or functions which locate a substring in a given string.

  25. What does AVX512 conflict detection do?

    AVX512CD AVX512CD, or conflict detection, is a subset of AVX512 introducing following instructions: broadcast bit-mask to byte-mask (vpbroadcastmw2d and vpbroadcastmb2q); parallel lzcnt, i.e. counting leading zeros (vplzcntd and vplzcntq); conflict detect…

  26. Byte-wise alignr in AVX512F

    Introduction The instruction alignr in Intel SIMD builds a new vector from a subrange of two concatenated vectors; its downside is accepting only compile-time constants.

  27. Problem We want to detect if a pattern is a sequence of zeros followed by ones.

  28. Sorting an AVX512 register

    Introduction Presented method allows to sort a whole AVX512 register or its subrange, it is a variant of counting sort.

  29. GNU std::string::find is very slow

    See also The problem has been already reported (bug 66414).

  30. AVX512F base64 coding and decoding

    Introduction Both base64 coding and decoding algorithms can be vectorized, i.e.

  31. Building a bitmask

    The problem There is an array of 32-bit integers and a key — a specific value.

  32. SIMD bit mask

    Problem There is a SIMD register (128-, 256-, 512-bit width), we want to set all bits above the given position k; k is in range from 0 to the register's width.

  33. Introduction The SIMD versions of base64 conversion algorithms were described in Base64 encoding with SIMD instructions and Base64 decoding with SIMD instructions.

  34. Introduction In articles about base64 encoding and decoding I've showed how to implement SIMD version of a lookup table using basic vector instruction.

  35. Base64 decoding with SIMD instructions

    Introduction Surprisingly good results of base64 encoding with SIMD instructions forced me to check the opposite algorithm, i.e. the decoding.

  36. Base64 encoding with SIMD instructions

    Introduction I had supposed that SIMD-ization of a base64 encoder is not worth to bother with, and I was wrong.

  37. Speeding up letter case conversion

    Introduction The aim of this text is to show how simple procedure which change case of letters could be rewritten to SWAR version gaining significant boost.

  38. Introduction The conversion of floating-point numbers to a string representation is not an easy task.

  39. Base64 encoding --- implementation study

    Introduction In a basic step of the Base64 encoding three bytes are processed producing four output bytes.

  40. Benefits from the obsession

    Case 1 On the other day I saw such innocent code: string decode_base64(string& base64) { // some validation string result; const size_t n = 3*base64.size() / 4; result.resize(n); // decoding stuff return result; } The size of…

  41. Implicit conversion --- the enemy

    I wrote: result += string_utils::pad_left(string, '0'); I forget that pad_left signature is string, int, char and the char parameter has a default value.

  42. Another C++ nasty feature

    I'm fond of C++ weirdness, really.

  43. Short report from code::dive 2015

    Writing Fast Code Andrei performed a nice show, however some part were... hm, confusing.

  44. Boolean function for the rescue

    The problem is defined as follows: a set of features is saved using bit-sets (usually large), and there is a list/map/whatever of sets containing features of different objects.

  45. Tricky mistake

    A programmer wrote: class container; class IndexOutOfBounds { public: IndexOutOfBounds(const std::string& msg); }; void container::remove(int index) { if (index < 0 || index >= size()) { throw new IndexOutOfBounds("Invalid index: " + in…

  46. Speeding up bit-parallel population count

    Introduction This well know method requires logarithmic number of steps in term of the word width.

  47. Introduction The problem: there is an ordered dictionary containing only unique keys.

  48. AVX512: ternary functions evaluation

    Introduction Intel's version of SIMD offers following 2-argument (binary) boolean functions: and, or, xor, and not.

  49. Compiler warnings are your future errors

    Lesson learned Because we always have very large build logs I didn't notice the new warning.

  50. SIMD: detecting a bit pattern

    Introduction The problem: there are 64-bit values with some data bits and some metadata bits; the metadata includes a k-bit field describing a "type" (k >= 0).