mirror of https://github.com/mgba-emu/mgba.git
Use GCC popcount intrinsic for popcount
This commit is contained in:
parent
537480b940
commit
9abe700d37
|
@ -571,11 +571,7 @@ uint32_t GBALoadMultiple(struct ARMCore* cpu, uint32_t address, int mask, enum L
|
||||||
int popcount = 0;
|
int popcount = 0;
|
||||||
if (direction & LSM_D) {
|
if (direction & LSM_D) {
|
||||||
offset = -4;
|
offset = -4;
|
||||||
for (i = 0; i < 16; ++i) {
|
popcount = __builtin_popcount(mask);
|
||||||
if (mask & (1 << i)) {
|
|
||||||
++popcount;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
address -= (popcount << 2) - 4;
|
address -= (popcount << 2) - 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -678,11 +674,7 @@ uint32_t GBAStoreMultiple(struct ARMCore* cpu, uint32_t address, int mask, enum
|
||||||
int popcount = 0;
|
int popcount = 0;
|
||||||
if (direction & LSM_D) {
|
if (direction & LSM_D) {
|
||||||
offset = -4;
|
offset = -4;
|
||||||
for (i = 0; i < 16; ++i) {
|
popcount = __builtin_popcount(mask);
|
||||||
if (mask & (1 << i)) {
|
|
||||||
++popcount;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
address -= (popcount << 2) - 4;
|
address -= (popcount << 2) - 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue