On 10/18/23 01:59, Song Gao wrote:
Some users may not need LSX/LASX, this patch allows the user
enable/disable LSX/LASX features.
e.g
'-cpu max,lsx=on,lasx=on' (default);
'-cpu max,lsx=on,lasx=off' (enabled LSX);
'-cpu max,lsx=off,lasx=on' (error, need lsx=on);
'-cpu max,lsx=off' (disable LSX and LASX).
...
+ /* CPU has LSX */
+ bool has_lsx;
+ /* CPU has LASX */
+ bool has_lasx;
Why do you need these variables?
I suspect that you've copied them from one of the more complex Arm cases where we need to
resolve multiple properties simultaneously during realize.
You'll get identical behaviour in your current code if you drop these and rely only on the
CPUCFG2 bits.
If you wanted to do something more complex, you could use OnOffAuto, so that you can
detect conflicting settings (such as #3 above), but not generate an error for
-cpu foo,lasx=on
where 'foo' is some cpu model which does *no* default lsx=on. You would see that
has_lsx==AUTO && has_lasx==ON and then set lsx=ON.
r~