On 7/29/25 06:01, Gustavo Romero wrote:
+static bool trans_CHKFEAT(DisasContext *s, arg_CHKFEAT *a)
+{
+    uint64_t feat_en = 0;
+
+    if (s->gcs_en) {
+        feat_en |= 1 << 0;

I understand that CHKFEAT is currently only tied to GCS but will cover more 
features
in the future so we can keep feat_en |= 1 << 0 even if it could gate TCG andi 
directly
on s->gcs_en and do andi with 0. ok.

Yep.


It's curious that this instruction is tied to x16, it seems easy to use any 
other
general purpose register to query for the features.

That's because the instruction is allocated from HINT space, which means that it executes as a NOP on cpus that don't support FEAT_CHK. The HINT space is limited, and it would be wastefull to allocate 32 such insns, one for each register.


r~

Reply via email to