diff mbox series

[v2,2/3] s390x/tcg: move wrap_address() to internal.h

Message ID 20170919142654.16369-3-david@redhat.com
State New
Headers show
Series Implement basic MSA functions | expand

Commit Message

David Hildenbrand Sept. 19, 2017, 2:26 p.m. UTC
We want to use it in another file.

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 target/s390x/internal.h   | 14 ++++++++++++++
 target/s390x/mem_helper.c | 14 --------------
 2 files changed, 14 insertions(+), 14 deletions(-)

Comments

Philippe Mathieu-Daudé Sept. 19, 2017, 3:29 p.m. UTC | #1
On 09/19/2017 11:26 AM, David Hildenbrand wrote:
> We want to use it in another file.
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>   target/s390x/internal.h   | 14 ++++++++++++++
>   target/s390x/mem_helper.c | 14 --------------
>   2 files changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/target/s390x/internal.h b/target/s390x/internal.h
> index bc8f83129a..70d2b87e55 100644
> --- a/target/s390x/internal.h
> +++ b/target/s390x/internal.h
> @@ -162,6 +162,20 @@ static inline uint8_t get_per_atmid(CPUS390XState *env)
>              ((env->psw.mask & PSW_ASC_ACCREG) ?    (1 << 2) : 0);
>   }
>   
> +static inline uint64_t wrap_address(CPUS390XState *env, uint64_t a)
> +{
> +    if (!(env->psw.mask & PSW_MASK_64)) {
> +        if (!(env->psw.mask & PSW_MASK_32)) {
> +            /* 24-Bit mode */
> +            a &= 0x00ffffff;
> +        } else {
> +            /* 31-Bit mode */
> +            a &= 0x7fffffff;
> +        }
> +    }
> +    return a;
> +}
> +
>   /* CC optimization */
>   
>   /* Instead of computing the condition codes after each x86 instruction,
> diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c
> index ec4760e390..a254613dc2 100644
> --- a/target/s390x/mem_helper.c
> +++ b/target/s390x/mem_helper.c
> @@ -122,20 +122,6 @@ static inline void cpu_stsize_data_ra(CPUS390XState *env, uint64_t addr,
>       }
>   }
>   
> -static inline uint64_t wrap_address(CPUS390XState *env, uint64_t a)
> -{
> -    if (!(env->psw.mask & PSW_MASK_64)) {
> -        if (!(env->psw.mask & PSW_MASK_32)) {
> -            /* 24-Bit mode */
> -            a &= 0x00ffffff;
> -        } else {
> -            /* 31-Bit mode */
> -            a &= 0x7fffffff;
> -        }
> -    }
> -    return a;
> -}
> -
>   static void fast_memset(CPUS390XState *env, uint64_t dest, uint8_t byte,
>                           uint32_t l, uintptr_t ra)
>   {
>
Richard Henderson Sept. 19, 2017, 5:24 p.m. UTC | #2
On 09/19/2017 09:26 AM, David Hildenbrand wrote:
> We want to use it in another file.
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  target/s390x/internal.h   | 14 ++++++++++++++
>  target/s390x/mem_helper.c | 14 --------------
>  2 files changed, 14 insertions(+), 14 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
diff mbox series

Patch

diff --git a/target/s390x/internal.h b/target/s390x/internal.h
index bc8f83129a..70d2b87e55 100644
--- a/target/s390x/internal.h
+++ b/target/s390x/internal.h
@@ -162,6 +162,20 @@  static inline uint8_t get_per_atmid(CPUS390XState *env)
            ((env->psw.mask & PSW_ASC_ACCREG) ?    (1 << 2) : 0);
 }
 
+static inline uint64_t wrap_address(CPUS390XState *env, uint64_t a)
+{
+    if (!(env->psw.mask & PSW_MASK_64)) {
+        if (!(env->psw.mask & PSW_MASK_32)) {
+            /* 24-Bit mode */
+            a &= 0x00ffffff;
+        } else {
+            /* 31-Bit mode */
+            a &= 0x7fffffff;
+        }
+    }
+    return a;
+}
+
 /* CC optimization */
 
 /* Instead of computing the condition codes after each x86 instruction,
diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c
index ec4760e390..a254613dc2 100644
--- a/target/s390x/mem_helper.c
+++ b/target/s390x/mem_helper.c
@@ -122,20 +122,6 @@  static inline void cpu_stsize_data_ra(CPUS390XState *env, uint64_t addr,
     }
 }
 
-static inline uint64_t wrap_address(CPUS390XState *env, uint64_t a)
-{
-    if (!(env->psw.mask & PSW_MASK_64)) {
-        if (!(env->psw.mask & PSW_MASK_32)) {
-            /* 24-Bit mode */
-            a &= 0x00ffffff;
-        } else {
-            /* 31-Bit mode */
-            a &= 0x7fffffff;
-        }
-    }
-    return a;
-}
-
 static void fast_memset(CPUS390XState *env, uint64_t dest, uint8_t byte,
                         uint32_t l, uintptr_t ra)
 {