This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <os/log.h> | |
#define FAKE_BASE 0x100000000 | |
#define FAKE_PAGE 4096 | |
template <unsigned B> inline int64_t SignExtend64(uint64_t x) { | |
static_assert(B > 0, "Bit width can't be 0."); | |
static_assert(B <= 64, "Bit width out of range."); | |
return int64_t(x << (64 - B)) >> (64 - B); |