Conversation

MurmurHash3 32bit BASM implementation

(overview of excerpts from articles in conversation)

Newsgroup: embarcadero.public.delphi.language.basm

# Lines
wrote on 25-Jan-2012:

Hi there
Have anyone tried to convert the MurmurHash3 to a optimized BASM version?
This could really be a nice BASM challenge.
Code snippet from MurmurHash3.cpp by Austin Appleby:
void MurmurHash3_x86_32 ( const void * key, int len,
54
  
Duncan Parsons replied on 29-Feb-2012:

(snip)

Hi
  I needed an Object Pascal port of MurmurHash3 (I had been using MurmurHash2, but see it's been superseded), so I'll offer that up here. Alas, it's not BASM, but a pure Pascal implementation is still pretty good.
  function rotl32 (x: Cardinal; r: byte): Cardinal;
  begin
  Result := (x shl r) or (x shr (32 -r));
111
    
Atle Smelvær replied on 04-Mar-2012:

Nice :)
    Just a little remark. You should mark rotl32 and fmix as inline to speed it
    up.
    Here's a modified version originally from Lionel Delafosse, I've only fixed
    it up to support 64bit.
77
  
Aleksandr Sharahov replied on 04-Mar-2012:

Hi Atle,
  I think that even 32-bit ASM version of hash can be improved using mul instead of imul and saving high bits of result.
  So it is not enough sense to translate 32-bit hash on 64 bits losing high bits.
  --
  Aleksandr
9
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Thu, 28 Mar 2024 10:57:16 UTC
Copyright © 2009-2024
HREF Tools Corp.