* [PATCH] target/tricore: Rename tricore_feature
@ 2023-07-21 6:06 Bastian Koppelmann
2023-07-21 6:35 ` Thomas Huth
2023-07-21 7:31 ` Philippe Mathieu-Daudé
0 siblings, 2 replies; 5+ messages in thread
From: Bastian Koppelmann @ 2023-07-21 6:06 UTC (permalink / raw)
To: qemu-devel; +Cc: chenrui333, kbastian
this name is used by capstone and will lead to a build failure of QEMU,
when capstone is enabled. So we rename it to tricore_has_feature(), to
match has_feature() in translate.c.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1774
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
target/tricore/cpu.c | 8 ++++----
target/tricore/cpu.h | 2 +-
target/tricore/helper.c | 4 ++--
target/tricore/op_helper.c | 4 ++--
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c
index f15169bd1b..133a9ac70e 100644
--- a/target/tricore/cpu.c
+++ b/target/tricore/cpu.c
@@ -104,18 +104,18 @@ static void tricore_cpu_realizefn(DeviceState *dev, Error **errp)
}
/* Some features automatically imply others */
- if (tricore_feature(env, TRICORE_FEATURE_162)) {
+ if (tricore_has_feature(env, TRICORE_FEATURE_162)) {
set_feature(env, TRICORE_FEATURE_161);
}
- if (tricore_feature(env, TRICORE_FEATURE_161)) {
+ if (tricore_has_feature(env, TRICORE_FEATURE_161)) {
set_feature(env, TRICORE_FEATURE_16);
}
- if (tricore_feature(env, TRICORE_FEATURE_16)) {
+ if (tricore_has_feature(env, TRICORE_FEATURE_16)) {
set_feature(env, TRICORE_FEATURE_131);
}
- if (tricore_feature(env, TRICORE_FEATURE_131)) {
+ if (tricore_has_feature(env, TRICORE_FEATURE_131)) {
set_feature(env, TRICORE_FEATURE_13);
}
cpu_reset(cs);
diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h
index a50b91cc36..3708405be8 100644
--- a/target/tricore/cpu.h
+++ b/target/tricore/cpu.h
@@ -277,7 +277,7 @@ enum tricore_features {
TRICORE_FEATURE_162,
};
-static inline int tricore_feature(CPUTriCoreState *env, int feature)
+static inline int tricore_has_feature(CPUTriCoreState *env, int feature)
{
return (env->features & (1ULL << feature)) != 0;
}
diff --git a/target/tricore/helper.c b/target/tricore/helper.c
index 951024d491..731a6e9cb6 100644
--- a/target/tricore/helper.c
+++ b/target/tricore/helper.c
@@ -155,7 +155,7 @@ void psw_write(CPUTriCoreState *env, uint32_t val)
#define FIELD_GETTER_WITH_FEATURE(NAME, REG, FIELD, FEATURE) \
uint32_t NAME(CPUTriCoreState *env) \
{ \
- if (tricore_feature(env, TRICORE_FEATURE_##FEATURE)) { \
+ if (tricore_has_feature(env, TRICORE_FEATURE_##FEATURE)) { \
return FIELD_EX32(env->REG, REG, FIELD ## _ ## FEATURE); \
} \
return FIELD_EX32(env->REG, REG, FIELD ## _13); \
@@ -170,7 +170,7 @@ uint32_t NAME(CPUTriCoreState *env) \
#define FIELD_SETTER_WITH_FEATURE(NAME, REG, FIELD, FEATURE) \
void NAME(CPUTriCoreState *env, uint32_t val) \
{ \
- if (tricore_feature(env, TRICORE_FEATURE_##FEATURE)) { \
+ if (tricore_has_feature(env, TRICORE_FEATURE_##FEATURE)) { \
env->REG = FIELD_DP32(env->REG, REG, FIELD ## _ ## FEATURE, val); \
} \
env->REG = FIELD_DP32(env->REG, REG, FIELD ## _13, val); \
diff --git a/target/tricore/op_helper.c b/target/tricore/op_helper.c
index 821a4b67cb..89be1ed648 100644
--- a/target/tricore/op_helper.c
+++ b/target/tricore/op_helper.c
@@ -2584,7 +2584,7 @@ void helper_ret(CPUTriCoreState *env)
/* PCXI = new_PCXI; */
env->PCXI = new_PCXI;
- if (tricore_feature(env, TRICORE_FEATURE_131)) {
+ if (tricore_has_feature(env, TRICORE_FEATURE_131)) {
/* PSW = {new_PSW[31:26], PSW[25:24], new_PSW[23:0]}; */
psw_write(env, (new_PSW & ~(0x3000000)) + (psw & (0x3000000)));
} else { /* TRICORE_FEATURE_13 only */
@@ -2695,7 +2695,7 @@ void helper_rfm(CPUTriCoreState *env)
env->gpr_a[10] = cpu_ldl_data(env, env->DCX+8);
env->gpr_a[11] = cpu_ldl_data(env, env->DCX+12);
- if (tricore_feature(env, TRICORE_FEATURE_131)) {
+ if (tricore_has_feature(env, TRICORE_FEATURE_131)) {
env->DBGTCR = 0;
}
}
--
2.41.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] target/tricore: Rename tricore_feature
2023-07-21 6:06 [PATCH] target/tricore: Rename tricore_feature Bastian Koppelmann
@ 2023-07-21 6:35 ` Thomas Huth
2023-07-21 7:31 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2023-07-21 6:35 UTC (permalink / raw)
To: Bastian Koppelmann, qemu-devel; +Cc: chenrui333, QEMU Trivial
On 21/07/2023 08.06, Bastian Koppelmann wrote:
> this name is used by capstone and will lead to a build failure of QEMU,
> when capstone is enabled. So we rename it to tricore_has_feature(), to
> match has_feature() in translate.c.
>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1774
> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> ---
> target/tricore/cpu.c | 8 ++++----
> target/tricore/cpu.h | 2 +-
> target/tricore/helper.c | 4 ++--
> target/tricore/op_helper.c | 4 ++--
> 4 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c
> index f15169bd1b..133a9ac70e 100644
> --- a/target/tricore/cpu.c
> +++ b/target/tricore/cpu.c
> @@ -104,18 +104,18 @@ static void tricore_cpu_realizefn(DeviceState *dev, Error **errp)
> }
>
> /* Some features automatically imply others */
> - if (tricore_feature(env, TRICORE_FEATURE_162)) {
> + if (tricore_has_feature(env, TRICORE_FEATURE_162)) {
> set_feature(env, TRICORE_FEATURE_161);
> }
>
> - if (tricore_feature(env, TRICORE_FEATURE_161)) {
> + if (tricore_has_feature(env, TRICORE_FEATURE_161)) {
> set_feature(env, TRICORE_FEATURE_16);
> }
>
> - if (tricore_feature(env, TRICORE_FEATURE_16)) {
> + if (tricore_has_feature(env, TRICORE_FEATURE_16)) {
> set_feature(env, TRICORE_FEATURE_131);
> }
> - if (tricore_feature(env, TRICORE_FEATURE_131)) {
> + if (tricore_has_feature(env, TRICORE_FEATURE_131)) {
> set_feature(env, TRICORE_FEATURE_13);
> }
> cpu_reset(cs);
> diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h
> index a50b91cc36..3708405be8 100644
> --- a/target/tricore/cpu.h
> +++ b/target/tricore/cpu.h
> @@ -277,7 +277,7 @@ enum tricore_features {
> TRICORE_FEATURE_162,
> };
>
> -static inline int tricore_feature(CPUTriCoreState *env, int feature)
> +static inline int tricore_has_feature(CPUTriCoreState *env, int feature)
> {
> return (env->features & (1ULL << feature)) != 0;
> }
> diff --git a/target/tricore/helper.c b/target/tricore/helper.c
> index 951024d491..731a6e9cb6 100644
> --- a/target/tricore/helper.c
> +++ b/target/tricore/helper.c
> @@ -155,7 +155,7 @@ void psw_write(CPUTriCoreState *env, uint32_t val)
> #define FIELD_GETTER_WITH_FEATURE(NAME, REG, FIELD, FEATURE) \
> uint32_t NAME(CPUTriCoreState *env) \
> { \
> - if (tricore_feature(env, TRICORE_FEATURE_##FEATURE)) { \
> + if (tricore_has_feature(env, TRICORE_FEATURE_##FEATURE)) { \
> return FIELD_EX32(env->REG, REG, FIELD ## _ ## FEATURE); \
> } \
> return FIELD_EX32(env->REG, REG, FIELD ## _13); \
> @@ -170,7 +170,7 @@ uint32_t NAME(CPUTriCoreState *env) \
> #define FIELD_SETTER_WITH_FEATURE(NAME, REG, FIELD, FEATURE) \
> void NAME(CPUTriCoreState *env, uint32_t val) \
> { \
> - if (tricore_feature(env, TRICORE_FEATURE_##FEATURE)) { \
> + if (tricore_has_feature(env, TRICORE_FEATURE_##FEATURE)) { \
> env->REG = FIELD_DP32(env->REG, REG, FIELD ## _ ## FEATURE, val); \
> } \
> env->REG = FIELD_DP32(env->REG, REG, FIELD ## _13, val); \
> diff --git a/target/tricore/op_helper.c b/target/tricore/op_helper.c
> index 821a4b67cb..89be1ed648 100644
> --- a/target/tricore/op_helper.c
> +++ b/target/tricore/op_helper.c
> @@ -2584,7 +2584,7 @@ void helper_ret(CPUTriCoreState *env)
> /* PCXI = new_PCXI; */
> env->PCXI = new_PCXI;
>
> - if (tricore_feature(env, TRICORE_FEATURE_131)) {
> + if (tricore_has_feature(env, TRICORE_FEATURE_131)) {
> /* PSW = {new_PSW[31:26], PSW[25:24], new_PSW[23:0]}; */
> psw_write(env, (new_PSW & ~(0x3000000)) + (psw & (0x3000000)));
> } else { /* TRICORE_FEATURE_13 only */
> @@ -2695,7 +2695,7 @@ void helper_rfm(CPUTriCoreState *env)
> env->gpr_a[10] = cpu_ldl_data(env, env->DCX+8);
> env->gpr_a[11] = cpu_ldl_data(env, env->DCX+12);
>
> - if (tricore_feature(env, TRICORE_FEATURE_131)) {
> + if (tricore_has_feature(env, TRICORE_FEATURE_131)) {
> env->DBGTCR = 0;
> }
> }
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] target/tricore: Rename tricore_feature
2023-07-21 6:06 [PATCH] target/tricore: Rename tricore_feature Bastian Koppelmann
2023-07-21 6:35 ` Thomas Huth
@ 2023-07-21 7:31 ` Philippe Mathieu-Daudé
2023-07-21 8:54 ` [PATCH-for-8.1] " Philippe Mathieu-Daudé
1 sibling, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-07-21 7:31 UTC (permalink / raw)
To: Bastian Koppelmann, qemu-devel; +Cc: chenrui333
On 21/7/23 08:06, Bastian Koppelmann wrote:
> this name is used by capstone and will lead to a build failure of QEMU,
> when capstone is enabled. So we rename it to tricore_has_feature(), to
> match has_feature() in translate.c.
>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1774
> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> ---
> target/tricore/cpu.c | 8 ++++----
> target/tricore/cpu.h | 2 +-
> target/tricore/helper.c | 4 ++--
> target/tricore/op_helper.c | 4 ++--
> 4 files changed, 9 insertions(+), 9 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH-for-8.1] target/tricore: Rename tricore_feature
2023-07-21 7:31 ` Philippe Mathieu-Daudé
@ 2023-07-21 8:54 ` Philippe Mathieu-Daudé
2023-07-21 10:01 ` Bastian Koppelmann
0 siblings, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-07-21 8:54 UTC (permalink / raw)
To: Bastian Koppelmann, qemu-devel; +Cc: chenrui333
On 21/7/23 09:31, Philippe Mathieu-Daudé wrote:
> On 21/7/23 08:06, Bastian Koppelmann wrote:
>> this name is used by capstone and will lead to a build failure of QEMU,
>> when capstone is enabled. So we rename it to tricore_has_feature(), to
>> match has_feature() in translate.c.
>>
>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1774
>> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
>> ---
>> target/tricore/cpu.c | 8 ++++----
>> target/tricore/cpu.h | 2 +-
>> target/tricore/helper.c | 4 ++--
>> target/tricore/op_helper.c | 4 ++--
>> 4 files changed, 9 insertions(+), 9 deletions(-)
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
BTW Bastian if you want I can squeeze this single patch in
my mips-fixes PR I'm planning.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH-for-8.1] target/tricore: Rename tricore_feature
2023-07-21 8:54 ` [PATCH-for-8.1] " Philippe Mathieu-Daudé
@ 2023-07-21 10:01 ` Bastian Koppelmann
0 siblings, 0 replies; 5+ messages in thread
From: Bastian Koppelmann @ 2023-07-21 10:01 UTC (permalink / raw)
To: Philippe Mathieu-Daudé; +Cc: qemu-devel, chenrui333
On Fri, Jul 21, 2023 at 10:54:43AM +0200, Philippe Mathieu-Daudé wrote:
> On 21/7/23 09:31, Philippe Mathieu-Daudé wrote:
> > On 21/7/23 08:06, Bastian Koppelmann wrote:
> > > this name is used by capstone and will lead to a build failure of QEMU,
> > > when capstone is enabled. So we rename it to tricore_has_feature(), to
> > > match has_feature() in translate.c.
> > >
> > > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1774
> > > Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> > > ---
> > > target/tricore/cpu.c | 8 ++++----
> > > target/tricore/cpu.h | 2 +-
> > > target/tricore/helper.c | 4 ++--
> > > target/tricore/op_helper.c | 4 ++--
> > > 4 files changed, 9 insertions(+), 9 deletions(-)
> >
> > Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
> BTW Bastian if you want I can squeeze this single patch in
> my mips-fixes PR I'm planning.
Thanks, Phil. Go ahead.
Cheers,
Bastian
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-07-21 10:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-21 6:06 [PATCH] target/tricore: Rename tricore_feature Bastian Koppelmann
2023-07-21 6:35 ` Thomas Huth
2023-07-21 7:31 ` Philippe Mathieu-Daudé
2023-07-21 8:54 ` [PATCH-for-8.1] " Philippe Mathieu-Daudé
2023-07-21 10:01 ` Bastian Koppelmann
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).