target/riscv: Fix the relationship between Zfhmin and Zfh

Zfhmin is part of Zfh, so Zfhmin will be enabled when Zfh is enabled.

Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn>
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20230215020539.4788-2-liweiwei@iscas.ac.cn>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
This commit is contained in:
Weiwei Li 2023-02-15 10:05:26 +08:00 committed by Palmer Dabbelt
parent 6276340310
commit 1d2cb5a868
No known key found for this signature in database
GPG Key ID: 2E1319F35FBB1889

View File

@ -729,7 +729,11 @@ static void riscv_cpu_validate_set_extensions(RISCVCPU *cpu, Error **errp)
return; return;
} }
if ((cpu->cfg.ext_zfh || cpu->cfg.ext_zfhmin) && !cpu->cfg.ext_f) { if (cpu->cfg.ext_zfh) {
cpu->cfg.ext_zfhmin = true;
}
if (cpu->cfg.ext_zfhmin && !cpu->cfg.ext_f) {
error_setg(errp, "Zfh/Zfhmin extensions require F extension"); error_setg(errp, "Zfh/Zfhmin extensions require F extension");
return; return;
} }