Skip to content

Instantly share code, notes, and snippets.

@Subv
Created June 26, 2015 02:39
Show Gist options
  • Select an option

  • Save Subv/2f058c87b657d44ea927 to your computer and use it in GitHub Desktop.

Select an option

Save Subv/2f058c87b657d44ea927 to your computer and use it in GitHub Desktop.
size_t EffectiveOpCode() const {
static const size_t vals[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 46, // CMP
48, 48, 48, 48, 48, 48, 48, 48,
56, 56, 56, 56, 56, 56, 56, 56 };
size_t op = static_cast<size_t>(value);
return vals[op];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment