flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
Azu
everything except the string instructions?
Are there any other instructions it behaves with consistently across processors? Or is it totally random? |
|||
![]() |
|
Azu
Thanks.
I'll try it with some SSE instructions and see if it works with any of them. |
|||
![]() |
|
revolution
Look at the SSE instruction encodings. Do you see anything familiar in some if them?
|
|||
![]() |
|
Azu
Aww it's not that it works on them, it's that it is them.
![]() I was hoping for something cool like rep xchg [ecx],ecx lol |
|||
![]() |
|
MazeGen
It is documented is undefined, but I believe all x86 processors executes it as a NOP (if it has not another meaning).
|
|||
![]() |
|
revolution
MazeGen wrote: It is documented is undefined, but I believe all x86 processors executes it as a NOP (if it has not another meaning). |
|||
![]() |
|
Azu
Why couldn't they make it work the same as on the string functions? What is the point of having another nop? Is it there purely to obfuscate code? :/
|
|||
![]() |
|
revolution
We don't know. You could try asking Intel if you really want to know.
But, I would guess that since it doesn't make sense to use rep on anything but string handling then it is good to leave it open for future expansion. Like they did with pause and SSE. |
|||
![]() |
|
DOS386
Azu wrote: Why is the behavior of the repXX prefixes undefined foreverything except the string instructions? I don't know Code: rep ret rep ud2 rep cmc rep pope cs rep nop Answers (?) : [1] http://board.flatassembler.net/topic.php?p=106599#106599 [2] http://board.flatassembler.net/topic.php?t=6264 |
|||
![]() |
|
LocoDelAssembly
Well, AMD does document the use of "rep ret", doesn't it?
[edit]Oh yes, I've said that myself in DOS386's second reference ![]() Last edited by LocoDelAssembly on 25 Dec 2009, 22:42; edited 1 time in total |
|||
![]() |
|
Azu
revolution wrote: We don't know. You could try asking Intel if you really want to know. ![]() revolution wrote: But, I would guess that since it doesn't make sense to use rep on anything but string handling Why wouldn't it make sense? It is loopXX but for one instruction and taking only one byte.. revolution wrote: then it is good to leave it open for future expansion. Like they did with pause and SSE. |
|||
![]() |
|
baldr
Azu,
Could you supply an example of useful prefixed instruction? |
|||
![]() |
|
Azu
baldr wrote: Azu, For example; rep xor[address+ecx*4],imm/r |
|||
![]() |
|
revolution
Azu wrote: rep xor[address+ecx*4],imm/r |
|||
![]() |
|
Azu
revolution wrote:
The prefix would be useful with almost any instruction. revolution wrote: For the negligible benefit it provides would you be prepared to make other things like SSE implementation more complex? |
|||
![]() |
|
revolution
The reason was given. It is of negligible benefit. The makers would have to add silicon and test vectors and whatnot to implement it. And they won't go to all that effort if the overall benefit is minor. Not many programs are in need of operations like that so they keep it open for other, more beneficial, uses in the future.
If rep was made universal at the start (the 8086) then current SSE would have been harder to implement. We are currently reaping the benefit of not being so liberal with rep. |
|||
![]() |
|
Azu
But adding rep to an 8086 instruction doesn't turn it into an SSE instruction.. so I don't understand.. what would be the difficulty? And the silicon is already there for the string functions. Couldn't it be reused?
|
|||
![]() |
|
revolution
If you enabled rep for everything then that means that SSE has to use some other encoding format because rep is already used.
And, no, silicon can't just be "reused" like that. CPUs don't work that way. Read some books about CPU design if you want to know how they do work. |
|||
![]() |
|
Azu
revolution wrote: If you enabled rep for everything then that means that SSE has to use some other encoding format because rep is already used. Azu wrote: They could still use it for other instructions besides pause and SSE ones, though.. revolution wrote: And, no, silicon can't just be "reused" like that. CPUs don't work that way. Read some books about CPU design if you want to know how they do work. Does the 16bit prefix need extra silicon for each individual instruction too, then? |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.