mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-04 13:44:31 +01:00
Squashed 'externals/xbyak/' changes from 2794cde7..671fc805
671fc805 update test/cybozu 8ca86231 remove mutable in Address 8b93498f add cmpsb/scasb/... 7eb62750 avoid core_sharing_data_cache = 0 for some cloud envrionment 85767e95 support mingw64 59573e6e add PROTECT_RE mode for protect() 71b75f65 fix push(qword[mem]) 811f4959 Merge branch 'rsdubtso-master' 8e3cb711 Account for potentially zero 0xb leaf when parsing cache/topology via cpuid a816249f update version fe083912 fix to avoid zero division for some virtual machine f0a8f7fa update version cac09b7a Merge pull request #62 from mgouicem/master 1f96b5e0 Fixes an error raised by clang < 3.9 c0f885ac Merge pull request #61 from mgouicem/master bfe2d201 Change default value for n_cores in setCacheHierarchy. fd587b55 change format and add getter for data_cache_size 80b3c7b9 remove macro 88189609 Merge branch 'mgouicem-master' e6b79723 Adding queries to get the cpu topology on Intel architectures. 221384f0 vmov* supports [mem]|k|z c04141ef define XBYAK_NO_OP_NAMES for test af7f05ee add const for Label git-subtree-dir: externals/xbyak git-subtree-split: 671fc805d09d075f48d4625f183ef2e1ef725106
This commit is contained in:
parent
9fb82036ca
commit
dbb1f8cf37
25 changed files with 425 additions and 204 deletions
|
|
@ -13,7 +13,6 @@ struct Code : Xbyak::CodeGenerator {
|
|||
{
|
||||
puts("generate");
|
||||
printf("ptr=%p, %p\n", getCode(), buf);
|
||||
Xbyak::CodeArray::protect(buf, sizeof(buf), true);
|
||||
#ifdef XBYAK32
|
||||
mov(eax, ptr [esp + 4]);
|
||||
add(eax, ptr [esp + 8]);
|
||||
|
|
@ -23,6 +22,11 @@ struct Code : Xbyak::CodeGenerator {
|
|||
lea(rax, ptr [rdi + rsi]);
|
||||
#endif
|
||||
ret();
|
||||
Xbyak::CodeArray::protect(buf, sizeof(buf), Xbyak::CodeArray::PROTECT_RE);
|
||||
}
|
||||
~Code()
|
||||
{
|
||||
Xbyak::CodeArray::protect(buf, sizeof(buf), Xbyak::CodeArray::PROTECT_RW);
|
||||
}
|
||||
} s_code;
|
||||
|
||||
|
|
|
|||
|
|
@ -162,18 +162,21 @@ int main()
|
|||
{
|
||||
// use memory allocated by user
|
||||
using namespace Xbyak;
|
||||
const size_t codeSize = 1024;
|
||||
const size_t codeSize = 4096;
|
||||
uint8 buf[codeSize + 16];
|
||||
uint8 *p = CodeArray::getAlignedAddress(buf);
|
||||
CodeArray::protect(p, codeSize, true);
|
||||
Sample s(p, codeSize);
|
||||
if (!CodeArray::protect(p, codeSize, CodeArray::PROTECT_RWE)) {
|
||||
fprintf(stderr, "can't protect\n");
|
||||
return 1;
|
||||
}
|
||||
int (*func)(int) = s.getCode<int (*)(int)>();
|
||||
if (Xbyak::CastTo<uint8*>(func) != p) {
|
||||
fprintf(stderr, "internal error %p %p\n", p, Xbyak::CastTo<uint8*>(func));
|
||||
return 1;
|
||||
}
|
||||
printf("0 + ... + %d = %d\n", 100, func(100));
|
||||
CodeArray::protect(p, codeSize, false);
|
||||
CodeArray::protect(p, codeSize, CodeArray::PROTECT_RW);
|
||||
}
|
||||
puts("OK");
|
||||
testReset();
|
||||
|
|
|
|||
|
|
@ -104,6 +104,9 @@ void putCPUinfo()
|
|||
Core i7-3930K 6 2D
|
||||
*/
|
||||
cpu.putFamily();
|
||||
for (unsigned int i = 0; i < cpu.getDataCacheLevels(); i++) {
|
||||
printf("cache level=%u data cache size=%u cores sharing data cache=%u\n", i, cpu.getDataCacheSize(i), cpu.getCoresSharingDataCache(i));
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue