65816-llvm-mos/patches/0006-runtime-libcalls-w65816.patch
2026-04-28 16:49:41 -05:00

20 lines
877 B
Diff

diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td
index 0000000..0000000 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -3620,6 +3620,15 @@ def MOSSystemLibrary
__memset,
abort)>;
+// W65816 (WDC 65816) - integer libcalls only. Multiply, divide, modulo
+// and shifts go through the standard compiler-rt names (__mulhi3,
+// __divhi3 etc.). No floating point yet.
+def isW65816 : RuntimeLibcallPredicate<"TT.getArch() == Triple::w65816">;
+
+def W65816SystemLibrary
+ : SystemRuntimeLibrary<isW65816,
+ (add DefaultRuntimeLibcallImpls)>;
+
//===----------------------------------------------------------------------===//
// Legacy Default Runtime Libcalls
//===----------------------------------------------------------------------===//