Skip to contentSkip to conversation

What's the difference between "ld/st" and "qemu_ld/st" in TCG IR?

Qemu-devel 浩倫 魏 2 participants 3 messages May 23, 2015 – May 24, 2015

lore
Share & tools
lore

浩倫 魏

author
#0 lore raw

Hi, all:
I've been trying to understand the process of binary translation inside TCG.If I haven't misunderstood, qemu_ld/st are the operations that will call helper function(ld_mmu) to let softmmu translate the GVA->GPA for the guest load/store instructions. So there are some points that I hope you can help me out:
1. Is every guest load/store instruction would be translated to qemu_ld/st IR?
2. What about another TCG IR "ld/st"? What kind of guest instructions would cause TCG generates that IRs and for what purpose?
Any reply would be helpful to me.Thanks in advance.

#1 lore raw
Quoted 2 lines · 浩倫 魏

So there are some points that I hope you can help me out:
1. Is every guest load/store instruction would be translated to qemu_ld/st IR?

Yes.

Quoted 2 lines

2. What about another TCG IR "ld/st"? What kind of guest instructions would cause TCG generates that IRs and for what purpose?

For instance, vector instructions are often implemented without TCG temporaries, but instead using ld/st to load the data from the ENV pointer directly. You can see that in the ARM and i386 targets.

Otherwise, there are sometimes less-used system values that do not warrent a TCG temporary. You can see that in the alpha target.

r~

author
#2 lore raw

Dear Richard:
Now I get it, thanks for the help! :-)

Richard Henderson <[email protected]> 於 2015/5/24 (週日) 6:21 AM 寫道﹕

Quoted 2 lines · 浩倫 魏

So there are some points that I hope you can help me out:
1. Is every guest load/store instruction would be translated to qemu_ld/st IR?

Yes.

Quoted 2 lines

2. What about another TCG IR "ld/st"? What kind of guest instructions would cause TCG generates that IRs and for what purpose?

For instance, vector instructions are often implemented without TCG temporaries, but instead using ld/st to load the data from the ENV pointer directly.  You can see that in the ARM and i386 targets.

Otherwise, there are sometimes less-used system values that do not warrent a TCG temporary.  You can see that in the alpha target.

r~