Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save Subv/feecb7bfc29e97b67793 to your computer and use it in GitHub Desktop.
size_t EffectiveOpCode() const {
uint32_t op = static_cast<uint32_t>(value);
if (static_cast<Id>(op & ~0x7) == Id::MAD)
return static_cast<size_t>(Id::MAD);
else if (static_cast<Id>(op & ~0x7) == Id::MADI)
return static_cast<size_t>(Id::MADI);
else if (static_cast<Id>(op & ~0x1) == Id::CMP)
return static_cast<size_t>(Id::CMP);
else
return static_cast<size_t>(value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment