@ -13584,6 +13584,32 @@ static void disas_crypto_two_reg_sha(DisasContext *s, uint32_t insn)
tcg_temp_free_ptr ( tcg_rn_ptr ) ;
}
static void gen_rax1_i64 ( TCGv_i64 d , TCGv_i64 n , TCGv_i64 m )
{
tcg_gen_rotli_i64 ( d , m , 1 ) ;
tcg_gen_xor_i64 ( d , d , n ) ;
}
static void gen_rax1_vec ( unsigned vece , TCGv_vec d , TCGv_vec n , TCGv_vec m )
{
tcg_gen_rotli_vec ( vece , d , m , 1 ) ;
tcg_gen_xor_vec ( vece , d , d , n ) ;
}
void gen_gvec_rax1 ( unsigned vece , uint32_t rd_ofs , uint32_t rn_ofs ,
uint32_t rm_ofs , uint32_t opr_sz , uint32_t max_sz )
{
static const TCGOpcode vecop_list [ ] = { INDEX_op_rotli_vec , 0 } ;
static const GVecGen3 op = {
. fni8 = gen_rax1_i64 ,
. fniv = gen_rax1_vec ,
. opt_opc = vecop_list ,
. fno = gen_helper_crypto_rax1 ,
. vece = MO_64 ,
} ;
tcg_gen_gvec_3 ( rd_ofs , rn_ofs , rm_ofs , opr_sz , max_sz , & op ) ;
}
/* Crypto three-reg SHA512
* 31 21 20 16 15 14 13 12 11 10 9 5 4 0
* + - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - + - - - + - - - + - - - - - + - - - - - - - - + - - - - - - + - - - - - - +
@ -13600,6 +13626,7 @@ static void disas_crypto_three_reg_sha512(DisasContext *s, uint32_t insn)
bool feature ;
CryptoThreeOpFn * genfn = NULL ;
gen_helper_gvec_3 * oolfn = NULL ;
GVecGen3Fn * gvecfn = NULL ;
if ( o = = 0 ) {
switch ( opcode ) {
@ -13617,7 +13644,7 @@ static void disas_crypto_three_reg_sha512(DisasContext *s, uint32_t insn)
break ;
case 3 : /* RAX1 */
feature = dc_isar_feature ( aa64_sha3 , s ) ;
genfn = NULL ;
gvecfn = gen_gvec_rax1 ;
break ;
default :
g_assert_not_reached ( ) ;
@ -13653,10 +13680,9 @@ static void disas_crypto_three_reg_sha512(DisasContext *s, uint32_t insn)
if ( oolfn ) {
gen_gvec_op3_ool ( s , true , rd , rn , rm , 0 , oolfn ) ;
return ;
}
if ( genfn ) {
} else if ( gvecfn ) {
gen_gvec_fn3 ( s , true , rd , rn , rm , gvecfn , MO_64 ) ;
} else {
TCGv_ptr tcg_rd_ptr , tcg_rn_ptr , tcg_rm_ptr ;
tcg_rd_ptr = vec_full_reg_ptr ( s , rd ) ;
@ -13668,29 +13694,6 @@ static void disas_crypto_three_reg_sha512(DisasContext *s, uint32_t insn)
tcg_temp_free_ptr ( tcg_rd_ptr ) ;
tcg_temp_free_ptr ( tcg_rn_ptr ) ;
tcg_temp_free_ptr ( tcg_rm_ptr ) ;
} else {
TCGv_i64 tcg_op1 , tcg_op2 , tcg_res [ 2 ] ;
int pass ;
tcg_op1 = tcg_temp_new_i64 ( ) ;
tcg_op2 = tcg_temp_new_i64 ( ) ;
tcg_res [ 0 ] = tcg_temp_new_i64 ( ) ;
tcg_res [ 1 ] = tcg_temp_new_i64 ( ) ;
for ( pass = 0 ; pass < 2 ; pass + + ) {
read_vec_element ( s , tcg_op1 , rn , pass , MO_64 ) ;
read_vec_element ( s , tcg_op2 , rm , pass , MO_64 ) ;
tcg_gen_rotli_i64 ( tcg_res [ pass ] , tcg_op2 , 1 ) ;
tcg_gen_xor_i64 ( tcg_res [ pass ] , tcg_res [ pass ] , tcg_op1 ) ;
}
write_vec_element ( s , tcg_res [ 0 ] , rd , 0 , MO_64 ) ;
write_vec_element ( s , tcg_res [ 1 ] , rd , 1 , MO_64 ) ;
tcg_temp_free_i64 ( tcg_op1 ) ;
tcg_temp_free_i64 ( tcg_op2 ) ;
tcg_temp_free_i64 ( tcg_res [ 0 ] ) ;
tcg_temp_free_i64 ( tcg_res [ 1 ] ) ;
}
}