IR: Add IR instructions A64Memory{Read,Write}128

This implementation only works on macOS and Linux.
This commit is contained in:
MerryMage 2018-01-24 15:55:59 +00:00
parent e00a522cba
commit e1df7ae621
9 changed files with 72 additions and 4 deletions

View file

@ -147,7 +147,7 @@ void TranslatorVisitor::V(size_t bitsize, Vec vec, IR::U128 value) {
}
}
IR::UAny TranslatorVisitor::Mem(IR::U64 address, size_t bytesize, AccType /*acctype*/) {
IR::UAnyU128 TranslatorVisitor::Mem(IR::U64 address, size_t bytesize, AccType /*acctype*/) {
switch (bytesize) {
case 1:
return ir.ReadMemory8(address);
@ -157,13 +157,15 @@ IR::UAny TranslatorVisitor::Mem(IR::U64 address, size_t bytesize, AccType /*acct
return ir.ReadMemory32(address);
case 8:
return ir.ReadMemory64(address);
case 16:
return ir.ReadMemory128(address);
default:
ASSERT_MSG(false, "Invalid bytesize parameter %zu", bytesize);
return {};
}
}
void TranslatorVisitor::Mem(IR::U64 address, size_t bytesize, AccType /*acctype*/, IR::UAny value) {
void TranslatorVisitor::Mem(IR::U64 address, size_t bytesize, AccType /*acctype*/, IR::UAnyU128 value) {
switch (bytesize) {
case 1:
ir.WriteMemory8(address, value);
@ -177,6 +179,9 @@ void TranslatorVisitor::Mem(IR::U64 address, size_t bytesize, AccType /*acctype*
case 8:
ir.WriteMemory64(address, value);
return;
case 16:
ir.WriteMemory128(address, value);
return;
default:
ASSERT_MSG(false, "Invalid bytesize parameter %zu", bytesize);
return;