diff mbox

[RFC,25/34] arm: cpu: Move CPU_COMMON to front of env

Message ID bf5603f82210dfc5df18fa78e4cfd4a66c9c008a.1431322749.git.crosthwaite.peter@gmail.com
State New
Headers show

Commit Message

Peter Crosthwaite May 11, 2015, 6:29 a.m. UTC
To allow pointer casts to the the multi-arch CPUArchState which
contains just the CPU_COMMON components.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 target-arm/cpu.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Paolo Bonzini May 11, 2015, 8:36 a.m. UTC | #1
On 11/05/2015 08:29, Peter Crosthwaite wrote:
> To allow pointer casts to the the multi-arch CPUArchState which
> contains just the CPU_COMMON components.
> 
> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>

This can cause worse performance, unfortunately, because of bigger
offsets when registers are written back to env (at end of BB or due to
spills).

Paolo
Andreas Färber May 11, 2015, 10:20 a.m. UTC | #2
Am 11.05.2015 um 10:36 schrieb Paolo Bonzini:
> 
> 
> On 11/05/2015 08:29, Peter Crosthwaite wrote:
>> To allow pointer casts to the the multi-arch CPUArchState which
>> contains just the CPU_COMMON components.
>>
>> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> 
> This can cause worse performance, unfortunately, because of bigger
> offsets when registers are written back to env (at end of BB or due to
> spills).

+1, had been requested by rth due to size of imm offsets.

Andreas
diff mbox

Patch

diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index bdcd331..61d0964 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -120,6 +120,7 @@  typedef struct {
 } TCR;
 
 typedef struct CPUARMState {
+    CPU_COMMON
     /* Regs for current mode.  */
     uint32_t regs[16];
 
@@ -472,9 +473,7 @@  typedef struct CPUARMState {
     struct CPUBreakpoint *cpu_breakpoint[16];
     struct CPUWatchpoint *cpu_watchpoint[16];
 
-    CPU_COMMON
-
-    /* These fields after the common ones so they are preserved on reset.  */
+    /* These fields are preserved on reset.  */
 
     /* Internal CPU feature flags.  */
     uint64_t features;