RE: [PATCH v2 09/19] target/ppc: Implement DCFFIXQQ

2021-09-01 Thread Luis Fernando Fujita Pires
From: Matheus K. Ferst 
> > On 8/31/21 9:39 AM, Luis Pires wrote:
> >> +DEF_HELPER_3(DCFFIXQQ, void, env, fprp, avr)
> >
> > Shouldn't be upcase.  None of the others are.
> >
> 
> The reason for this change is on patch 13 and onwards. Matching the case of 
> the
> instruction name in the trans_ method and the helper makes it easier to
> create macros, e.g. TRANS_DFP_BF_A_DCM on patch 13. The idea was to
> change the helpers as we moved instructions to decodetree.
> 
> Alternatively, the macro could receive the instruction name and the
> gen_helper_, or we could drop this kind of macro usage in favor of
> something else. The former is a bit repetitive, while the latter would require
> more changes in the current code structure.

And our intention is also to send a standalone patch later on, changing to 
uppercase the other new (decodetree) helpers whose names are directly related 
to instruction names, making them consistent.

--
Luis Pires
Instituto de Pesquisas ELDORADO
Aviso Legal - Disclaimer 


Re: [PATCH v2 09/19] target/ppc: Implement DCFFIXQQ

2021-09-01 Thread Matheus K. Ferst

On 31/08/2021 15:18, Richard Henderson wrote:

[E-MAIL EXTERNO] Não clique em links ou abra anexos, a menos que você
 possa confirmar o remetente e saber que o conteúdo é seguro. Em caso
de e-mail suspeito entre imediatamente em contato com o DTI.

On 8/31/21 9:39 AM, Luis Pires wrote:

+DEF_HELPER_3(DCFFIXQQ, void, env, fprp, avr)


Shouldn't be upcase.  None of the others are.



The reason for this change is on patch 13 and onwards. Matching the case 
of the instruction name in the trans_ method and the helper makes 
it easier to create macros, e.g. TRANS_DFP_BF_A_DCM on patch 13. The 
idea was to change the helpers as we moved instructions to decodetree.


Alternatively, the macro could receive the instruction name and the 
gen_helper_, or we could drop this kind of macro usage in favor of 
something else. The former is a bit repetitive, while the latter would 
require more changes in the current code structure.



diff --git a/target/ppc/translate.c b/target/ppc/translate.c index
5489b4b6e0..c3739f7370 100644 --- a/target/ppc/translate.c +++
b/target/ppc/translate.c @@ -7422,7 +7422,12 @@ static inline void
set_avr64(int regno, TCGv_i64 src, bool high) /* * Helpers for
decodetree used by !function for decoding arguments. */ -static int
times_4(DisasContext *ctx, int x) +static inline int
times_2(DisasContext *ctx, int x) +{ +return x * 2; +} + 
+static inline int times_4(DisasContext *ctx, int x)


Don't add the inlines. The compiler will decide for itself, and this
hides unused function errors under gcc that are diagnosed by clang.


r~




--
Matheus K. Ferst
Instituto de Pesquisas ELDORADO 
Analista de Software Júnior
Aviso Legal - Disclaimer 



Re: [PATCH v2 09/19] target/ppc: Implement DCFFIXQQ

2021-08-31 Thread Richard Henderson

On 8/31/21 9:39 AM, Luis Pires wrote:

+DEF_HELPER_3(DCFFIXQQ, void, env, fprp, avr)


Shouldn't be upcase.  None of the others are.


diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 5489b4b6e0..c3739f7370 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -7422,7 +7422,12 @@ static inline void set_avr64(int regno, TCGv_i64 src, 
bool high)
  /*
   * Helpers for decodetree used by !function for decoding arguments.
   */
-static int times_4(DisasContext *ctx, int x)
+static inline int times_2(DisasContext *ctx, int x)
+{
+return x * 2;
+}
+
+static inline int times_4(DisasContext *ctx, int x)


Don't add the inlines.
The compiler will decide for itself, and this hides unused function errors under gcc that 
are diagnosed by clang.



r~