~/talk

CPU optimized data structures - more fun with assembler

Talkat ACCU 2019 · 2019-04-10..04-13· [c-and-cpp]
name:CB Bailey
links:none on file
slides:none on file

Assembler implements a poker-hand evaluator that packs rank and suit into bytes, explodes 16-bit rank masks into nibble-aligned MMX lanes, and tests straights via shifted bitwise ANDs and BSR/BSF scans. It iterates ~1.7M community-card combos per matchup but reduces to 48,308 canonical combos by symmetry. Uses MMX SIMD instructions, bitmask per rank/suit layouts and packed saturated subtracts to detect pairs/trips/quads. Handwritten assembly initially outperforms naive C++ but an optimizing compiler closes the gap; debugging, alignment and calling-convention bugs cost time.

AI-written summary · about

  1. 0:00Intro
  2. 2:06Poker
  3. 2:52Playing Cards
  4. 5:09Playing Poker
  5. 6:54The Problem
  6. 7:48Most Valuable Hand
  7. 11:14Poker Ranks
  8. 14:31Obvious Data Structure
  9. 15:07Array of Integers
  10. 15:55Data Structure
  11. 17:19Example
  12. 17:53Iterating
  13. 18:36assembler
  14. 25:33loop
  15. 28:47overhead
  16. 39:07bits can reverse
  17. 43:13four of a kind
  18. 44:49multicard explode
  19. 51:15px
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.