* [Qemu-devel] [PATCH 3/5] (PPC) Fix in-between branch returns
@ 2008-01-17 6:42 Alexander Graf
0 siblings, 0 replies; only message in thread
From: Alexander Graf @ 2008-01-17 6:42 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 388 bytes --]
Thanks to the branch detection I found several places where op.o
contained branch returns somewhere not at the end of the function. This
did not happen on other platforms for me, but I may be wrong.
This patch adds FORCE_RET at the end of those functions, to force gcc to
use a jump to the end and not return from it. The idea and most of the
debugging for this comes from Michael Matz.
[-- Attachment #2: qemu-gcc4-forceret.patch --]
[-- Type: text/x-patch, Size: 1247 bytes --]
Index: qemu-snapshot-2008-01-15_05/target-i386/op.c
===================================================================
--- qemu-snapshot-2008-01-15_05.orig/target-i386/op.c
+++ qemu-snapshot-2008-01-15_05/target-i386/op.c
@@ -291,6 +291,7 @@ void OPPROTO op_imull_EAX_T0(void)
EDX = (uint32_t)(res >> 32);
CC_DST = res;
CC_SRC = (res != (int32_t)res);
+ FORCE_RET();
}
void OPPROTO op_imulw_T0_T1(void)
@@ -300,6 +301,7 @@ void OPPROTO op_imulw_T0_T1(void)
T0 = res;
CC_DST = res;
CC_SRC = (res != (int16_t)res);
+ FORCE_RET();
}
void OPPROTO op_imull_T0_T1(void)
@@ -309,6 +311,7 @@ void OPPROTO op_imull_T0_T1(void)
T0 = res;
CC_DST = res;
CC_SRC = (res != (int32_t)res);
+ FORCE_RET();
}
#ifdef TARGET_X86_64
Index: qemu-snapshot-2008-01-15_05/target-i386/ops_template.h
===================================================================
--- qemu-snapshot-2008-01-15_05.orig/target-i386/ops_template.h
+++ qemu-snapshot-2008-01-15_05/target-i386/ops_template.h
@@ -467,6 +467,7 @@ void OPPROTO glue(glue(op_bt, SUFFIX), _
int count;
count = T1 & SHIFT_MASK;
CC_SRC = T0 >> count;
+ FORCE_RET();
}
void OPPROTO glue(glue(op_bts, SUFFIX), _T0_T1_cc)(void)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-01-17 10:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-17 6:42 [Qemu-devel] [PATCH 3/5] (PPC) Fix in-between branch returns Alexander Graf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).