5 ms·
How many x86 instructions are there?
- rxm 10y agoWay too many.
- deleted 10y ago[deleted]
- trentnelson 10y agoNeat, I'd come across Pin[1] recently doing some IDA Pro stuff... XED[2] looks equally interesting. [1]: https://software.intel.com/en-us/articles/pin-a-dynamic-binary-instrumentation-tool https://software.intel.com/en-us/articles/pin-a-dynamic-bina... [2]: https://software.intel.com/en-us/articles/xed-x86-encoder-decoder-software-library https://software.intel.com/en-us/articles/xed-x86-encoder-de...
- rzzzt 10y agoI intend to read the 3-volume edition of Intel's developer manual from start to finish, but haven't decided when to do it, before or after TAOCP.
- thechao 10y agoI've written assemblers for about 30 different ISAs (ISAE?)---most of them custom. An ISA (almost always) forms a DAG, where a node is a legal string of {01X} that is producible from the ISA; the 'X' meaning "0 or 1". An encoding is a daughter of another encoding if it has a 0 or 1 whenever the parent has a 0 or 1. A "projection" is the imposition of a tree-like structure on the DAG, followed by a cut of the tree to make it practicalable in size. Aliasing mnemonics in the tree can cause confusion for the user---or aid in understanding. These articles are noting that there are many ways to project the x86 ISA.
- nibnib 10y agodo you mind going into why you have written so many assemblers?
- thechao 10y agoMy grad work was in system programming language design; I used to toy around with VM design, so that meant I was (poorly) designing a lot of ISAs and then writing a lot of assemblers for them. My professional work is unrelated to my grad work, but has still let me expand on that interest. Sorry I'm so vague. Think more along the lines of "python byte code assembler", or somesuch thing.
- csl 10y agoDo you happen to blog? Would absolutely love to read about best practices, curious situations and so on.
- legulere 10y agoThis article makes me kind of wonder wether there are processors that understand two or more unrelated instruction encoding sets.
- efaref 10y agoI vaguely recall reading about someone developing a chip that could run both ARM and x86 code. The idea being that it would run ARM code most of the time at low power, and then power up in order to run x86 code when necessary. I don't know if there was any clever sharing of the silicon, or if it was in fact just an x86 core and an ARM core glued together. The only thing I can find on it though is this IEEE document reference: http://ieeexplore.ieee.org/document/6136696/ http://ieeexplore.ieee.org/document/6136696/
- PeCaN 10y agoThat was Transmeta, which became Nvidia's Project Denver. I think the show stopper is that they were unable to acquire an x86 license. Anyway, it actually ran neither (the core is more like Itanium) and had a separate chip that JIT compiled ARM and x86 to the internal ISA.
- gsnedders 10y agoAs far as I'm aware, none of Transmeta's x86 stuff became Project Denver. There was definitely licensing of Transmeta technologies, but I believe that was relatively generally applicable patents (well, generally applicable to ICs). There was, however, given the relative size of the semiconductor industry, some ex-Transmeta staff working on Project Denver. But yes, as far as I'm aware, what killed the x86 support was licensing.
- PeCaN 10y agoProject Denver still JITs ARM to an internal VLIW architecture I believe. It's pretty Transmeta-like.
- creshal 10y ago> ISAs (ISAE?) -ae only if the word is a) not an abbreviation, b) Latin, and c) a-declension.
- sdegutis 10y agoPretty sure GP was joking. But anyway, my favorite word to throw out there in fun little pedantic conversations like this = octopus, which ends up ! actually being octopi like most people think, but rather octopodes due to it being from Greek & ! Latin.
- creshal 10y agoGrammar is always fun, even more so when you start mixing several languages.
- mjevans 10y agoI support languages fully 'thieving' and owning words that they copy (not borrow) from other languages. It might be octopodes in those other languages, but octopi is the pattern most expect from the current structure and therefore it is more correct; scholars of exceptions be forgiven for their pedantic ways.
- dang 10y agoWe detached this subthread from https://news.ycombinator.com/item?id=12358793 https://news.ycombinator.com/item?id=12358793 and marked it off-topic. Not that there's anything wrong with fun grammatical digressions, but they tend to get too much weight as subthreads.
- rev_null 10y agoIt supports up to 4,294,967,296 instructions.
- gruez 10y agoWhere did you get that number from? Instructions are not limited to 31 bits in length
- brakmic 10y agoSorry, if I may sound off-topic, but it seems that XED-downloads aren't working at all.
- yesimahuman 10y agoOne question this left me: are we leaving performance off the table by using compilers that are only using a "standard" subset of the possible instructions out there?
- seabrookmx 10y agoDefine "we". I think there is definitely some applications doing this. Last I checked, using default GCC settings you can drastically change the performance of the resulting app by passing different flags. This obviously depends a lot on the app, but I recall a simple raytracing program I wrote in C++ in University being sped up quite a bit when I passed it flags to optimize for Pentium4+, because it leveraged certain SSE instructions. MSVC++ with optimizations turned on actually bundles multiple copies of the binary in the resulting .exe file, and is able to pick the optimal one (based on the ISA extensions your CPU supported) at runtime. I'm sure you can do something comparable with binaries produced by GCC and CLang. Now.. do I think this improperly optimized binaries are a problem plaguing us? No. Because the large native applications that would really benefit (such as Chrome/V8) have already dealt with this. The smaller apps (think a small GTK app like gedit) won't see a noticeable performance benefit. And most newer, consumer applications (Spotify, Slack, Skype) are written in something like Node anyways.
- gsmethells 10y agotldr; What is the answer? Curious.
- jonknee 10y agoThe post begins: > It’s surprisingly hard to give a good answer (the question was raised in this article). It depends on how you count, and the details are interesting (to me anyway).