mirror of
https://github.com/FranLMSP/snes.git
synced 2026-10-03 16:05:18 -04:00
BIT instruction
This commit is contained in:
@@ -8,6 +8,7 @@ pub trait SnesNum: Copy + Clone + Sized + Eq + PartialEq {
|
||||
fn asl(&self) -> Self;
|
||||
fn is_negative(&self) -> bool;
|
||||
fn is_zero(&self) -> bool;
|
||||
fn next_to_highest_bit(&self) -> bool;
|
||||
fn to_u32(&self) -> u32;
|
||||
fn from_u32(v: u32) -> Self;
|
||||
fn invert(&self) -> Self;
|
||||
@@ -74,6 +75,10 @@ macro_rules! define_impl {
|
||||
(*self) == 0
|
||||
}
|
||||
|
||||
fn next_to_highest_bit(&self) -> bool {
|
||||
((*self) << 1) & !(<$t>::MAX >> 1) != 0
|
||||
}
|
||||
|
||||
fn to_u32(&self) -> u32 {
|
||||
(* self) as u32
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user