AgentStack
SKILL verified MIT Self-run

Qemu Tcg Backend Adaptation

skill-processmission-oh-my-qemu-qemu-tcg-backend-adaptation · by processmission

Use for adapting a QEMU TCG host backend, including optional op support, constraints, register allocation, host code emission, qemu_ld/st, atomics, and vector ops. Extends qemu-flow-plan and qemu-rlcr-loop.

No reviews yet
0 installs
6 views
0.0% view→install

Install

$ agentstack add skill-processmission-oh-my-qemu-qemu-tcg-backend-adaptation

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Qemu Tcg Backend Adaptation? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

QEMU TCG Backend Adaptation

Use this domain skill for host backend work under tcg//: instruction encoders, TCG_TARGET_HAS_*, constraints, tcg_out_op, qemu load/store paths, vector emission, and generated host-code bugs.

Flow dependencies

  1. Start with qemu-flow-plan.
  2. Put host-code logs, TCG dumps, temporary disassembly, benchmark notes, and review files under build/agent//.
  3. Use qemu-rlcr-loop for implementation/debug rounds.
  4. Use qemu-build for host backend builds.
  5. Use qemu-debug for TCG logs and one-insn-per-tb.
  6. Use qemu-model-verification for final evidence.

Hard policy boundary

Do not produce source code intended for QEMU upstream submission. Do not add DCO or review trailers.

Backend contract

A backend change is correct only when these agree:

  • IR op semantics from include/tcg/tcg-opc.h and docs/devel/tcg-ops.rst;
  • host feature flag in tcg-target-has.h;
  • operand constraints in tcg-target-con-str.h and tcg-target-con-set.h;
  • register class/reserved-register assumptions in tcg-target.h;
  • tcg_out_op, vector emission, or qemu_ld/st implementation in tcg-target.c.inc;
  • tests/logs proving the native path or intentional generic expansion.

Do not enable TCG_TARGET_HAS_* before constraints and emission support are complete.

Classify the change

Record one category in the plan:

  • new host instruction encoder;
  • native emission for existing TCG op;
  • optional op enablement;
  • constraint/register allocation fix;
  • qemu_ld/st or atomic path;
  • vector op support;
  • host feature gating/runtime CPU detection;
  • code generation bug investigation.

Emission checklist

Check:

  • immediate ranges and sign extension;
  • i32 result extension on 64-bit hosts;
  • signed vs unsigned conditions;
  • branch displacement and relocation/pool handling;
  • clobbers and call ABI;
  • scalar vs vector register classes;
  • host endianness;
  • constant materialization;
  • instruction-cache flush needs.

Keep code generation paths allocation-free and simple.

qemu_ld/st and atomics

Verify separately:

  • MemOp size, sign, and endianness;
  • TLB fast path vs slow path labels;
  • i128 register pairing;
  • user-mode vs system-mode differences;
  • guest atomicity vs host capability;
  • helper calls and clobbers;
  • unaligned behavior.

Vector rules

For vectors, verify:

  • host vector feature detection;
  • v64/v128/v256 and specific op flags;
  • element size coverage;
  • constant operand forms;
  • scalar fallback vs vector path;
  • tcg_can_emit_vec_op() / tcg_expand_vec_op() behavior.

Verification expectations

  • Build the backend on the host.
  • Run focused tests/tcg when available.
  • Capture TCG IR and host-code logs proving native emission or fallback.
  • Check unsupported host features remain disabled.
  • Use one-insn-per-tb when frontend/backend attribution is unclear.

Upstream references

  • QEMU code provenance and AI policy: docs/devel/code-provenance.rst.
  • TCG IR semantics: docs/devel/tcg-ops.rst.
  • TCG internals: docs/devel/tcg.rst.
  • Backend examples: tcg/aarch64/, tcg/riscv64/, tcg/loongarch64/.
  • Core declarations: include/tcg/tcg.h, include/tcg/tcg-opc.h, include/tcg/tcg-op-common.h.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.