From bdc1c7134e14fc18182e33dfa3fe98ba10c38acf Mon Sep 17 00:00:00 2001 From: noone Date: Wed, 31 Jul 2024 20:47:28 -0500 Subject: Add IL, intrinsics for TLB-related instructions --- arch/mips/arch_mips.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'arch/mips/arch_mips.cpp') diff --git a/arch/mips/arch_mips.cpp b/arch/mips/arch_mips.cpp index fd90daf0..8d0c70ec 100644 --- a/arch/mips/arch_mips.cpp +++ b/arch/mips/arch_mips.cpp @@ -973,6 +973,12 @@ public: return "_setLeftPart64"; case MIPS_INTRIN_SET_RIGHT_PART64: return "_setRightPart64"; + case MIPS_INTRIN_TLBSET: + return "_writeTLB"; + case MIPS_INTRIN_TLBGET: + return "_readTLB"; + case MIPS_INTRIN_TLBSEARCH: + return "_probeTLB"; case CNMIPS_INTRIN_SYNCIOBDMA: return "_synciobdma"; @@ -1034,6 +1040,9 @@ public: MIPS_INTRIN_GET_RIGHT_PART64, MIPS_INTRIN_SET_LEFT_PART64, MIPS_INTRIN_SET_RIGHT_PART64, + MIPS_INTRIN_TLBSET, + MIPS_INTRIN_TLBGET, + MIPS_INTRIN_TLBSEARCH, CNMIPS_INTRIN_SYNCIOBDMA, CNMIPS_INTRIN_SYNCS, @@ -1173,6 +1182,24 @@ public: return { NameAndType("rightpart", Type::IntegerType(8, false)) }; + case MIPS_INTRIN_TLBSET: + return { + // we use the same order as the pseudocode + // in the documentation + NameAndType("index", Type::IntegerType(8, false)), + NameAndType("PageMask", Type::IntegerType(8, false)), + NameAndType("EntryHi", Type::IntegerType(8, false)), + NameAndType("EntryLo1", Type::IntegerType(8, false)), + NameAndType("EntryLo0", Type::IntegerType(8, false)) + }; + case MIPS_INTRIN_TLBGET: + return { + NameAndType("index", Type::IntegerType(8, false)), + }; + case MIPS_INTRIN_TLBSEARCH: + return { + NameAndType("match", Type::IntegerType(8, false)), + }; default: return vector(); } @@ -1216,6 +1243,19 @@ public: case MIPS_INTRIN_SET_LEFT_PART64: case MIPS_INTRIN_SET_RIGHT_PART64: return {Type::IntegerType(8, false)}; + case MIPS_INTRIN_TLBGET: + return { + // we use the same order as the pseudocode + // in the documentation: + + // PageMask, EntryHi, EntryLo1, EntryLo0 + Type::IntegerType(8, false), + Type::IntegerType(8, false), + Type::IntegerType(8, false), + Type::IntegerType(8, false), + }; + case MIPS_INTRIN_TLBSEARCH: + return { Type::IntegerType(8, false) }; default: return vector>>(); } -- cgit v1.3.1