A64: Implement compare and branch

This commit is contained in:
MerryMage
2018-01-07 16:33:02 +00:00
parent e8bcf72ee5
commit cb481a3a48
20 changed files with 249 additions and 21 deletions

View File

@@ -68,13 +68,29 @@ U1 IREmitter::MostSignificantBit(const U32& value) {
}
U1 IREmitter::IsZero(const U32& value) {
return Inst<U1>(Opcode::IsZero, value);
return Inst<U1>(Opcode::IsZero32, value);
}
U1 IREmitter::IsZero64(const U64& value) {
U1 IREmitter::IsZero(const U64& value) {
return Inst<U1>(Opcode::IsZero64, value);
}
U1 IREmitter::IsZero(const U32U64& value) {
if (value.GetType() == Type::U32) {
return Inst<U1>(Opcode::IsZero32, value);
} else {
return Inst<U1>(Opcode::IsZero64, value);
}
}
U1 IREmitter::TestBit(const U32U64& value, const U8& bit) {
if (value.GetType() == Type::U32) {
return Inst<U1>(Opcode::TestBit, IndeterminateExtendToLong(value), bit);
} else {
return Inst<U1>(Opcode::TestBit, value, bit);
}
}
NZCV IREmitter::NZCVFrom(const Value& value) {
return Inst<NZCV>(Opcode::GetNZCVFromOp, value);
}
@@ -359,6 +375,16 @@ U32 IREmitter::ZeroExtendByteToWord(const U8& a) {
return Inst<U32>(Opcode::ZeroExtendByteToWord, a);
}
U32 IREmitter::IndeterminateExtendToWord(const UAny& a) {
// TODO: Implement properly
return ZeroExtendToWord(a);
}
U64 IREmitter::IndeterminateExtendToLong(const UAny& a) {
// TODO: Implement properly
return ZeroExtendToLong(a);
}
U32 IREmitter::ByteReverseWord(const U32& a) {
return Inst<U32>(Opcode::ByteReverseWord, a);
}