BlockBuilderMixin.get_relative_pos()
![](https://secure.gravatar.com/avatar/0aff622778c7a7ba4c35f61cc6476de9.jpg?s=120&d=mm&r=g)
Hi, I see in the ARM tests many call to InstructionBuilder.curpos() which returns BlockBuilderMixin.get_relative_pos(). Then, the value returned is used to make some branches and some jumps. I try to do the same for my MIPS port, but all my branch and jump fail. When I print the value returned I get value under 1000 that let me think that it's not a PC value. Can anyone explain me what's the value returned by BlockBuilderMixin.get_relative_pos(). Friendly, Alexis BRENON
![](https://secure.gravatar.com/avatar/bfc96d2a02d9113edb992eb96c205c5a.jpg?s=120&d=mm&r=g)
On Fri, Jun 7, 2013 at 10:33 PM, Alexis BRENON <abrenon@wyplay.com> wrote:
Hi,
I see in the ARM tests many call to InstructionBuilder.curpos() which returns BlockBuilderMixin.get_relative_pos(). Then, the value returned is used to make some branches and some jumps. I try to do the same for my MIPS port, but all my branch and jump fail. When I print the value returned I get value under 1000 that let me think that it's not a PC value.
Can anyone explain me what's the value returned by BlockBuilderMixin.get_relative_pos().
it's a relative pos to the start of the block and it's used for relative jumps. if you want to do absolute jumps, you need to patch them later using the value that's returned from materialize() (that writes it to memory). At least x86 backend has some jump patching done Cheers, fijal
participants (2)
-
Alexis BRENON
-
Maciej Fijalkowski