@@ -528,13 +528,15 @@ static bool vext_narrow_check_common(DisasContext *s, int vd, int vs2,
528
528
static bool vext_check_ds (DisasContext *s, int vd, int vs, int vm)
529
529
{
530
530
return vext_wide_check_common (s, vd, vm) &&
531
+ vext_check_input_eew (s, vs, s->sew , -1 , 0 , vm) &&
531
532
require_align (vs, s->lmul ) &&
532
533
require_noover (vd, s->lmul + 1 , vs, s->lmul );
533
534
}
534
535
535
536
static bool vext_check_dd (DisasContext *s, int vd, int vs, int vm)
536
537
{
537
538
return vext_wide_check_common (s, vd, vm) &&
539
+ vext_check_input_eew (s, vs, s->sew + 1 , -1 , 0 , vm) &&
538
540
require_align (vs, s->lmul + 1 );
539
541
}
540
542
@@ -553,6 +555,7 @@ static bool vext_check_dd(DisasContext *s, int vd, int vs, int vm)
553
555
static bool vext_check_dss (DisasContext *s, int vd, int vs1, int vs2, int vm)
554
556
{
555
557
return vext_check_ds (s, vd, vs2, vm) &&
558
+ vext_check_input_eew (s, vs1, s->sew , vs2, s->sew , vm) &&
556
559
require_align (vs1, s->lmul ) &&
557
560
require_noover (vd, s->lmul + 1 , vs1, s->lmul );
558
561
}
@@ -575,12 +578,14 @@ static bool vext_check_dss(DisasContext *s, int vd, int vs1, int vs2, int vm)
575
578
static bool vext_check_dds (DisasContext *s, int vd, int vs1, int vs2, int vm)
576
579
{
577
580
return vext_check_ds (s, vd, vs1, vm) &&
581
+ vext_check_input_eew (s, vs1, s->sew , vs2, s->sew + 1 , vm) &&
578
582
require_align (vs2, s->lmul + 1 );
579
583
}
580
584
581
585
static bool vext_check_sd (DisasContext *s, int vd, int vs, int vm)
582
586
{
583
- bool ret = vext_narrow_check_common (s, vd, vs, vm);
587
+ bool ret = vext_narrow_check_common (s, vd, vs, vm) &&
588
+ vext_check_input_eew (s, vs, s->sew + 1 , -1 , 0 , vm);
584
589
if (vd != vs) {
585
590
ret &= require_noover (vd, s->lmul , vs, s->lmul + 1 );
586
591
}
@@ -603,6 +608,7 @@ static bool vext_check_sd(DisasContext *s, int vd, int vs, int vm)
603
608
static bool vext_check_sds (DisasContext *s, int vd, int vs1, int vs2, int vm)
604
609
{
605
610
return vext_check_sd (s, vd, vs2, vm) &&
611
+ vext_check_input_eew (s, vs1, s->sew , vs2, s->sew + 1 , vm) &&
606
612
require_align (vs1, s->lmul );
607
613
}
608
614
@@ -1531,6 +1537,16 @@ static bool opivv_widen_check(DisasContext *s, arg_rmrr *a)
1531
1537
vext_check_dss (s, a->rd , a->rs1 , a->rs2 , a->vm );
1532
1538
}
1533
1539
1540
+ /* OPIVV with overwrite and WIDEN */
1541
+ static bool opivv_overwrite_widen_check (DisasContext *s, arg_rmrr *a)
1542
+ {
1543
+ return require_rvv (s) &&
1544
+ vext_check_isa_ill (s) &&
1545
+ vext_check_dss (s, a->rd , a->rs1 , a->rs2 , a->vm ) &&
1546
+ vext_check_input_eew (s, a->rd , s->sew + 1 , a->rs1 , s->sew , a->vm ) &&
1547
+ vext_check_input_eew (s, a->rd , s->sew + 1 , a->rs2 , s->sew , a->vm );
1548
+ }
1549
+
1534
1550
static bool do_opivv_widen (DisasContext *s, arg_rmrr *a,
1535
1551
gen_helper_gvec_4_ptr *fn,
1536
1552
bool (*checkfn)(DisasContext *, arg_rmrr *))
@@ -1578,6 +1594,14 @@ static bool opivx_widen_check(DisasContext *s, arg_rmrr *a)
1578
1594
vext_check_ds (s, a->rd , a->rs2 , a->vm );
1579
1595
}
1580
1596
1597
+ static bool opivx_overwrite_widen_check (DisasContext *s, arg_rmrr *a)
1598
+ {
1599
+ return require_rvv (s) &&
1600
+ vext_check_isa_ill (s) &&
1601
+ vext_check_ds (s, a->rd , a->rs2 , a->vm ) &&
1602
+ vext_check_input_eew (s, a->rd , s->sew + 1 , a->rs2 , s->sew , a->vm );
1603
+ }
1604
+
1581
1605
#define GEN_OPIVX_WIDEN_TRANS (NAME, CHECK ) \
1582
1606
static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
1583
1607
{ \
@@ -2049,13 +2073,13 @@ GEN_OPIVX_TRANS(vmadd_vx, opivx_check)
2049
2073
GEN_OPIVX_TRANS(vnmsub_vx, opivx_check)
2050
2074
2051
2075
/* Vector Widening Integer Multiply-Add Instructions */
2052
- GEN_OPIVV_WIDEN_TRANS(vwmaccu_vv, opivv_widen_check )
2053
- GEN_OPIVV_WIDEN_TRANS(vwmacc_vv, opivv_widen_check )
2054
- GEN_OPIVV_WIDEN_TRANS(vwmaccsu_vv, opivv_widen_check )
2055
- GEN_OPIVX_WIDEN_TRANS(vwmaccu_vx, opivx_widen_check )
2056
- GEN_OPIVX_WIDEN_TRANS(vwmacc_vx, opivx_widen_check )
2057
- GEN_OPIVX_WIDEN_TRANS(vwmaccsu_vx, opivx_widen_check )
2058
- GEN_OPIVX_WIDEN_TRANS(vwmaccus_vx, opivx_widen_check )
2076
+ GEN_OPIVV_WIDEN_TRANS(vwmaccu_vv, opivv_overwrite_widen_check )
2077
+ GEN_OPIVV_WIDEN_TRANS(vwmacc_vv, opivv_overwrite_widen_check )
2078
+ GEN_OPIVV_WIDEN_TRANS(vwmaccsu_vv, opivv_overwrite_widen_check )
2079
+ GEN_OPIVX_WIDEN_TRANS(vwmaccu_vx, opivx_overwrite_widen_check )
2080
+ GEN_OPIVX_WIDEN_TRANS(vwmacc_vx, opivx_overwrite_widen_check )
2081
+ GEN_OPIVX_WIDEN_TRANS(vwmaccsu_vx, opivx_overwrite_widen_check )
2082
+ GEN_OPIVX_WIDEN_TRANS(vwmaccus_vx, opivx_overwrite_widen_check )
2059
2083
2060
2084
/* Vector Integer Merge and Move Instructions */
2061
2085
static bool trans_vmv_v_v(DisasContext *s, arg_vmv_v_v *a)
@@ -2396,6 +2420,17 @@ static bool opfvv_widen_check(DisasContext *s, arg_rmrr *a)
2396
2420
vext_check_dss (s, a->rd , a->rs1 , a->rs2 , a->vm );
2397
2421
}
2398
2422
2423
+ static bool opfvv_overwrite_widen_check (DisasContext *s, arg_rmrr *a)
2424
+ {
2425
+ return require_rvv (s) &&
2426
+ require_rvf (s) &&
2427
+ require_scale_rvf (s) &&
2428
+ vext_check_isa_ill (s) &&
2429
+ vext_check_dss (s, a->rd , a->rs1 , a->rs2 , a->vm ) &&
2430
+ vext_check_input_eew (s, a->rd , s->sew + 1 , a->rs1 , s->sew , a->vm ) &&
2431
+ vext_check_input_eew (s, a->rd , s->sew + 1 , a->rs2 , s->sew , a->vm );
2432
+ }
2433
+
2399
2434
/* OPFVV with WIDEN */
2400
2435
#define GEN_OPFVV_WIDEN_TRANS (NAME, CHECK ) \
2401
2436
static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
@@ -2435,6 +2470,16 @@ static bool opfvf_widen_check(DisasContext *s, arg_rmrr *a)
2435
2470
vext_check_ds (s, a->rd , a->rs2 , a->vm );
2436
2471
}
2437
2472
2473
+ static bool opfvf_overwrite_widen_check (DisasContext *s, arg_rmrr *a)
2474
+ {
2475
+ return require_rvv (s) &&
2476
+ require_rvf (s) &&
2477
+ require_scale_rvf (s) &&
2478
+ vext_check_isa_ill (s) &&
2479
+ vext_check_ds (s, a->rd , a->rs2 , a->vm ) &&
2480
+ vext_check_input_eew (s, a->rd , s->sew + 1 , a->rs2 , s->sew , a->vm );
2481
+ }
2482
+
2438
2483
/* OPFVF with WIDEN */
2439
2484
#define GEN_OPFVF_WIDEN_TRANS (NAME, CHECK ) \
2440
2485
static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
@@ -2559,14 +2604,14 @@ GEN_OPFVF_TRANS(vfmsub_vf, opfvf_check)
2559
2604
GEN_OPFVF_TRANS(vfnmsub_vf, opfvf_check)
2560
2605
2561
2606
/* Vector Widening Floating-Point Fused Multiply-Add Instructions */
2562
- GEN_OPFVV_WIDEN_TRANS(vfwmacc_vv, opfvv_widen_check )
2563
- GEN_OPFVV_WIDEN_TRANS(vfwnmacc_vv, opfvv_widen_check )
2564
- GEN_OPFVV_WIDEN_TRANS(vfwmsac_vv, opfvv_widen_check )
2565
- GEN_OPFVV_WIDEN_TRANS(vfwnmsac_vv, opfvv_widen_check )
2566
- GEN_OPFVF_WIDEN_TRANS(vfwmacc_vf, opfvf_widen_check )
2567
- GEN_OPFVF_WIDEN_TRANS(vfwnmacc_vf, opfvf_widen_check )
2568
- GEN_OPFVF_WIDEN_TRANS(vfwmsac_vf, opfvf_widen_check )
2569
- GEN_OPFVF_WIDEN_TRANS(vfwnmsac_vf, opfvf_widen_check )
2607
+ GEN_OPFVV_WIDEN_TRANS(vfwmacc_vv, opfvv_overwrite_widen_check )
2608
+ GEN_OPFVV_WIDEN_TRANS(vfwnmacc_vv, opfvv_overwrite_widen_check )
2609
+ GEN_OPFVV_WIDEN_TRANS(vfwmsac_vv, opfvv_overwrite_widen_check )
2610
+ GEN_OPFVV_WIDEN_TRANS(vfwnmsac_vv, opfvv_overwrite_widen_check )
2611
+ GEN_OPFVF_WIDEN_TRANS(vfwmacc_vf, opfvf_overwrite_widen_check )
2612
+ GEN_OPFVF_WIDEN_TRANS(vfwnmacc_vf, opfvf_overwrite_widen_check )
2613
+ GEN_OPFVF_WIDEN_TRANS(vfwmsac_vf, opfvf_overwrite_widen_check )
2614
+ GEN_OPFVF_WIDEN_TRANS(vfwnmsac_vf, opfvf_overwrite_widen_check )
2570
2615
2571
2616
/* Vector Floating-Point Square-Root Instruction */
2572
2617
0 commit comments