Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

jart/morton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

2 Commits

Repository files navigation

Morton

This repository implements bit interleaving in C/C++.

 morton(0b1100,0b0011)
 │││└──┐││││
 ││└─┐ │││││
 │└┐ │ │││││
 │┌─────┘│││
 │││ │ │ │││
 │││┌────┘││
 │││││ │ ││
 │││││┌───┘│
 │││││││┌──┘
 0b10100101

By default a SWAR implementation is used which takes 2 nanoseconds. If -mbmi2 is available, then morton() and unmorton() take less than one nanosecond. If no compiler optimizations are used then these funcs take 10 nanoseconds. The cost is constant since this implementation is fully branchless.

See Also

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /