40
41
switch (s->sew) {
42
case MO_16:
43
+ if (s->altfmt) {
44
+ return s->cfg_ptr->ext_zvfbfa;
45
+ }
46
return s->cfg_ptr->ext_zvfh;
47
case MO_32:
48
return s->cfg_ptr->ext_zve32f;
61
62
switch (s->sew) {
63
case MO_16:
64
+ if (s->altfmt) {
65
+ return s->cfg_ptr->ext_zvfbfa;
66
+ }
67
return s->cfg_ptr->ext_zvfhmin;
68
case MO_32:
69
return s->cfg_ptr->ext_zve32f;
80
81
switch (s->sew) {
82
case MO_8:
83
+ if (s->altfmt) {
84
+ return s->cfg_ptr->ext_zvfbfa;
85
+ }
86
return s->cfg_ptr->ext_zvfh;
87
case MO_16:
88
return s->cfg_ptr->ext_zve32f;
2343
}
2344
}
2345
2346
+/*
2347
+ * Check altfmt & sew combinations when Zvfbfa extension is enabled.
2348
+ */
2349
+static bool vext_check_altfmt(DisasContext *s, int8_t valid_vsew)
2350
+{
2351
+ if (s->cfg_ptr->ext_zvfbfa) {
2352
+ if (s->altfmt && (valid_vsew == -1 || s->sew != valid_vsew)) {
2353
+ return false;
2354
+ }
2355
+ }
2356
+ return true;
2357
+}
2358
+
2359
/* Vector Single-Width Floating-Point Add/Subtract Instructions */
2360
2361
/*
2362
* If the current SEW does not correspond to a supported IEEE floating-point
2363
* type, an illegal instruction exception is raised.
2364
*/
2343
-static bool opfvv_check(DisasContext *s, arg_rmrr *a)
2365
+static bool opfvv_check(DisasContext *s, arg_rmrr *a, int8_t valid_bfa_vsew)
2366
{
2367
return require_rvv(s) &&
2368
require_rvf(s) &&
2369
vext_check_isa_ill(s) &&
2348
- vext_check_sss(s, a->rd, a->rs1, a->rs2, a->vm);
2370
+ vext_check_sss(s, a->rd, a->rs1, a->rs2, a->vm) &&
2371
+ vext_check_altfmt(s, valid_bfa_vsew);
2372
}
2373
2374
/* OPFVV without GVEC IR */
2375
#define GEN_OPFVV_TRANS(NAME, CHECK) \
2376
static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
2377
{ \
2355
- if (CHECK(s, a)) { \
2378
+ if (CHECK(s, a, -1)) { \
2379
uint32_t data = 0; \
2380
static gen_helper_gvec_4_ptr * const fns[3] = { \
2381
gen_helper_##NAME##_h, \
2401
} \
2402
return false; \
2403
}
2381
-GEN_OPFVV_TRANS(vfadd_vv, opfvv_check)
2382
-GEN_OPFVV_TRANS(vfsub_vv, opfvv_check)
2404
+
2405
+#define GEN_OPFVV_BFA_TRANS(NAME, CHECK, BFA_HELPER) \
2406
+static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
2407
+{ \
2408
+ if (CHECK(s, a, MO_16)) { \
2409
+ uint32_t data = 0; \
2410
+ static gen_helper_gvec_4_ptr * const fns[3] = { \
2411
+ gen_helper_##NAME##_h, \
2412
+ gen_helper_##NAME##_w, \
2413
+ gen_helper_##NAME##_d \
2414
+ }; \
2415
+ gen_set_rm(s, RISCV_FRM_DYN); \
2416
+ \
2417
+ data = FIELD_DP32(data, VDATA, VM, a->vm); \
2418
+ data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
2419
+ data = FIELD_DP32(data, VDATA, VTA, s->vta); \
2420
+ data = FIELD_DP32(data, VDATA, VTA_ALL_1S, s->cfg_vta_all_1s); \
2421
+ data = FIELD_DP32(data, VDATA, VMA, s->vma); \
2422
+ tcg_gen_gvec_4_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, 0), \
2423
+ vreg_ofs(s, a->rs1), \
2424
+ vreg_ofs(s, a->rs2), tcg_env, \
2425
+ s->cfg_ptr->vlenb, \
2426
+ s->cfg_ptr->vlenb, data, \
2427
+ (s->altfmt ? gen_helper_##BFA_HELPER : \
2428
+ fns[s->sew - 1])); \
2429
+ tcg_gen_movi_tl(cpu_vstart, 0); \
2430
+ finalize_rvv_inst(s); \
2431
+ \
2432
+ return true; \
2433
+ } \
2434
+ return false; \
2435
+}
2436
+
2437
+GEN_OPFVV_BFA_TRANS(vfadd_vv, opfvv_check, vfadd_vv_h_bf16)
2438
+GEN_OPFVV_BFA_TRANS(vfsub_vv, opfvv_check, vfsub_vv_h_bf16)
2439
2440
typedef void gen_helper_opfvf(TCGv_ptr, TCGv_ptr, TCGv_i64, TCGv_ptr,
2441
TCGv_env, TCGv_i32);
2471
* If the current SEW does not correspond to a supported IEEE floating-point
2472
* type, an illegal instruction exception is raised
2473
*/
2418
-static bool opfvf_check(DisasContext *s, arg_rmrr *a)
2474
+static bool opfvf_check(DisasContext *s, arg_rmrr *a, int8_t valid_bfa_vsew)
2475
{
2476
return require_rvv(s) &&
2477
require_rvf(s) &&
2478
vext_check_isa_ill(s) &&
2423
- vext_check_ss(s, a->rd, a->rs2, a->vm);
2479
+ vext_check_ss(s, a->rd, a->rs2, a->vm) &&
2480
+ vext_check_altfmt(s, valid_bfa_vsew);
2481
}
2482
2483
/* OPFVF without GVEC IR */
2427
-#define GEN_OPFVF_TRANS(NAME, CHECK) \
2428
-static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
2429
-{ \
2430
- if (CHECK(s, a)) { \
2431
- uint32_t data = 0; \
2432
- static gen_helper_opfvf *const fns[3] = { \
2433
- gen_helper_##NAME##_h, \
2434
- gen_helper_##NAME##_w, \
2435
- gen_helper_##NAME##_d, \
2436
- }; \
2437
- gen_set_rm(s, RISCV_FRM_DYN); \
2438
- data = FIELD_DP32(data, VDATA, VM, a->vm); \
2439
- data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
2440
- data = FIELD_DP32(data, VDATA, VTA, s->vta); \
2441
- data = FIELD_DP32(data, VDATA, VTA_ALL_1S, \
2442
- s->cfg_vta_all_1s); \
2443
- data = FIELD_DP32(data, VDATA, VMA, s->vma); \
2444
- return opfvf_trans(a->rd, a->rs1, a->rs2, data, \
2445
- fns[s->sew - 1], s); \
2446
- } \
2447
- return false; \
2448
-}
2449
-
2450
-GEN_OPFVF_TRANS(vfadd_vf, opfvf_check)
2451
-GEN_OPFVF_TRANS(vfsub_vf, opfvf_check)
2452
-GEN_OPFVF_TRANS(vfrsub_vf, opfvf_check)
2484
+#define GEN_OPFVF_TRANS(NAME, CHECK) \
2485
+static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
2486
+{ \
2487
+ if (CHECK(s, a, -1)) { \
2488
+ uint32_t data = 0; \
2489
+ static gen_helper_opfvf *const fns[3] = { \
2490
+ gen_helper_##NAME##_h, \
2491
+ gen_helper_##NAME##_w, \
2492
+ gen_helper_##NAME##_d, \
2493
+ }; \
2494
+ gen_set_rm(s, RISCV_FRM_DYN); \
2495
+ data = FIELD_DP32(data, VDATA, VM, a->vm); \
2496
+ data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
2497
+ data = FIELD_DP32(data, VDATA, VTA, s->vta); \
2498
+ data = FIELD_DP32(data, VDATA, VTA_ALL_1S, \
2499
+ s->cfg_vta_all_1s); \
2500
+ data = FIELD_DP32(data, VDATA, VMA, s->vma); \
2501
+ return opfvf_trans(a->rd, a->rs1, a->rs2, data, \
2502
+ fns[s->sew - 1], s); \
2503
+ } \
2504
+ return false; \
2505
+}
2506
+
2507
+#define GEN_OPFVF_BFA_TRANS(NAME, CHECK, BFA_HELPER) \
2508
+static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
2509
+{ \
2510
+ if (CHECK(s, a, MO_16)) { \
2511
+ uint32_t data = 0; \
2512
+ static gen_helper_opfvf *const fns[3] = { \
2513
+ gen_helper_##NAME##_h, \
2514
+ gen_helper_##NAME##_w, \
2515
+ gen_helper_##NAME##_d, \
2516
+ }; \
2517
+ gen_set_rm(s, RISCV_FRM_DYN); \
2518
+ data = FIELD_DP32(data, VDATA, VM, a->vm); \
2519
+ data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
2520
+ data = FIELD_DP32(data, VDATA, VTA, s->vta); \
2521
+ data = FIELD_DP32(data, VDATA, VTA_ALL_1S, \
2522
+ s->cfg_vta_all_1s); \
2523
+ data = FIELD_DP32(data, VDATA, VMA, s->vma); \
2524
+ return opfvf_trans(a->rd, a->rs1, a->rs2, data, \
2525
+ (s->altfmt ? gen_helper_##BFA_HELPER : \
2526
+ fns[s->sew - 1]), \
2527
+ s); \
2528
+ } \
2529
+ return false; \
2530
+}
2531
+
2532
+GEN_OPFVF_BFA_TRANS(vfadd_vf, opfvf_check, vfadd_vf_h_bf16)
2533
+GEN_OPFVF_BFA_TRANS(vfsub_vf, opfvf_check, vfsub_vf_h_bf16)
2534
+GEN_OPFVF_BFA_TRANS(vfrsub_vf, opfvf_check, vfrsub_vf_h_bf16)
2535
2536
/* Vector Widening Floating-Point Add/Subtract Instructions */
2455
-static bool opfvv_widen_check(DisasContext *s, arg_rmrr *a)
2537
+static bool opfvv_widen_check(DisasContext *s, arg_rmrr *a,
2538
+ int8_t valid_bfa_vsew)
2539
{
2540
return require_rvv(s) &&
2541
require_rvf(s) &&
2542
require_scale_rvf(s) &&
2543
vext_check_isa_ill(s) &&
2461
- vext_check_dss(s, a->rd, a->rs1, a->rs2, a->vm);
2544
+ vext_check_dss(s, a->rd, a->rs1, a->rs2, a->vm) &&
2545
+ vext_check_altfmt(s, valid_bfa_vsew);
2546
}
2547
2464
-static bool opfvv_overwrite_widen_check(DisasContext *s, arg_rmrr *a)
2548
+static bool opfvv_overwrite_widen_check(DisasContext *s, arg_rmrr *a,
2549
+ int8_t valid_bfa_vsew)
2550
{
2466
- return require_rvv(s) &&
2467
- require_rvf(s) &&
2468
- require_scale_rvf(s) &&
2469
- vext_check_isa_ill(s) &&
2470
- vext_check_dss(s, a->rd, a->rs1, a->rs2, a->vm) &&
2551
+ return opfvv_widen_check(s, a, valid_bfa_vsew) &&
2552
vext_check_input_eew(s, a->rd, s->sew + 1, a->rs1, s->sew, a->vm) &&
2553
vext_check_input_eew(s, a->rd, s->sew + 1, a->rs2, s->sew, a->vm);
2554
}
2555
2556
/* OPFVV with WIDEN */
2476
-#define GEN_OPFVV_WIDEN_TRANS(NAME, CHECK) \
2477
-static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
2478
-{ \
2479
- if (CHECK(s, a)) { \
2480
- uint32_t data = 0; \
2481
- static gen_helper_gvec_4_ptr * const fns[2] = { \
2482
- gen_helper_##NAME##_h, gen_helper_##NAME##_w, \
2483
- }; \
2484
- gen_set_rm(s, RISCV_FRM_DYN); \
2485
- \
2486
- data = FIELD_DP32(data, VDATA, VM, a->vm); \
2487
- data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
2488
- data = FIELD_DP32(data, VDATA, VTA, s->vta); \
2489
- data = FIELD_DP32(data, VDATA, VMA, s->vma); \
2490
- tcg_gen_gvec_4_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, 0), \
2491
- vreg_ofs(s, a->rs1), \
2492
- vreg_ofs(s, a->rs2), tcg_env, \
2493
- s->cfg_ptr->vlenb, \
2494
- s->cfg_ptr->vlenb, data, \
2495
- fns[s->sew - 1]); \
2496
- finalize_rvv_inst(s); \
2497
- return true; \
2498
- } \
2499
- return false; \
2500
-}
2501
-
2502
-GEN_OPFVV_WIDEN_TRANS(vfwadd_vv, opfvv_widen_check)
2503
-GEN_OPFVV_WIDEN_TRANS(vfwsub_vv, opfvv_widen_check)
2504
-
2505
-static bool opfvf_widen_check(DisasContext *s, arg_rmrr *a)
2557
+#define GEN_OPFVV_WIDEN_TRANS(NAME, CHECK) \
2558
+static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
2559
+{ \
2560
+ if (CHECK(s, a, -1)) { \
2561
+ uint32_t data = 0; \
2562
+ static gen_helper_gvec_4_ptr * const fns[2] = { \
2563
+ gen_helper_##NAME##_h, gen_helper_##NAME##_w, \
2564
+ }; \
2565
+ gen_set_rm(s, RISCV_FRM_DYN); \
2566
+ \
2567
+ data = FIELD_DP32(data, VDATA, VM, a->vm); \
2568
+ data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
2569
+ data = FIELD_DP32(data, VDATA, VTA, s->vta); \
2570
+ data = FIELD_DP32(data, VDATA, VMA, s->vma); \
2571
+ tcg_gen_gvec_4_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, 0), \
2572
+ vreg_ofs(s, a->rs1), \
2573
+ vreg_ofs(s, a->rs2), tcg_env, \
2574
+ s->cfg_ptr->vlenb, \
2575
+ s->cfg_ptr->vlenb, data, \
2576
+ fns[s->sew - 1]); \
2577
+ finalize_rvv_inst(s); \
2578
+ return true; \
2579
+ } \
2580
+ return false; \
2581
+}
2582
+
2583
+#define GEN_OPFVV_WIDEN_BFA_TRANS(NAME, CHECK, BFA_HELPER) \
2584
+static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
2585
+{ \
2586
+ if (CHECK(s, a, MO_16)) { \
2587
+ uint32_t data = 0; \
2588
+ static gen_helper_gvec_4_ptr * const fns[2] = { \
2589
+ gen_helper_##NAME##_h, \
2590
+ gen_helper_##NAME##_w \
2591
+ }; \
2592
+ gen_set_rm(s, RISCV_FRM_DYN); \
2593
+ \
2594
+ data = FIELD_DP32(data, VDATA, VM, a->vm); \
2595
+ data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
2596
+ data = FIELD_DP32(data, VDATA, VTA, s->vta); \
2597
+ data = FIELD_DP32(data, VDATA, VMA, s->vma); \
2598
+ tcg_gen_gvec_4_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, 0), \
2599
+ vreg_ofs(s, a->rs1), \
2600
+ vreg_ofs(s, a->rs2), tcg_env, \
2601
+ s->cfg_ptr->vlenb, \
2602
+ s->cfg_ptr->vlenb, data, \
2603
+ (s->altfmt ? gen_helper_##BFA_HELPER : \
2604
+ fns[s->sew - 1])); \
2605
+ finalize_rvv_inst(s); \
2606
+ return true; \
2607
+ } \
2608
+ return false; \
2609
+}
2610
+
2611
+GEN_OPFVV_WIDEN_BFA_TRANS(vfwadd_vv, opfvv_widen_check, vfwadd_vv_h_bf16)
2612
+GEN_OPFVV_WIDEN_BFA_TRANS(vfwsub_vv, opfvv_widen_check, vfwsub_vv_h_bf16)
2613
+
2614
+static bool opfvf_widen_check(DisasContext *s, arg_rmrr *a,
2615
+ int8_t valid_bfa_vsew)
2616
{
2617
return require_rvv(s) &&
2618
require_rvf(s) &&
2619
require_scale_rvf(s) &&
2620
vext_check_isa_ill(s) &&
2511
- vext_check_ds(s, a->rd, a->rs2, a->vm);
2621
+ vext_check_ds(s, a->rd, a->rs2, a->vm) &&
2622
+ vext_check_altfmt(s, valid_bfa_vsew);
2623
}
2624
2514
-static bool opfvf_overwrite_widen_check(DisasContext *s, arg_rmrr *a)
2625
+static bool opfvf_overwrite_widen_check(DisasContext *s, arg_rmrr *a,
2626
+ int8_t valid_bfa_vsew)
2627
{
2516
- return require_rvv(s) &&
2517
- require_rvf(s) &&
2518
- require_scale_rvf(s) &&
2519
- vext_check_isa_ill(s) &&
2520
- vext_check_ds(s, a->rd, a->rs2, a->vm) &&
2628
+ return opfvf_widen_check(s, a, valid_bfa_vsew) &&
2629
vext_check_input_eew(s, a->rd, s->sew + 1, a->rs2, s->sew, a->vm);
2630
}
2631
2632
/* OPFVF with WIDEN */
2525
-#define GEN_OPFVF_WIDEN_TRANS(NAME, CHECK) \
2526
-static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
2527
-{ \
2528
- if (CHECK(s, a)) { \
2529
- uint32_t data = 0; \
2530
- static gen_helper_opfvf *const fns[2] = { \
2531
- gen_helper_##NAME##_h, gen_helper_##NAME##_w, \
2532
- }; \
2533
- gen_set_rm(s, RISCV_FRM_DYN); \
2534
- data = FIELD_DP32(data, VDATA, VM, a->vm); \
2535
- data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
2536
- data = FIELD_DP32(data, VDATA, VTA, s->vta); \
2537
- data = FIELD_DP32(data, VDATA, VMA, s->vma); \
2538
- return opfvf_trans(a->rd, a->rs1, a->rs2, data, \
2539
- fns[s->sew - 1], s); \
2540
- } \
2541
- return false; \
2542
-}
2543
-
2544
-GEN_OPFVF_WIDEN_TRANS(vfwadd_vf, opfvf_widen_check)
2545
-GEN_OPFVF_WIDEN_TRANS(vfwsub_vf, opfvf_widen_check)
2546
-
2547
-static bool opfwv_widen_check(DisasContext *s, arg_rmrr *a)
2633
+#define GEN_OPFVF_WIDEN_BFA_TRANS(NAME, CHECK, BFA_HELPER) \
2634
+static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
2635
+{ \
2636
+ if (CHECK(s, a, MO_16)) { \
2637
+ uint32_t data = 0; \
2638
+ static gen_helper_opfvf *const fns[2] = { \
2639
+ gen_helper_##NAME##_h, \
2640
+ gen_helper_##NAME##_w, \
2641
+ }; \
2642
+ gen_set_rm(s, RISCV_FRM_DYN); \
2643
+ data = FIELD_DP32(data, VDATA, VM, a->vm); \
2644
+ data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
2645
+ data = FIELD_DP32(data, VDATA, VTA, s->vta); \
2646
+ data = FIELD_DP32(data, VDATA, VMA, s->vma); \
2647
+ return opfvf_trans(a->rd, a->rs1, a->rs2, data, \
2648
+ (s->altfmt ? gen_helper_##BFA_HELPER : \
2649
+ fns[s->sew - 1]), \
2650
+ s); \
2651
+ } \
2652
+ return false; \
2653
+}
2654
+
2655
+GEN_OPFVF_WIDEN_BFA_TRANS(vfwadd_vf, opfvf_widen_check, vfwadd_vf_h_bf16)
2656
+GEN_OPFVF_WIDEN_BFA_TRANS(vfwsub_vf, opfvf_widen_check, vfwsub_vf_h_bf16)
2657
+
2658
+static bool opfwv_widen_check(DisasContext *s, arg_rmrr *a,
2659
+ int8_t valid_bfa_vsew)
2660
{
2661
return require_rvv(s) &&
2662
require_rvf(s) &&
2663
require_scale_rvf(s) &&
2664
vext_check_isa_ill(s) &&
2553
- vext_check_dds(s, a->rd, a->rs1, a->rs2, a->vm);
2665
+ vext_check_dds(s, a->rd, a->rs1, a->rs2, a->vm) &&
2666
+ vext_check_altfmt(s, valid_bfa_vsew);
2667
}
2668
2669
/* WIDEN OPFVV with WIDEN */
2557
-#define GEN_OPFWV_WIDEN_TRANS(NAME) \
2558
-static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
2559
-{ \
2560
- if (opfwv_widen_check(s, a)) { \
2561
- uint32_t data = 0; \
2562
- static gen_helper_gvec_4_ptr * const fns[2] = { \
2563
- gen_helper_##NAME##_h, gen_helper_##NAME##_w, \
2564
- }; \
2565
- gen_set_rm(s, RISCV_FRM_DYN); \
2566
- \
2567
- data = FIELD_DP32(data, VDATA, VM, a->vm); \
2568
- data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
2569
- data = FIELD_DP32(data, VDATA, VTA, s->vta); \
2570
- data = FIELD_DP32(data, VDATA, VMA, s->vma); \
2571
- tcg_gen_gvec_4_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, 0), \
2572
- vreg_ofs(s, a->rs1), \
2573
- vreg_ofs(s, a->rs2), tcg_env, \
2574
- s->cfg_ptr->vlenb, \
2575
- s->cfg_ptr->vlenb, data, \
2576
- fns[s->sew - 1]); \
2577
- finalize_rvv_inst(s); \
2578
- return true; \
2579
- } \
2580
- return false; \
2670
+#define GEN_OPFWV_WIDEN_BFA_TRANS(NAME) \
2671
+static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
2672
+{ \
2673
+ if (opfwv_widen_check(s, a, MO_16)) { \
2674
+ uint32_t data = 0; \
2675
+ static gen_helper_gvec_4_ptr * const fns[2] = { \
2676
+ gen_helper_##NAME##_h, \
2677
+ gen_helper_##NAME##_w \
2678
+ }; \
2679
+ gen_set_rm(s, RISCV_FRM_DYN); \
2680
+ \
2681
+ data = FIELD_DP32(data, VDATA, VM, a->vm); \
2682
+ data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
2683
+ data = FIELD_DP32(data, VDATA, VTA, s->vta); \
2684
+ data = FIELD_DP32(data, VDATA, VMA, s->vma); \
2685
+ tcg_gen_gvec_4_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, 0), \
2686
+ vreg_ofs(s, a->rs1), \
2687
+ vreg_ofs(s, a->rs2), tcg_env, \
2688
+ s->cfg_ptr->vlenb, \
2689
+ s->cfg_ptr->vlenb, data, \
2690
+ (s->altfmt ? gen_helper_##NAME##_h_bf16 : \
2691
+ fns[s->sew - 1])); \
2692
+ finalize_rvv_inst(s); \
2693
+ return true; \
2694
+ } \
2695
+ return false; \
2696
}
2697
2583
-GEN_OPFWV_WIDEN_TRANS(vfwadd_wv)
2584
-GEN_OPFWV_WIDEN_TRANS(vfwsub_wv)
2698
+GEN_OPFWV_WIDEN_BFA_TRANS(vfwadd_wv)
2699
+GEN_OPFWV_WIDEN_BFA_TRANS(vfwsub_wv)
2700
2586
-static bool opfwf_widen_check(DisasContext *s, arg_rmrr *a)
2701
+static bool opfwf_widen_check(DisasContext *s, arg_rmrr *a,
2702
+ int8_t valid_bfa_vsew)
2703
{
2704
return require_rvv(s) &&
2705
require_rvf(s) &&
2706
require_scale_rvf(s) &&
2707
vext_check_isa_ill(s) &&
2592
- vext_check_dd(s, a->rd, a->rs2, a->vm);
2708
+ vext_check_dd(s, a->rd, a->rs2, a->vm) &&
2709
+ vext_check_altfmt(s, valid_bfa_vsew);
2710
}
2711
2712
/* WIDEN OPFVF with WIDEN */
2596
-#define GEN_OPFWF_WIDEN_TRANS(NAME) \
2597
-static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
2598
-{ \
2599
- if (opfwf_widen_check(s, a)) { \
2600
- uint32_t data = 0; \
2601
- static gen_helper_opfvf *const fns[2] = { \
2602
- gen_helper_##NAME##_h, gen_helper_##NAME##_w, \
2603
- }; \
2604
- gen_set_rm(s, RISCV_FRM_DYN); \
2605
- data = FIELD_DP32(data, VDATA, VM, a->vm); \
2606
- data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
2607
- data = FIELD_DP32(data, VDATA, VTA, s->vta); \
2608
- data = FIELD_DP32(data, VDATA, VMA, s->vma); \
2609
- return opfvf_trans(a->rd, a->rs1, a->rs2, data, \
2610
- fns[s->sew - 1], s); \
2611
- } \
2612
- return false; \
2613
-}
2614
-
2615
-GEN_OPFWF_WIDEN_TRANS(vfwadd_wf)
2616
-GEN_OPFWF_WIDEN_TRANS(vfwsub_wf)
2713
+#define GEN_OPFWF_WIDEN_BFA_TRANS(NAME) \
2714
+static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
2715
+{ \
2716
+ if (opfwf_widen_check(s, a, MO_16)) { \
2717
+ uint32_t data = 0; \
2718
+ static gen_helper_opfvf *const fns[2] = { \
2719
+ gen_helper_##NAME##_h, \
2720
+ gen_helper_##NAME##_w \
2721
+ }; \
2722
+ gen_set_rm(s, RISCV_FRM_DYN); \
2723
+ data = FIELD_DP32(data, VDATA, VM, a->vm); \
2724
+ data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
2725
+ data = FIELD_DP32(data, VDATA, VTA, s->vta); \
2726
+ data = FIELD_DP32(data, VDATA, VMA, s->vma); \
2727
+ return opfvf_trans(a->rd, a->rs1, a->rs2, data, \
2728
+ (s->altfmt ? gen_helper_##NAME##_h_bf16 : \
2729
+ fns[s->sew - 1]), \
2730
+ s); \
2731
+ } \
2732
+ return false; \
2733
+}
2734
+
2735
+GEN_OPFWF_WIDEN_BFA_TRANS(vfwadd_wf)
2736
+GEN_OPFWF_WIDEN_BFA_TRANS(vfwsub_wf)
2737
2738
/* Vector Single-Width Floating-Point Multiply/Divide Instructions */
2619
-GEN_OPFVV_TRANS(vfmul_vv, opfvv_check)
2739
+GEN_OPFVV_BFA_TRANS(vfmul_vv, opfvv_check, vfmul_vv_h_bf16)
2740
GEN_OPFVV_TRANS(vfdiv_vv, opfvv_check)
2621
-GEN_OPFVF_TRANS(vfmul_vf, opfvf_check)
2741
+GEN_OPFVF_BFA_TRANS(vfmul_vf, opfvf_check, vfmul_vf_h_bf16)
2742
GEN_OPFVF_TRANS(vfdiv_vf, opfvf_check)
2743
GEN_OPFVF_TRANS(vfrdiv_vf, opfvf_check)
2744
2745
/* Vector Widening Floating-Point Multiply */
2626
-GEN_OPFVV_WIDEN_TRANS(vfwmul_vv, opfvv_widen_check)
2627
-GEN_OPFVF_WIDEN_TRANS(vfwmul_vf, opfvf_widen_check)
2746
+GEN_OPFVV_WIDEN_BFA_TRANS(vfwmul_vv, opfvv_widen_check, vfwmul_vv_h_bf16)
2747
+GEN_OPFVF_WIDEN_BFA_TRANS(vfwmul_vf, opfvf_widen_check, vfwmul_vf_h_bf16)
2748
2749
/* Vector Single-Width Floating-Point Fused Multiply-Add Instructions */
2630
-GEN_OPFVV_TRANS(vfmacc_vv, opfvv_check)
2631
-GEN_OPFVV_TRANS(vfnmacc_vv, opfvv_check)
2632
-GEN_OPFVV_TRANS(vfmsac_vv, opfvv_check)
2633
-GEN_OPFVV_TRANS(vfnmsac_vv, opfvv_check)
2634
-GEN_OPFVV_TRANS(vfmadd_vv, opfvv_check)
2635
-GEN_OPFVV_TRANS(vfnmadd_vv, opfvv_check)
2636
-GEN_OPFVV_TRANS(vfmsub_vv, opfvv_check)
2637
-GEN_OPFVV_TRANS(vfnmsub_vv, opfvv_check)
2638
-GEN_OPFVF_TRANS(vfmacc_vf, opfvf_check)
2639
-GEN_OPFVF_TRANS(vfnmacc_vf, opfvf_check)
2640
-GEN_OPFVF_TRANS(vfmsac_vf, opfvf_check)
2641
-GEN_OPFVF_TRANS(vfnmsac_vf, opfvf_check)
2642
-GEN_OPFVF_TRANS(vfmadd_vf, opfvf_check)
2643
-GEN_OPFVF_TRANS(vfnmadd_vf, opfvf_check)
2644
-GEN_OPFVF_TRANS(vfmsub_vf, opfvf_check)
2645
-GEN_OPFVF_TRANS(vfnmsub_vf, opfvf_check)
2750
+GEN_OPFVV_BFA_TRANS(vfmacc_vv, opfvv_check, vfmacc_vv_h_bf16)
2751
+GEN_OPFVV_BFA_TRANS(vfnmacc_vv, opfvv_check, vfnmacc_vv_h_bf16)
2752
+GEN_OPFVV_BFA_TRANS(vfmsac_vv, opfvv_check, vfmsac_vv_h_bf16)
2753
+GEN_OPFVV_BFA_TRANS(vfnmsac_vv, opfvv_check, vfnmsac_vv_h_bf16)
2754
+GEN_OPFVV_BFA_TRANS(vfmadd_vv, opfvv_check, vfmadd_vv_h_bf16)
2755
+GEN_OPFVV_BFA_TRANS(vfnmadd_vv, opfvv_check, vfnmadd_vv_h_bf16)
2756
+GEN_OPFVV_BFA_TRANS(vfmsub_vv, opfvv_check, vfmsub_vv_h_bf16)
2757
+GEN_OPFVV_BFA_TRANS(vfnmsub_vv, opfvv_check, vfnmsub_vv_h_bf16)
2758
+GEN_OPFVF_BFA_TRANS(vfmacc_vf, opfvf_check, vfmacc_vf_h_bf16)
2759
+GEN_OPFVF_BFA_TRANS(vfnmacc_vf, opfvf_check, vfnmacc_vf_h_bf16)
2760
+GEN_OPFVF_BFA_TRANS(vfmsac_vf, opfvf_check, vfmsac_vf_h_bf16)
2761
+GEN_OPFVF_BFA_TRANS(vfnmsac_vf, opfvf_check, vfnmsac_vf_h_bf16)
2762
+GEN_OPFVF_BFA_TRANS(vfmadd_vf, opfvf_check, vfmadd_vf_h_bf16)
2763
+GEN_OPFVF_BFA_TRANS(vfnmadd_vf, opfvf_check, vfnmadd_vf_h_bf16)
2764
+GEN_OPFVF_BFA_TRANS(vfmsub_vf, opfvf_check, vfmsub_vf_h_bf16)
2765
+GEN_OPFVF_BFA_TRANS(vfnmsub_vf, opfvf_check, vfnmsub_vf_h_bf16)
2766
2767
/* Vector Widening Floating-Point Fused Multiply-Add Instructions */
2648
-GEN_OPFVV_WIDEN_TRANS(vfwmacc_vv, opfvv_overwrite_widen_check)
2649
-GEN_OPFVV_WIDEN_TRANS(vfwnmacc_vv, opfvv_overwrite_widen_check)
2650
-GEN_OPFVV_WIDEN_TRANS(vfwmsac_vv, opfvv_overwrite_widen_check)
2651
-GEN_OPFVV_WIDEN_TRANS(vfwnmsac_vv, opfvv_overwrite_widen_check)
2652
-GEN_OPFVF_WIDEN_TRANS(vfwmacc_vf, opfvf_overwrite_widen_check)
2653
-GEN_OPFVF_WIDEN_TRANS(vfwnmacc_vf, opfvf_overwrite_widen_check)
2654
-GEN_OPFVF_WIDEN_TRANS(vfwmsac_vf, opfvf_overwrite_widen_check)
2655
-GEN_OPFVF_WIDEN_TRANS(vfwnmsac_vf, opfvf_overwrite_widen_check)
2768
+GEN_OPFVV_WIDEN_BFA_TRANS(vfwmacc_vv, opfvv_overwrite_widen_check,
2769
+ vfwmaccbf16_vv)
2770
+GEN_OPFVV_WIDEN_BFA_TRANS(vfwnmacc_vv, opfvv_overwrite_widen_check,
2771
+ vfwnmacc_vv_h_bf16)
2772
+GEN_OPFVV_WIDEN_BFA_TRANS(vfwmsac_vv, opfvv_overwrite_widen_check,
2773
+ vfwmsac_vv_h_bf16)
2774
+GEN_OPFVV_WIDEN_BFA_TRANS(vfwnmsac_vv, opfvv_overwrite_widen_check,
2775
+ vfwnmsac_vv_h_bf16)
2776
+GEN_OPFVF_WIDEN_BFA_TRANS(vfwmacc_vf, opfvf_overwrite_widen_check,
2777
+ vfwmaccbf16_vf)
2778
+GEN_OPFVF_WIDEN_BFA_TRANS(vfwnmacc_vf, opfvf_overwrite_widen_check,
2779
+ vfwnmacc_vf_h_bf16)
2780
+GEN_OPFVF_WIDEN_BFA_TRANS(vfwmsac_vf, opfvf_overwrite_widen_check,
2781
+ vfwmsac_vf_h_bf16)
2782
+GEN_OPFVF_WIDEN_BFA_TRANS(vfwnmsac_vf, opfvf_overwrite_widen_check,
2783
+ vfwnmsac_vf_h_bf16)
2784
2785
/* Vector Floating-Point Square-Root Instruction */
2786
2788
* If the current SEW does not correspond to a supported IEEE floating-point
2789
* type, an illegal instruction exception is raised
2790
*/
2663
-static bool opfv_check(DisasContext *s, arg_rmr *a)
2791
+static bool opfv_check(DisasContext *s, arg_rmr *a, int8_t valid_bfa_vsew)
2792
{
2793
return require_rvv(s) &&
2794
require_rvf(s) &&
2795
vext_check_isa_ill(s) &&
2796
/* OPFV instructions ignore vs1 check */
2669
- vext_check_ss(s, a->rd, a->rs2, a->vm);
2797
+ vext_check_ss(s, a->rd, a->rs2, a->vm) &&
2798
+ vext_check_altfmt(s, valid_bfa_vsew);
2799
}
2800
2801
static bool do_opfv(DisasContext *s, arg_rmr *a,
2802
gen_helper_gvec_3_ptr *fn,
2674
- bool (*checkfn)(DisasContext *, arg_rmr *),
2675
- int rm)
2803
+ bool (*checkfn)(DisasContext *, arg_rmr *, int8_t),
2804
+ int rm,
2805
+ int8_t valid_bfa_vsew)
2806
{
2677
- if (checkfn(s, a)) {
2807
+ if (checkfn(s, a, valid_bfa_vsew)) {
2808
uint32_t data = 0;
2809
gen_set_rm_chkfrm(s, rm);
2810
2822
return false;
2823
}
2824
2695
-#define GEN_OPFV_TRANS(NAME, CHECK, FRM) \
2696
-static bool trans_##NAME(DisasContext *s, arg_rmr *a) \
2697
-{ \
2698
- static gen_helper_gvec_3_ptr * const fns[3] = { \
2699
- gen_helper_##NAME##_h, \
2700
- gen_helper_##NAME##_w, \
2701
- gen_helper_##NAME##_d \
2702
- }; \
2703
- return do_opfv(s, a, fns[s->sew - 1], CHECK, FRM); \
2825
+#define GEN_OPFV_TRANS(NAME, CHECK, FRM) \
2826
+static bool trans_##NAME(DisasContext *s, arg_rmr *a) \
2827
+{ \
2828
+ static gen_helper_gvec_3_ptr * const fns[3] = { \
2829
+ gen_helper_##NAME##_h, \
2830
+ gen_helper_##NAME##_w, \
2831
+ gen_helper_##NAME##_d \
2832
+ }; \
2833
+ return do_opfv(s, a, fns[s->sew - 1], CHECK, FRM, -1); \
2834
+}
2835
+
2836
+#define GEN_OPFV_BFA_TRANS(NAME, CHECK, FRM) \
2837
+static bool trans_##NAME(DisasContext *s, arg_rmr *a) \
2838
+{ \
2839
+ static gen_helper_gvec_3_ptr * const fns[3] = { \
2840
+ gen_helper_##NAME##_h, \
2841
+ gen_helper_##NAME##_w, \
2842
+ gen_helper_##NAME##_d \
2843
+ }; \
2844
+ return do_opfv(s, a, \
2845
+ (s->altfmt ? gen_helper_##NAME##_h_bf16 : \
2846
+ fns[s->sew - 1]), \
2847
+ CHECK, FRM, MO_16); \
2848
}
2849
2850
GEN_OPFV_TRANS(vfsqrt_v, opfv_check, RISCV_FRM_DYN)
2707
-GEN_OPFV_TRANS(vfrsqrt7_v, opfv_check, RISCV_FRM_DYN)
2708
-GEN_OPFV_TRANS(vfrec7_v, opfv_check, RISCV_FRM_DYN)
2851
+GEN_OPFV_BFA_TRANS(vfrsqrt7_v, opfv_check, RISCV_FRM_DYN)
2852
+GEN_OPFV_BFA_TRANS(vfrec7_v, opfv_check, RISCV_FRM_DYN)
2853
2854
/* Vector Floating-Point MIN/MAX Instructions */
2711
-GEN_OPFVV_TRANS(vfmin_vv, opfvv_check)
2712
-GEN_OPFVV_TRANS(vfmax_vv, opfvv_check)
2713
-GEN_OPFVF_TRANS(vfmin_vf, opfvf_check)
2714
-GEN_OPFVF_TRANS(vfmax_vf, opfvf_check)
2855
+GEN_OPFVV_BFA_TRANS(vfmin_vv, opfvv_check, vfmin_vv_h_bf16)
2856
+GEN_OPFVV_BFA_TRANS(vfmax_vv, opfvv_check, vfmax_vv_h_bf16)
2857
+GEN_OPFVF_BFA_TRANS(vfmin_vf, opfvf_check, vfmin_vf_h_bf16)
2858
+GEN_OPFVF_BFA_TRANS(vfmax_vf, opfvf_check, vfmax_vf_h_bf16)
2859
2860
/* Vector Floating-Point Sign-Injection Instructions */
2717
-GEN_OPFVV_TRANS(vfsgnj_vv, opfvv_check)
2718
-GEN_OPFVV_TRANS(vfsgnjn_vv, opfvv_check)
2719
-GEN_OPFVV_TRANS(vfsgnjx_vv, opfvv_check)
2720
-GEN_OPFVF_TRANS(vfsgnj_vf, opfvf_check)
2721
-GEN_OPFVF_TRANS(vfsgnjn_vf, opfvf_check)
2722
-GEN_OPFVF_TRANS(vfsgnjx_vf, opfvf_check)
2861
+GEN_OPFVV_BFA_TRANS(vfsgnj_vv, opfvv_check, vfsgnj_vv_h)
2862
+GEN_OPFVV_BFA_TRANS(vfsgnjn_vv, opfvv_check, vfsgnjn_vv_h)
2863
+GEN_OPFVV_BFA_TRANS(vfsgnjx_vv, opfvv_check, vfsgnjx_vv_h)
2864
+GEN_OPFVF_BFA_TRANS(vfsgnj_vf, opfvf_check, vfsgnj_vf_h)
2865
+GEN_OPFVF_BFA_TRANS(vfsgnjn_vf, opfvf_check, vfsgnjn_vf_h)
2866
+GEN_OPFVF_BFA_TRANS(vfsgnjx_vf, opfvf_check, vfsgnjx_vf_h)
2867
2868
/* Vector Floating-Point Compare Instructions */
2725
-static bool opfvv_cmp_check(DisasContext *s, arg_rmrr *a)
2869
+static bool opfvv_cmp_check(DisasContext *s, arg_rmrr *a,
2870
+ int8_t valid_bfa_vsew)
2871
{
2872
return require_rvv(s) &&
2873
require_rvf(s) &&
2874
vext_check_isa_ill(s) &&
2730
- vext_check_mss(s, a->rd, a->rs1, a->rs2);
2875
+ vext_check_mss(s, a->rd, a->rs1, a->rs2) &&
2876
+ vext_check_altfmt(s, valid_bfa_vsew);
2877
}
2878
2733
-GEN_OPFVV_TRANS(vmfeq_vv, opfvv_cmp_check)
2734
-GEN_OPFVV_TRANS(vmfne_vv, opfvv_cmp_check)
2735
-GEN_OPFVV_TRANS(vmflt_vv, opfvv_cmp_check)
2736
-GEN_OPFVV_TRANS(vmfle_vv, opfvv_cmp_check)
2879
+GEN_OPFVV_BFA_TRANS(vmfeq_vv, opfvv_cmp_check, vmfeq_vv_h_bf16)
2880
+GEN_OPFVV_BFA_TRANS(vmfne_vv, opfvv_cmp_check, vmfne_vv_h_bf16)
2881
+GEN_OPFVV_BFA_TRANS(vmflt_vv, opfvv_cmp_check, vmflt_vv_h_bf16)
2882
+GEN_OPFVV_BFA_TRANS(vmfle_vv, opfvv_cmp_check, vmfle_vv_h_bf16)
2883
2738
-static bool opfvf_cmp_check(DisasContext *s, arg_rmrr *a)
2884
+static bool opfvf_cmp_check(DisasContext *s, arg_rmrr *a,
2885
+ int8_t valid_bfa_vsew)
2886
{
2887
return require_rvv(s) &&
2888
require_rvf(s) &&
2889
vext_check_isa_ill(s) &&
2743
- vext_check_ms(s, a->rd, a->rs2);
2890
+ vext_check_ms(s, a->rd, a->rs2) &&
2891
+ vext_check_altfmt(s, valid_bfa_vsew);
2892
}
2893
2746
-GEN_OPFVF_TRANS(vmfeq_vf, opfvf_cmp_check)
2747
-GEN_OPFVF_TRANS(vmfne_vf, opfvf_cmp_check)
2748
-GEN_OPFVF_TRANS(vmflt_vf, opfvf_cmp_check)
2749
-GEN_OPFVF_TRANS(vmfle_vf, opfvf_cmp_check)
2750
-GEN_OPFVF_TRANS(vmfgt_vf, opfvf_cmp_check)
2751
-GEN_OPFVF_TRANS(vmfge_vf, opfvf_cmp_check)
2894
+GEN_OPFVF_BFA_TRANS(vmfeq_vf, opfvf_cmp_check, vmfeq_vf_h_bf16)
2895
+GEN_OPFVF_BFA_TRANS(vmfne_vf, opfvf_cmp_check, vmfne_vf_h_bf16)
2896
+GEN_OPFVF_BFA_TRANS(vmflt_vf, opfvf_cmp_check, vmflt_vf_h_bf16)
2897
+GEN_OPFVF_BFA_TRANS(vmfle_vf, opfvf_cmp_check, vmfle_vf_h_bf16)
2898
+GEN_OPFVF_BFA_TRANS(vmfgt_vf, opfvf_cmp_check, vmfgt_vf_h_bf16)
2899
+GEN_OPFVF_BFA_TRANS(vmfge_vf, opfvf_cmp_check, vmfge_vf_h_bf16)
2900
2901
/* Vector Floating-Point Classify Instruction */
2754
-GEN_OPFV_TRANS(vfclass_v, opfv_check, RISCV_FRM_DYN)
2902
+GEN_OPFV_BFA_TRANS(vfclass_v, opfv_check, RISCV_FRM_DYN)
2903
2904
/* Vector Floating-Point Merge Instruction */
2757
-GEN_OPFVF_TRANS(vfmerge_vfm, opfvf_check)
2905
+GEN_OPFVF_BFA_TRANS(vfmerge_vfm, opfvf_check, vfmerge_vfm_h)
2906
2907
static bool trans_vfmv_v_f(DisasContext *s, arg_vfmv_v_f *a)
2908
{
2909
if (require_rvv(s) &&
2910
require_rvf(s) &&
2911
vext_check_isa_ill(s) &&
2764
- require_align(a->rd, s->lmul)) {
2912
+ require_align(a->rd, s->lmul) &&
2913
+ vext_check_altfmt(s, MO_16)) {
2914
gen_set_rm(s, RISCV_FRM_DYN);
2915
2916
TCGv_i64 t1;
2931
static gen_helper_vmv_vx * const fns[3] = {
2932
gen_helper_vmv_v_x_h,
2933
gen_helper_vmv_v_x_w,
2785
- gen_helper_vmv_v_x_d,
2934
+ gen_helper_vmv_v_x_d
2935
};
2936
2937
t1 = tcg_temp_new_i64();
2952
}
2953
2954
/* Single-Width Floating-Point/Integer Type-Convert Instructions */
2806
-#define GEN_OPFV_CVT_TRANS(NAME, HELPER, FRM) \
2807
-static bool trans_##NAME(DisasContext *s, arg_rmr *a) \
2808
-{ \
2809
- static gen_helper_gvec_3_ptr * const fns[3] = { \
2810
- gen_helper_##HELPER##_h, \
2811
- gen_helper_##HELPER##_w, \
2812
- gen_helper_##HELPER##_d \
2813
- }; \
2814
- return do_opfv(s, a, fns[s->sew - 1], opfv_check, FRM); \
2955
+#define GEN_OPFV_CVT_TRANS(NAME, HELPER, FRM) \
2956
+static bool trans_##NAME(DisasContext *s, arg_rmr *a) \
2957
+{ \
2958
+ static gen_helper_gvec_3_ptr * const fns[3] = { \
2959
+ gen_helper_##HELPER##_h, \
2960
+ gen_helper_##HELPER##_w, \
2961
+ gen_helper_##HELPER##_d \
2962
+ }; \
2963
+ return do_opfv(s, a, fns[s->sew - 1], opfv_check, FRM, -1); \
2964
}
2965
2966
GEN_OPFV_CVT_TRANS(vfcvt_xu_f_v, vfcvt_xu_f_v, RISCV_FRM_DYN)
2984
vext_check_ds(s, a->rd, a->rs2, a->vm);
2985
}
2986
2838
-static bool opxfv_widen_check(DisasContext *s, arg_rmr *a)
2987
+static bool opxfv_widen_check(DisasContext *s, arg_rmr *a,
2988
+ int8_t valid_bfa_vsew)
2989
{
2990
return opfv_widen_check(s, a) &&
2841
- require_rvf(s);
2991
+ require_rvf(s) &&
2992
+ vext_check_altfmt(s, valid_bfa_vsew);
2993
}
2994
2844
-static bool opffv_widen_check(DisasContext *s, arg_rmr *a)
2995
+static bool opffv_widen_check(DisasContext *s, arg_rmr *a,
2996
+ int8_t valid_bfa_vsew)
2997
{
2998
return opfv_widen_check(s, a) &&
2999
require_rvfmin(s) &&
2848
- require_scale_rvfmin(s);
2849
-}
2850
-
2851
-#define GEN_OPFV_WIDEN_TRANS(NAME, CHECK, HELPER, FRM) \
2852
-static bool trans_##NAME(DisasContext *s, arg_rmr *a) \
2853
-{ \
2854
- if (CHECK(s, a)) { \
2855
- uint32_t data = 0; \
2856
- static gen_helper_gvec_3_ptr * const fns[2] = { \
2857
- gen_helper_##HELPER##_h, \
2858
- gen_helper_##HELPER##_w, \
2859
- }; \
2860
- gen_set_rm_chkfrm(s, FRM); \
2861
- \
2862
- data = FIELD_DP32(data, VDATA, VM, a->vm); \
2863
- data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
2864
- data = FIELD_DP32(data, VDATA, VTA, s->vta); \
2865
- data = FIELD_DP32(data, VDATA, VMA, s->vma); \
2866
- tcg_gen_gvec_3_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, 0), \
2867
- vreg_ofs(s, a->rs2), tcg_env, \
2868
- s->cfg_ptr->vlenb, \
2869
- s->cfg_ptr->vlenb, data, \
2870
- fns[s->sew - 1]); \
2871
- finalize_rvv_inst(s); \
2872
- return true; \
2873
- } \
2874
- return false; \
3000
+ require_scale_rvfmin(s) &&
3001
+ vext_check_altfmt(s, valid_bfa_vsew);
3002
+}
3003
+
3004
+#define GEN_OPFV_WIDEN_TRANS(NAME, CHECK, HELPER, FRM) \
3005
+static bool trans_##NAME(DisasContext *s, arg_rmr *a) \
3006
+{ \
3007
+ if (CHECK(s, a, -1)) { \
3008
+ uint32_t data = 0; \
3009
+ static gen_helper_gvec_3_ptr * const fns[2] = { \
3010
+ gen_helper_##HELPER##_h, \
3011
+ gen_helper_##HELPER##_w, \
3012
+ }; \
3013
+ gen_set_rm_chkfrm(s, FRM); \
3014
+ \
3015
+ data = FIELD_DP32(data, VDATA, VM, a->vm); \
3016
+ data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
3017
+ data = FIELD_DP32(data, VDATA, VTA, s->vta); \
3018
+ data = FIELD_DP32(data, VDATA, VMA, s->vma); \
3019
+ tcg_gen_gvec_3_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, 0), \
3020
+ vreg_ofs(s, a->rs2), tcg_env, \
3021
+ s->cfg_ptr->vlenb, \
3022
+ s->cfg_ptr->vlenb, data, \
3023
+ fns[s->sew - 1]); \
3024
+ finalize_rvv_inst(s); \
3025
+ return true; \
3026
+ } \
3027
+ return false; \
3028
+}
3029
+
3030
+#define GEN_OPFV_WIDEN_BFA_TRANS(NAME, CHECK, HELPER, FRM, BFA_HELPER) \
3031
+static bool trans_##NAME(DisasContext *s, arg_rmr *a) \
3032
+{ \
3033
+ if (CHECK(s, a, MO_16)) { \
3034
+ uint32_t data = 0; \
3035
+ static gen_helper_gvec_3_ptr * const fns[2] = { \
3036
+ gen_helper_##HELPER##_h, \
3037
+ gen_helper_##HELPER##_w, \
3038
+ }; \
3039
+ gen_set_rm_chkfrm(s, FRM); \
3040
+ \
3041
+ data = FIELD_DP32(data, VDATA, VM, a->vm); \
3042
+ data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
3043
+ data = FIELD_DP32(data, VDATA, VTA, s->vta); \
3044
+ data = FIELD_DP32(data, VDATA, VMA, s->vma); \
3045
+ tcg_gen_gvec_3_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, 0), \
3046
+ vreg_ofs(s, a->rs2), tcg_env, \
3047
+ s->cfg_ptr->vlenb, \
3048
+ s->cfg_ptr->vlenb, data, \
3049
+ (s->altfmt ? gen_helper_##BFA_HELPER : \
3050
+ fns[s->sew - 1])); \
3051
+ finalize_rvv_inst(s); \
3052
+ return true; \
3053
+ } \
3054
+ return false; \
3055
}
3056
3057
GEN_OPFV_WIDEN_TRANS(vfwcvt_xu_f_v, opxfv_widen_check, vfwcvt_xu_f_v,
3058
RISCV_FRM_DYN)
3059
GEN_OPFV_WIDEN_TRANS(vfwcvt_x_f_v, opxfv_widen_check, vfwcvt_x_f_v,
3060
RISCV_FRM_DYN)
2881
-GEN_OPFV_WIDEN_TRANS(vfwcvt_f_f_v, opffv_widen_check, vfwcvt_f_f_v,
2882
- RISCV_FRM_DYN)
3061
+GEN_OPFV_WIDEN_BFA_TRANS(vfwcvt_f_f_v, opffv_widen_check, vfwcvt_f_f_v,
3062
+ RISCV_FRM_DYN, vfwcvtbf16_f_f_v)
3063
/* Reuse the helper functions from vfwcvt.xu.f.v and vfwcvt.x.f.v */
3064
GEN_OPFV_WIDEN_TRANS(vfwcvt_rtz_xu_f_v, opxfv_widen_check, vfwcvt_xu_f_v,
3065
RISCV_FRM_RTZ)
3066
GEN_OPFV_WIDEN_TRANS(vfwcvt_rtz_x_f_v, opxfv_widen_check, vfwcvt_x_f_v,
3067
RISCV_FRM_RTZ)
3068
2889
-static bool opfxv_widen_check(DisasContext *s, arg_rmr *a)
3069
+static bool opfxv_widen_check(DisasContext *s, arg_rmr *a,
3070
+ int8_t valid_bfa_vsew)
3071
{
3072
return require_rvv(s) &&
3073
require_scale_rvf(s) &&
3074
vext_check_isa_ill(s) &&
3075
/* OPFV widening instructions ignore vs1 check */
2895
- vext_check_ds(s, a->rd, a->rs2, a->vm);
3076
+ vext_check_ds(s, a->rd, a->rs2, a->vm) &&
3077
+ vext_check_altfmt(s, valid_bfa_vsew);
3078
}
3079
2898
-#define GEN_OPFXV_WIDEN_TRANS(NAME) \
2899
-static bool trans_##NAME(DisasContext *s, arg_rmr *a) \
2900
-{ \
2901
- if (opfxv_widen_check(s, a)) { \
2902
- uint32_t data = 0; \
2903
- static gen_helper_gvec_3_ptr * const fns[3] = { \
2904
- gen_helper_##NAME##_b, \
2905
- gen_helper_##NAME##_h, \
2906
- gen_helper_##NAME##_w, \
2907
- }; \
2908
- gen_set_rm(s, RISCV_FRM_DYN); \
2909
- \
2910
- data = FIELD_DP32(data, VDATA, VM, a->vm); \
2911
- data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
2912
- data = FIELD_DP32(data, VDATA, VTA, s->vta); \
2913
- data = FIELD_DP32(data, VDATA, VMA, s->vma); \
2914
- tcg_gen_gvec_3_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, 0), \
2915
- vreg_ofs(s, a->rs2), tcg_env, \
2916
- s->cfg_ptr->vlenb, \
2917
- s->cfg_ptr->vlenb, data, \
2918
- fns[s->sew]); \
2919
- finalize_rvv_inst(s); \
2920
- return true; \
2921
- } \
2922
- return false; \
3080
+#define GEN_OPFXV_WIDEN_BFA_TRANS(NAME) \
3081
+static bool trans_##NAME(DisasContext *s, arg_rmr *a) \
3082
+{ \
3083
+ if (opfxv_widen_check(s, a, MO_8)) { \
3084
+ uint32_t data = 0; \
3085
+ static gen_helper_gvec_3_ptr * const fns[3] = { \
3086
+ gen_helper_##NAME##_b, \
3087
+ gen_helper_##NAME##_h, \
3088
+ gen_helper_##NAME##_w \
3089
+ }; \
3090
+ gen_set_rm(s, RISCV_FRM_DYN); \
3091
+ \
3092
+ data = FIELD_DP32(data, VDATA, VM, a->vm); \
3093
+ data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
3094
+ data = FIELD_DP32(data, VDATA, VTA, s->vta); \
3095
+ data = FIELD_DP32(data, VDATA, VMA, s->vma); \
3096
+ tcg_gen_gvec_3_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, 0), \
3097
+ vreg_ofs(s, a->rs2), tcg_env, \
3098
+ s->cfg_ptr->vlenb, \
3099
+ s->cfg_ptr->vlenb, data, \
3100
+ (s->altfmt ? gen_helper_##NAME##_b_bf16 : \
3101
+ fns[s->sew])); \
3102
+ finalize_rvv_inst(s); \
3103
+ return true; \
3104
+ } \
3105
+ return false; \
3106
}
3107
2925
-GEN_OPFXV_WIDEN_TRANS(vfwcvt_f_xu_v)
2926
-GEN_OPFXV_WIDEN_TRANS(vfwcvt_f_x_v)
3108
+GEN_OPFXV_WIDEN_BFA_TRANS(vfwcvt_f_xu_v)
3109
+GEN_OPFXV_WIDEN_BFA_TRANS(vfwcvt_f_x_v)
3110
3111
/* Narrowing Floating-Point/Integer Type-Convert Instructions */
3112
3122
vext_check_sd(s, a->rd, a->rs2, a->vm);
3123
}
3124
2942
-static bool opfxv_narrow_check(DisasContext *s, arg_rmr *a)
3125
+static bool opfxv_narrow_check(DisasContext *s, arg_rmr *a,
3126
+ int8_t valid_bfa_vsew)
3127
{
3128
return opfv_narrow_check(s, a) &&
3129
require_rvf(s) &&
2946
- (s->sew != MO_64);
3130
+ (s->sew != MO_64) &&
3131
+ vext_check_altfmt(s, valid_bfa_vsew);
3132
}
3133
2949
-static bool opffv_narrow_check(DisasContext *s, arg_rmr *a)
3134
+static bool opffv_narrow_check(DisasContext *s, arg_rmr *a,
3135
+ int8_t valid_bfa_vsew)
3136
{
3137
return opfv_narrow_check(s, a) &&
3138
require_rvfmin(s) &&
2953
- require_scale_rvfmin(s);
3139
+ require_scale_rvfmin(s) &&
3140
+ vext_check_altfmt(s, valid_bfa_vsew);
3141
}
3142
2956
-static bool opffv_rod_narrow_check(DisasContext *s, arg_rmr *a)
3143
+static bool opffv_rod_narrow_check(DisasContext *s, arg_rmr *a,
3144
+ int8_t valid_bfa_vsew)
3145
{
3146
return opfv_narrow_check(s, a) &&
3147
require_rvf(s) &&
2960
- require_scale_rvf(s);
2961
-}
2962
-
2963
-#define GEN_OPFV_NARROW_TRANS(NAME, CHECK, HELPER, FRM) \
2964
-static bool trans_##NAME(DisasContext *s, arg_rmr *a) \
2965
-{ \
2966
- if (CHECK(s, a)) { \
2967
- uint32_t data = 0; \
2968
- static gen_helper_gvec_3_ptr * const fns[2] = { \
2969
- gen_helper_##HELPER##_h, \
2970
- gen_helper_##HELPER##_w, \
2971
- }; \
2972
- gen_set_rm_chkfrm(s, FRM); \
2973
- \
2974
- data = FIELD_DP32(data, VDATA, VM, a->vm); \
2975
- data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
2976
- data = FIELD_DP32(data, VDATA, VTA, s->vta); \
2977
- data = FIELD_DP32(data, VDATA, VMA, s->vma); \
2978
- tcg_gen_gvec_3_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, 0), \
2979
- vreg_ofs(s, a->rs2), tcg_env, \
2980
- s->cfg_ptr->vlenb, \
2981
- s->cfg_ptr->vlenb, data, \
2982
- fns[s->sew - 1]); \
2983
- finalize_rvv_inst(s); \
2984
- return true; \
2985
- } \
2986
- return false; \
3148
+ require_scale_rvf(s) &&
3149
+ vext_check_altfmt(s, valid_bfa_vsew);
3150
+}
3151
+
3152
+#define GEN_OPFV_NARROW_TRANS(NAME, CHECK, HELPER, FRM) \
3153
+static bool trans_##NAME(DisasContext *s, arg_rmr *a) \
3154
+{ \
3155
+ if (CHECK(s, a, -1)) { \
3156
+ uint32_t data = 0; \
3157
+ static gen_helper_gvec_3_ptr * const fns[2] = { \
3158
+ gen_helper_##HELPER##_h, \
3159
+ gen_helper_##HELPER##_w, \
3160
+ }; \
3161
+ gen_set_rm_chkfrm(s, FRM); \
3162
+ \
3163
+ data = FIELD_DP32(data, VDATA, VM, a->vm); \
3164
+ data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
3165
+ data = FIELD_DP32(data, VDATA, VTA, s->vta); \
3166
+ data = FIELD_DP32(data, VDATA, VMA, s->vma); \
3167
+ tcg_gen_gvec_3_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, 0), \
3168
+ vreg_ofs(s, a->rs2), tcg_env, \
3169
+ s->cfg_ptr->vlenb, \
3170
+ s->cfg_ptr->vlenb, data, \
3171
+ fns[s->sew - 1]); \
3172
+ finalize_rvv_inst(s); \
3173
+ return true; \
3174
+ } \
3175
+ return false; \
3176
+}
3177
+
3178
+#define GEN_OPFV_NARROW_BFA_TRANS(NAME, CHECK, HELPER, FRM, BFA_HELPER) \
3179
+static bool trans_##NAME(DisasContext *s, arg_rmr *a) \
3180
+{ \
3181
+ if (CHECK(s, a, MO_16)) { \
3182
+ uint32_t data = 0; \
3183
+ static gen_helper_gvec_3_ptr * const fns[2] = { \
3184
+ gen_helper_##HELPER##_h, \
3185
+ gen_helper_##HELPER##_w, \
3186
+ }; \
3187
+ gen_set_rm_chkfrm(s, FRM); \
3188
+ \
3189
+ data = FIELD_DP32(data, VDATA, VM, a->vm); \
3190
+ data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
3191
+ data = FIELD_DP32(data, VDATA, VTA, s->vta); \
3192
+ data = FIELD_DP32(data, VDATA, VMA, s->vma); \
3193
+ tcg_gen_gvec_3_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, 0), \
3194
+ vreg_ofs(s, a->rs2), tcg_env, \
3195
+ s->cfg_ptr->vlenb, \
3196
+ s->cfg_ptr->vlenb, data, \
3197
+ (s->altfmt ? gen_helper_##BFA_HELPER : \
3198
+ fns[s->sew - 1])); \
3199
+ finalize_rvv_inst(s); \
3200
+ return true; \
3201
+ } \
3202
+ return false; \
3203
}
3204
3205
GEN_OPFV_NARROW_TRANS(vfncvt_f_xu_w, opfxv_narrow_check, vfncvt_f_xu_w,
3206
RISCV_FRM_DYN)
3207
GEN_OPFV_NARROW_TRANS(vfncvt_f_x_w, opfxv_narrow_check, vfncvt_f_x_w,
3208
RISCV_FRM_DYN)
2993
-GEN_OPFV_NARROW_TRANS(vfncvt_f_f_w, opffv_narrow_check, vfncvt_f_f_w,
2994
- RISCV_FRM_DYN)
3209
+GEN_OPFV_NARROW_BFA_TRANS(vfncvt_f_f_w, opffv_narrow_check, vfncvt_f_f_w,
3210
+ RISCV_FRM_DYN, vfncvtbf16_f_f_w)
3211
/* Reuse the helper function from vfncvt.f.f.w */
2996
-GEN_OPFV_NARROW_TRANS(vfncvt_rod_f_f_w, opffv_rod_narrow_check, vfncvt_f_f_w,
2997
- RISCV_FRM_ROD)
3212
+GEN_OPFV_NARROW_BFA_TRANS(vfncvt_rod_f_f_w, opffv_rod_narrow_check,
3213
+ vfncvt_f_f_w, RISCV_FRM_ROD, vfncvtbf16_f_f_w)
3214
2999
-static bool opxfv_narrow_check(DisasContext *s, arg_rmr *a)
3215
+static bool opxfv_narrow_check(DisasContext *s, arg_rmr *a,
3216
+ int8_t valid_bfa_vsew)
3217
{
3218
return require_rvv(s) &&
3219
require_scale_rvf(s) &&
3220
vext_check_isa_ill(s) &&
3221
/* OPFV narrowing instructions ignore vs1 check */
3005
- vext_check_sd(s, a->rd, a->rs2, a->vm);
3222
+ vext_check_sd(s, a->rd, a->rs2, a->vm) &&
3223
+ vext_check_altfmt(s, valid_bfa_vsew);
3224
}
3225
3008
-#define GEN_OPXFV_NARROW_TRANS(NAME, HELPER, FRM) \
3009
-static bool trans_##NAME(DisasContext *s, arg_rmr *a) \
3010
-{ \
3011
- if (opxfv_narrow_check(s, a)) { \
3012
- uint32_t data = 0; \
3013
- static gen_helper_gvec_3_ptr * const fns[3] = { \
3014
- gen_helper_##HELPER##_b, \
3015
- gen_helper_##HELPER##_h, \
3016
- gen_helper_##HELPER##_w, \
3017
- }; \
3018
- gen_set_rm_chkfrm(s, FRM); \
3019
- \
3020
- data = FIELD_DP32(data, VDATA, VM, a->vm); \
3021
- data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
3022
- data = FIELD_DP32(data, VDATA, VTA, s->vta); \
3023
- data = FIELD_DP32(data, VDATA, VMA, s->vma); \
3024
- tcg_gen_gvec_3_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, 0), \
3025
- vreg_ofs(s, a->rs2), tcg_env, \
3026
- s->cfg_ptr->vlenb, \
3027
- s->cfg_ptr->vlenb, data, \
3028
- fns[s->sew]); \
3029
- finalize_rvv_inst(s); \
3030
- return true; \
3031
- } \
3032
- return false; \
3226
+#define GEN_OPXFV_NARROW_BFA_TRANS(NAME, HELPER, FRM) \
3227
+static bool trans_##NAME(DisasContext *s, arg_rmr *a) \
3228
+{ \
3229
+ if (opxfv_narrow_check(s, a, MO_8)) { \
3230
+ uint32_t data = 0; \
3231
+ static gen_helper_gvec_3_ptr * const fns[3] = { \
3232
+ gen_helper_##HELPER##_b, \
3233
+ gen_helper_##HELPER##_h, \
3234
+ gen_helper_##HELPER##_w \
3235
+ }; \
3236
+ gen_set_rm_chkfrm(s, FRM); \
3237
+ \
3238
+ data = FIELD_DP32(data, VDATA, VM, a->vm); \
3239
+ data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
3240
+ data = FIELD_DP32(data, VDATA, VTA, s->vta); \
3241
+ data = FIELD_DP32(data, VDATA, VMA, s->vma); \
3242
+ tcg_gen_gvec_3_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, 0), \
3243
+ vreg_ofs(s, a->rs2), tcg_env, \
3244
+ s->cfg_ptr->vlenb, \
3245
+ s->cfg_ptr->vlenb, data, \
3246
+ (s->altfmt ? gen_helper_##HELPER##_b_bf16 : \
3247
+ fns[s->sew])); \
3248
+ finalize_rvv_inst(s); \
3249
+ return true; \
3250
+ } \
3251
+ return false; \
3252
}
3253
3035
-GEN_OPXFV_NARROW_TRANS(vfncvt_xu_f_w, vfncvt_xu_f_w, RISCV_FRM_DYN)
3036
-GEN_OPXFV_NARROW_TRANS(vfncvt_x_f_w, vfncvt_x_f_w, RISCV_FRM_DYN)
3254
+GEN_OPXFV_NARROW_BFA_TRANS(vfncvt_xu_f_w, vfncvt_xu_f_w, RISCV_FRM_DYN)
3255
+GEN_OPXFV_NARROW_BFA_TRANS(vfncvt_x_f_w, vfncvt_x_f_w, RISCV_FRM_DYN)
3256
/* Reuse the helper functions from vfncvt.xu.f.w and vfncvt.x.f.w */
3038
-GEN_OPXFV_NARROW_TRANS(vfncvt_rtz_xu_f_w, vfncvt_xu_f_w, RISCV_FRM_RTZ)
3039
-GEN_OPXFV_NARROW_TRANS(vfncvt_rtz_x_f_w, vfncvt_x_f_w, RISCV_FRM_RTZ)
3257
+GEN_OPXFV_NARROW_BFA_TRANS(vfncvt_rtz_xu_f_w, vfncvt_xu_f_w, RISCV_FRM_RTZ)
3258
+GEN_OPXFV_NARROW_BFA_TRANS(vfncvt_rtz_x_f_w, vfncvt_x_f_w, RISCV_FRM_RTZ)
3259
3260
/*
3261
*** Vector Reduction Operations
3288
GEN_OPIVV_WIDEN_TRANS(vwredsumu_vs, reduction_widen_check)
3289
3290
/* Vector Single-Width Floating-Point Reduction Instructions */
3072
-static bool freduction_check(DisasContext *s, arg_rmrr *a)
3291
+static bool freduction_check(DisasContext *s, arg_rmrr *a,
3292
+ int8_t valid_bfa_vsew)
3293
{
3294
return reduction_check(s, a) &&
3075
- require_rvf(s);
3295
+ require_rvf(s) &&
3296
+ vext_check_altfmt(s, valid_bfa_vsew);
3297
}
3298
3299
GEN_OPFVV_TRANS(vfredusum_vs, freduction_check)
3302
GEN_OPFVV_TRANS(vfredmin_vs, freduction_check)
3303
3304
/* Vector Widening Floating-Point Reduction Instructions */
3084
-static bool freduction_widen_check(DisasContext *s, arg_rmrr *a)
3305
+static bool freduction_widen_check(DisasContext *s, arg_rmrr *a,
3306
+ int8_t valid_bfa_vsew)
3307
{
3308
return reduction_widen_check(s, a) &&
3309
require_rvf(s) &&
3088
- require_scale_rvf(s);
3310
+ require_scale_rvf(s) &&
3311
+ vext_check_altfmt(s, valid_bfa_vsew);
3312
}
3313
3314
GEN_OPFVV_WIDEN_TRANS(vfwredusum_vs, freduction_widen_check)
3723
{
3724
if (require_rvv(s) &&
3725
require_rvf(s) &&
3503
- vext_check_isa_ill(s)) {
3726
+ vext_check_isa_ill(s) &&
3727
+ vext_check_altfmt(s, MO_16)) {
3728
gen_set_rm(s, RISCV_FRM_DYN);
3729
3730
/* The instructions ignore LMUL and vector register group. */
3818
GEN_OPIVX_VSLIDE1_TRANS(vslide1down_vx, slidedown_check)
3819
3820
/* Vector Floating-Point Slide Instructions */
3597
-static bool fslideup_check(DisasContext *s, arg_rmrr *a)
3821
+static bool fslideup_check(DisasContext *s, arg_rmrr *a,
3822
+ int8_t valid_bfa_vsew)
3823
{
3824
return slideup_check(s, a) &&
3600
- require_rvf(s);
3825
+ require_rvf(s) &&
3826
+ vext_check_altfmt(s, valid_bfa_vsew);
3827
}
3828
3603
-static bool fslidedown_check(DisasContext *s, arg_rmrr *a)
3829
+static bool fslidedown_check(DisasContext *s, arg_rmrr *a,
3830
+ int8_t valid_bfa_vsew)
3831
{
3832
return slidedown_check(s, a) &&
3606
- require_rvf(s);
3833
+ require_rvf(s) &&
3834
+ vext_check_altfmt(s, valid_bfa_vsew);
3835
}
3836
3609
-GEN_OPFVF_TRANS(vfslide1up_vf, fslideup_check)
3610
-GEN_OPFVF_TRANS(vfslide1down_vf, fslidedown_check)
3837
+GEN_OPFVF_BFA_TRANS(vfslide1up_vf, fslideup_check, vfslide1up_vf_h)
3838
+GEN_OPFVF_BFA_TRANS(vfslide1down_vf, fslidedown_check, vfslide1down_vf_h)
3839
3840
/* Vector Register Gather Instruction */
3841
static bool vrgather_vv_check(DisasContext *s, arg_rmrr *a)