mirror of
https://github.com/pineappleEA/pineapple-src.git
synced 2024-11-28 18:08:25 -05:00
early-access version 1463
This commit is contained in:
parent
23023e6b7e
commit
be16dac2a2
@ -1,7 +1,7 @@
|
||||
yuzu emulator early access
|
||||
=============
|
||||
|
||||
This is the source code for early-access 1462.
|
||||
This is the source code for early-access 1463.
|
||||
|
||||
## Legal Notice
|
||||
|
||||
|
@ -265,6 +265,7 @@ add_library(core STATIC
|
||||
hle/service/am/applets/software_keyboard.h
|
||||
hle/service/am/applets/web_browser.cpp
|
||||
hle/service/am/applets/web_browser.h
|
||||
hle/service/am/applets/web_types.h
|
||||
hle/service/am/idle.cpp
|
||||
hle/service/am/idle.h
|
||||
hle/service/am/omm.cpp
|
||||
|
@ -4,19 +4,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <bit>
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Tegra::Texture::ASTC {
|
||||
|
||||
/// Count the number of bits set in a number.
|
||||
constexpr u32 Popcnt(u32 n) {
|
||||
u32 c = 0;
|
||||
for (; n; c++) {
|
||||
n &= n - 1;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
enum class IntegerEncoding { JustBits, Qus32, Trit };
|
||||
|
||||
struct IntegerEncodedValue {
|
||||
@ -57,17 +49,17 @@ constexpr IntegerEncodedValue CreateEncoding(u32 maxVal) {
|
||||
|
||||
// Is maxVal a power of two?
|
||||
if (!(check & (check - 1))) {
|
||||
return IntegerEncodedValue(IntegerEncoding::JustBits, Popcnt(maxVal));
|
||||
return IntegerEncodedValue(IntegerEncoding::JustBits, std::popcount(maxVal));
|
||||
}
|
||||
|
||||
// Is maxVal of the type 3*2^n - 1?
|
||||
if ((check % 3 == 0) && !((check / 3) & ((check / 3) - 1))) {
|
||||
return IntegerEncodedValue(IntegerEncoding::Trit, Popcnt(check / 3 - 1));
|
||||
return IntegerEncodedValue(IntegerEncoding::Trit, std::popcount(check / 3 - 1));
|
||||
}
|
||||
|
||||
// Is maxVal of the type 5*2^n - 1?
|
||||
if ((check % 5 == 0) && !((check / 5) & ((check / 5) - 1))) {
|
||||
return IntegerEncodedValue(IntegerEncoding::Qus32, Popcnt(check / 5 - 1));
|
||||
return IntegerEncodedValue(IntegerEncoding::Qus32, std::popcount(check / 5 - 1));
|
||||
}
|
||||
|
||||
// Apparently it can't be represented with a bounded integer sequence...
|
||||
|
Loading…
Reference in New Issue
Block a user