pub fn canonicalize_address(addr: u64) -> u64
{
    let mut addr: i64 = addr as i64;

    /* Canon addresses are 48-bits sign extended. Do a shift left by 16 bits
     * to mask off the top bits, then do an arithmetic shift right (note i64
     * type) to sign extend the 47th bit.
     */
    addr <<= 64 - 48;
    addr >>= 64 - 48;

    addr as u64
}
/// Canonicalize a 64-bit address such that bits [63:48] are sign extended
/// from bit 47
Canonicalize a 64-bit address such that bits [63:48] are sign extended
from bit 47
Canonicalize a 64 - bit address such that bits [ 63 : 48 ] are sign extended from bit 47
pub fn canonicalize_address(addr: u64) -> u64
{
    let mut addr: i64 = addr as i64;
    /* Canon addresses are 48-bits sign extended. Do a shift left by 16 bits
     * to mask off the top bits, then do an arithmetic shift right (note i64
     * type) to sign extend the 47th bit.
     */
    addr <<= 64 - 48;
    addr >>= 64 - 48;
    addr as u64
}
pub fn canonicalize_address ( addr : u64 ) -> u64 { let mut addr : i64 = addr as i64 ; /* Canon addresses are 48-bits sign extended. Do a shift left by 16 bits
     * to mask off the top bits, then do an arithmetic shift right (note i64
     * type) to sign extend the 47th bit.
     */ addr <<= 64 - 48 ; addr >>= 64 - 48 ; addr as u64 }
Canonicalize a 64-bit address such that bits [63:48] are sign extended
from bit 47
Canonicalize a 64 - bit address such that bits [ 63 : 48 ] are sign extended from bit 47
addr
u64
addr
u64