[4500] ARM host support for TCG targets.
Revision: 4500
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4500 Author: balrog Date: 2008-05-19 23:59:38 +0000 (Mon, 19 May 2008)
Log Message:
-----------
ARM host support for TCG targets.
Updated from previous version to use the tcg prologue/epilogue mechanism, may be slower than direct call.
Modified Paths:
--------------
trunk/exec-all.h
trunk/tcg/README
Added Paths:
-----------
trunk/tcg/arm/
trunk/tcg/arm/tcg-target.c
trunk/tcg/arm/tcg-target.h
Modified: trunk/exec-all.h
===================================================================
exec-all.h +17 -1
@@ -142,7 +142,7 @@#define CODE_GEN_MAX_BLOCKS (CODE_GEN_BUFFER_SIZE / CODE_GEN_AVG_BLOCK_SIZE) -#if defined(__powerpc__) || defined(__x86_64__) +#if defined(__powerpc__) || defined(__x86_64__) || defined(__arm__)#define USE_DIRECT_JUMP #endif #if defined(__i386__) && !defined(_WIN32)
@@ -240,6 +240,22 @@ *(uint32_t *)jmp_addr = addr - (jmp_addr +4 );/* no need to flush icache explicitely */ } +#elif defined(__arm__) +static inline void tb_set_jmp_target1 (unsigned long jmp_addr,unsigned long addr) +{ + registerunsigned long _beg __asm ("a1" ); + registerunsigned long _end __asm ("a2" ); + registerunsigned long _flg __asm ("a3" ); + +/* we could use a ldr pc, [pc, #-4] kind of branch and avoid the flush */ + *(uint32_t *)jmp_addr |= ((addr - (jmp_addr +8 )) >>2 ) &0xffffff ; + +/* flush icache */ + _beg = jmp_addr; + _end = jmp_addr +4 ; + _flg =0 ; + __asm __volatile__ ("swi 0x9f0002" : :"r" (_beg),"r" (_end),"r" (_flg)); +}#endif static inline void tb_set_jmp_target(TranslationBlock *tb,
Modified: trunk/tcg/README
===================================================================
tcg/README +1 -1
@@ -75,7 +75,7 @@ * Helpers: Using the tcg_gen_helper_x_y it is possible to call any function -taking i32, i64 or pointer types types. Before calling an helper, all +taking i32, i64 or pointer types. Before calling an helper, all globals are stored at their canonical location and it is assumed that the function can modify them. In the future, function modifiers will be allowed to tell that the helper does not read or write some globals.
Added: trunk/tcg/arm/tcg-target.c
===================================================================
tcg/arm/tcg-target.c +1548 -0
1,548 lines not on this page · raw message
Added: trunk/tcg/arm/tcg-target.h
===================================================================
tcg/arm/tcg-target.h +73 -0
73 lines not on this page · raw message