From 8a46ee92b47adbe4d77d6d45d882c01d71989806 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sun, 30 Jan 2011 14:28:02 -0700 Subject: [PATCH] use thunks for integer division on PowerPC PowerPC doesn't generate traps for divides-by-zero, so we defer to thunks which do explicit checks. --- src/powerpc.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/powerpc.cpp b/src/powerpc.cpp index 55c2658dc0..e6be245100 100644 --- a/src/powerpc.cpp +++ b/src/powerpc.cpp @@ -2158,7 +2158,13 @@ class MyArchitecture: public Assembler::Architecture { case Divide: case Remainder: - if (BytesPerWord == 4 and aSize == 8) { + // todo: we shouldn't need to defer to thunks for integers which + // are smaller than or equal to tne native word size, but + // PowerPC doesn't generate traps for divide by zero, so we'd + // need to do the checks ourselves. Using an inline check + // should be faster than calling an out-of-line thunk, but the + // thunk is easier, so they's what we do for now. + if (true) {//if (BytesPerWord == 4 and aSize == 8) { *thunk = true; } else { *aTypeMask = (1 << RegisterOperand);