From: SourceForge.net <no...@so...> - 2008-08-29 00:49:29
|
Bugs item #2029829, was opened at 2008-07-27 16:27 Message generated for change (Comment added) made by hpa You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106208&aid=2029829&group_id=6208 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 1 Private: No Submitted By: Gran Weinholt (weinholt) Assigned to: Nobody/Anonymous (nobody) Summary: Missing VIA PadLock instructions Initial Comment: I was perusing the VIA PadLock Programming Guide (http://linux.via.com.tw/) and noticed that nasm gets a few things wrong wrt VIA's instructions. 1. The REP XCRYPTCTR instruction is missing from the instruction table. 2. The disassembler does not recognize the REP XSTORE instruction (the REP prefix is shown as "db 0xF3"). 3. The instruction table treats the F3 prefix as an SSE prefix for these instructions, but it is actually a REP. Here's a summary of the available instructions: 0x0F 0xA7 0xC0 XSTORE 0xF3 0x0F 0xA7 0xC0 REP XSTORE Here the REP prefix must be present for the instruction to work at all: 0xF3 0x0F 0xA7 0xC8 REP XCRYPTECB 0xF3 0x0F 0xA7 0xD0 REP XCRYPTCBC 0xF3 0x0F 0xA7 0xD8 REP XCRYPTCTR 0xF3 0x0F 0xA7 0xE0 REP XCRYPTCFB 0xF3 0x0F 0xA7 0xE8 REP XCRYPTOFB 0xF3 0x0F 0xA6 0xC0 REP MONTMUL 0xF3 0x0F 0xA6 0xC8 REP XSHA1 0xF3 0x0F 0xA6 0xD0 REP XSHA256 Currently the assembler accepts the instructions without a REP prefix and outputs an F3 byte anyway, so everything works. Changing this would break backwards compatibility, since the user would have to put in REP everywhere. On the other hand, anyone who has read the PadLock programming manual will likely write out the REP prefix, and get a redundant F3 byte generated. Should be harmless though. ---------------------------------------------------------------------- >Comment By: H. Peter Anvin (hpa) Date: 2008-08-28 17:49 Message: Logged In: YES user_id=58697 Originator: NO We now accept either form and generate the REP prefix either way. Disassembly shows the REP. ---------------------------------------------------------------------- Comment By: H. Peter Anvin (hpa) Date: 2008-08-28 17:49 Message: Logged In: YES user_id=58697 Originator: NO This item has been resolved; the fix has been checked into git (http://repo.or.cz/w/nasm.git) and will be in the next release. You can usually also obtain a nightly snapshot at ftp://ftp.zytor.com/pub/nasm/snapshots/; the snapshot robot usually runs some time between 09:00 and 10:30 UTC. ---------------------------------------------------------------------- Comment By: nasm64developer (nasm64developer) Date: 2008-07-27 21:50 Message: Logged In: YES user_id=804543 Originator: NO > 1. The REP XCRYPTCTR instruction is missing from the instruction table. It was mentioned in an update to SF #825529. Why it didn't get implemented, I do not know. > 3. The instruction table treats the F3 prefix as an SSE prefix for these > instructions, but it is actually a REP. Like with SSE, the 0xF3 is part of the opcode here. > Currently the assembler accepts the instructions without a REP prefix and > outputs an F3 byte anyway, so everything works. Changing this would break > backwards compatibility, since the user would have to put in REP > everywhere. > On the other hand, anyone who has read the PadLock programming manual will > likely write out the REP prefix, and get a redundant F3 byte generated. > Should be harmless though. I see no reason to change NASM to cater to VIA's stupidity. Except for XSTORE, the 0xF3 is mandatory; as such, the user should not have to write out REP explicitly. A user who writes out REP is asking for an extra 0xF3, IMO. Fwiw, the document you mentioned does differ from previous/ other Centaur documents covering these instructions. (Which of them is supposed to be correct, I can not say.) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106208&aid=2029829&group_id=6208 |