flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > rdmsrq

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 09 Dec 2010, 17:14

Tomasz,

Why did you add the mnemonic rdmsrq ?
"rdmsr" is valid in 32bits and 64bits mode,
and the opcode is the same in both cases. (OFh 32h)
So why this extra mnemonic ?
thank you.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 09 Dec 2010, 17:14
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8357
Location: Kraków, Poland
Tomasz Grysztar 09 Dec 2010, 17:36
You should have tried to enter "rdmsrq" in the board's search box. Wink
It would lead you precisely to the genesis of this addition: http://board.flatassembler.net/topic.php?t=5539
Post 09 Dec 2010, 17:36
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 09 Dec 2010, 20:07
Code:
fasm/rdmsr  :     0Fh 32h
fasm/rdmsrq : 48h 0Fh 32h    

ok Tomasz, thank you.
But, I don't understand.

from where this "48h" comes from Question Question

(I see nothing about this in the intel doc)

Intel® 64 and IA-32
Architectures Software Developer’s Manual
253667-035US June 2010

edit :

48h == REX.W prefix Wink

but rdmsrq / 48h 0Fh 32h does not exist !
dito for
wrmsrq / 48h 0Fh 30h ... does not exist either.

and this, why not ? --> CVTTSS2SIQ ?
(F3 REX.W 0F 2C/r CVTTSS2SI r64, xmm/m32)

and why not ADCQ ?
ADC is also affected with REX.W
(REX.W + 15 id ADC RAX, imm32)

CMOV is also affected with REX.W ... CMOVAEQ ?
(REX.W + 0F 43/r CMOVAE r64, r/m64)

NOPQ ? Wink why not ?

all these additional opcodes don't make much sense. Confused
in fact, this has absolutely no meaning and totally useless.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 09 Dec 2010, 20:07
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8357
Location: Kraków, Poland
Tomasz Grysztar 11 Dec 2010, 12:22
If you read that thread I referred to, you will notice that I wrote in response:
Quote:
Strange, Intel doesn't specify any syntax settings to differ the two forms of those instructions.
This suggests, that Intel manual did mention those two different forms of RDMSR instruction, it just did not define any separate mnemonics for it. It was written back in 2006, and by looking at the copies of 2004 and 2007 Intel documentations for x86-64 technology, I see that they later removed that information. Whether that means that this variant of instruction will never matter in Intel processors is an open question, but fasm still has a mnemonic - just in case. Perhaps some testing should be done on various 64-bit processors to see whether the REX.W has any effect on this instruction, or it was just a mistake in early manuals. It is possible that it may hint on some feature that later went undocumented.

Hmm, but looking at that old documentation now, I see that I also missed RDPMCQ.
Post 11 Dec 2010, 12:22
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 11 Dec 2010, 12:38
It can be tested quite easily.

Load RCX with the low order 32-bits as zero and the high order 32-bits as non-zero and execute RDMSRQ. If you get an exception then you know the REX prefix causes the CPU the use the entire RCX register. If it executes normally then you know REX had no effect.
Post 11 Dec 2010, 12:38
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 11 Dec 2010, 12:44
Tomasz Grysztar wrote:
Hmm, but looking at that old documentation now, I see that I also missed RDPMCQ.
I don't see anywhere in the RDPMC description or operation sections about the use of REX. It appears to be described differently from the RDMSR. For RDMSR I can clearly see the REX usage and then the later removal of that description.
Post 11 Dec 2010, 12:44
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8357
Location: Kraków, Poland
Tomasz Grysztar 11 Dec 2010, 12:55
revolution wrote:
I don't see anywhere in the RDPMC description or operation sections about the use of REX. It appears to be described differently from the RDMSR. For RDMSR I can clearly see the REX usage and then the later removal of that description.
This is what my copy of EM64T documentation from 2004 says about it.
Which version did you use? I have a gap between 2004 and 2007 in my manuals' archive, perhaps I could ask you for a copy to fill it in.


Description:
Filesize: 16.1 KB
Viewed: 15892 Time(s)

rdpmc2004.jpg


Post 11 Dec 2010, 12:55
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 11 Dec 2010, 13:13
I have:

2004 (unknown date or version number)
Jun 2005 - 016
Jun 2006 - 020US
Sep 2006 - 021
May 2007 - 023US
Feb 2008 - 026US
Sep 2008 - 028US
Jun 2009 - 031US
Jun 2010 - 035US

The 64-bit stuff was added after 016 and on or before 020US. So perhaps you have a version that is between those two.

Maybe between the two of us (and the others on this forum) we can complete the set. Which version(s) would you like me to post?

NOTE: that the file sizes would exceed the forum limit so I guess posting here is not possible. Do you have another method of transfer? Temporarily use the ARM subdomain maybe?
Post 11 Dec 2010, 13:13
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 11 Dec 2010, 13:21
Ooh, I just found some older versions also from 2001 and 2003.

From what I can tell they appear to be versions 004 and 012.
Post 11 Dec 2010, 13:21
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8357
Location: Kraków, Poland
Tomasz Grysztar 11 Dec 2010, 13:23
I have 025US, 029US and 035US - so our collections are a bit interleaved. Smile
However the one from 2004 I mentioned is not that IA-32 manual (which I also have - it seems to be 015 version), but a separate EM64T guide, revision 1.1, with number 300835.

As for transfer through subdomain, that should be OK.
Post 11 Dec 2010, 13:23
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8357
Location: Kraków, Poland
Tomasz Grysztar 11 Dec 2010, 13:32
BTW, I also checked all the AMD x86-64 manuals I have, back to 2002, and they always had RDMSR ignore the operand size - thus it was only the Intel's invention (and the reason why I initially did not know about it, as I based fasm's implementation of x86-64 on paper copy of 2002 AMD manuals that I own).
Post 11 Dec 2010, 13:32
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 11 Dec 2010, 14:23
I also just found a 2004 64-bit manual, 300835-002. It shows the RDPMC that you posted above. It appears that it never made it into the main manual set.

The full set of IA32, including the optimisation manuals, comes to 196MB uncompressed, 129MB compressed. You want all?
Post 11 Dec 2010, 14:23
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8357
Location: Kraków, Poland
Tomasz Grysztar 11 Dec 2010, 14:39
revolution wrote:
The full set of IA32, including the optimisation manuals, comes to 196MB uncompressed, 129MB compressed. You want all?
Yes, please.
Post 11 Dec 2010, 14:39
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 11 Dec 2010, 14:48
Okay, I'll swap it with you for 025 and 029.

Upload here is slow at the moment, be patient.
Post 11 Dec 2010, 14:48
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 11 Dec 2010, 16:17

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 11 Dec 2010, 16:17
View user's profile Send private message Send e-mail Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 12 Dec 2010, 10:00
ouadji,

They're latest, where is previous? Wink

----8<----
Tomasz Grysztar & revolution,

I can augment your collection with 027US, 033US and 034US.
Post 12 Dec 2010, 10:00
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8357
Location: Kraków, Poland
Tomasz Grysztar 12 Dec 2010, 10:09
revolution: thanks for the exchange. It would probably be a bit easier if we kept just the "documentation changes" document for each revision, though. Wink Well, and then it would be even better if Intel provided the complete documentation history document instead of only the latest changes. And by the way: in the latest one (for revision 036) they claim in the revision history that they added 24 changes, but only 23 are present. A typo, or something more interesting?

ouadji: once again I have this feeling that you did not really read the thread before posting.
Post 12 Dec 2010, 10:09
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 12 Dec 2010, 11:00
Quote:
ouadji: once again I have this feeling that you did not really read the thread before posting.
Sorry, but my English is not very good and I don't always understand everything.
I did not understand it was important for you to have previous versions.
Besides, I still do not understand why you give so much importance to previous versions.

_________________
I am not young enough to know everything (Oscar Wilde)- Image


Last edited by ouadji on 12 Dec 2010, 11:11; edited 1 time in total
Post 12 Dec 2010, 11:00
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 12 Dec 2010, 11:10
baldr wrote:
I can augment your collection with 027US, 033US and 034US.
Sounds good. But we need a central repository for this exchange stuff. That way more people can get involved. Do you have any suggestions? I thought of P2P but many ISPs block it (or at the least severely limit it).
Post 12 Dec 2010, 11:10
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 12 Dec 2010, 17:18

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 12 Dec 2010, 17:18
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.