Hackaday recently published an article titled “Why x86 Needs to Die” – the latest addition in a long-running RISC vs CISC debate. Rather than x86 needing to die, I believe the RISC vs CISC debate needs to die. It should’ve died a long time ago. And by long, I mean really long. About a decade ago, a college professor asked if I knew about the RISC vs CISC debate. I did not. When I asked further, he
この記事はx86-64の機械語を書けるようになるためのガイドとなることを目指します。読者はアセンブリー言語について既にある程度知っていることを想定します。 情報源 x86-64の機械語のオフィシャルなガイドはIntelのSoftware Developer ManualまたはAMDのAMD64 Architecture Programmer's Manualです。 Intel SDM: Intel® 64 and IA-32 Architectures Software Developer Manuals AMD64 Architecture Programmer's Manual, Volumes 1-5 このほか、Cから呼び出される関数を定義したり、Cの関数を呼び出すためには、呼び出し規約の知識も必要です。使用される呼び出し規約はOSに依存し、Unix系では主にSystem V ABI
2023年7月、Intel から新たな命令拡張、APX(Advanced Performance Extension) と AVX10 が発表された。 これまでのx86拡張命令はSIMD命令を中心として、並列性のある処理を効率よく扱うものがメインだったのに対して、APX では、スカラ整数命令、つまり、普段よく使う命令に 汎用レジスタ数が倍増 (16→32) 3 operand の採用 という大きな拡張が入っている。これの解説を書いていく。 APX REX2 prefixというprefixが増えている(また!prefixが増えた!) REX2 prefixは、0xD5に割り当てられている。 0xD5 は 32bit までは AAD という命令に割り当てられていた。 x86を使っている人なら当然知っているので説明不要と思うが、32bit までの x86 には、BCD を扱うための専用命令がいく
Sometimes humans can spot optimization opportunities that a compiler can’t doesn’t. In this post, we start with a loop generated from C code by clang, and tweak it in various ways, measuring the speedup. 📢 This post was on the front page of HN. You can join in the discussion there. Disclaimer: I’m not an optimization expert, by any means, in fact my expertise is in high-level, purely-functional l
Intel's Intrinsics Guide provides an interactive guide with data for each x86 intrinsic instruction, including a pseudocode that specifies the instruction's behavior. The intrinsics guide is backed by an XML file with all of this data in an easily parseable format, which we use here to build a Z3 model. So far, only these features of Intel's pseudocode are supported: Basic unary/binary arithmetic/
はじめに プログラミング言語のRustを学びたいと思い,今年はいくつか本を読んだり1,The Rust Programming Languageの輪講会を催したりした.ところがそこまで学んでいても,Rustでは強力な型システムと所有権システムがあるため,初学者の私にはコンパイルすら一筋縄では行かなかった. そこでCのプログラムをRustで再実装し,Rustに慣れることとした.自作エミュレータで学ぶx86アーキテクチャのx86エミュレータpx86はCで実装されているが,これを新たにRustで実装することした.px86を選んだ理由は一度Linuxで実装した経験があるため2,またコンパクトな規模の実装であるから,題材として適切と考えた. 本記事では,簡易x86エミュレータをCからRustに実装し直す上で困ったことを取り上げ,どのように対処したかを示す. px86:簡易x86エミュレータ 今回実装
Add new or borrow from other language(s) features/ideas ontop of C, deviate away from just C defer operator overloading constexpr/consteval from c++ or some #run directive (https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) learn from other similar projects (e.g https://news.ycombinator.com/item?id=27890888) array of struct to struct of arrays conversion and vice versa https://en.wikipe
or #v86 on irc.libera.chat v86 emulates an x86-compatible CPU and hardware. Machine code is translated to WebAssembly modules at runtime in order to achieve decent performance. Here's a list of emulated hardware: An x86-compatible CPU. The instruction set is around Pentium 4 level, including full SSE3 support. Some features are missing, in particular: Task gates, far calls in protected mode Some 1
アーキテクチャと実装混ざってるけど 命令dispが32bit届く immも32bit入ることが多い メモリが順序守る(何回も書くが、メモリ順序が緩いことによって得られたCPU時間より失なった人間時間のほうが絶対多いから) ファームウェアがBIOSとUEFIの二種類しかない (ボードごとにカーネルにディレクトリ作るのやめろARM) 周辺デバイスがPCIに統一されててキャッシュの問題が起こりづらい(もうdma_alloc_coherentの挙動調べるの飽きた) キャッシュがソフト的に見れば一階層 (L2の挙動が定義されてないARMとかいう無名CPU) 除算とFPUが付いてる ABIがWin除けば32bitと64bitとx32の3種類しかない。 PCIe がキャッシュスヌープ付けてフルスピード近く出る lock cmpxchg が遅くない *fence が遅くない こういう問題で別のアーキがx8
x86の機械語をざっと見渡すには、このpdfが世界で一番整理されてると思う。https://t.co/00G7QFh8sN これはx86エミュレータ作るとき大変世話になった。人力objdumpするなら、とりあえずこの表を小一時間眺… https://t.co/g9U6YGIFw3
複数のスレッドを実行しているとき,あるスレッドのメモリに対する書き込みが別のスレッドからどんなふうに観測される可能性があるかを定めたものをメモリモデルというそうです.プログラミング言語の仕様として定められていたり,CPU の仕様としてマニュアルに解説があったりするものだそうです. マルチスレッドプログラミングを行うときにはこれを前提にするわけですが,困ったことに x86 のマニュアルにある自然言語での説明が曖昧だったり,時に実プロセッサの挙動と合わなかったりといろいろ問題があるそうです. これに対処するために,過去の複数版のマニュアルを読み解き,実プロセッサを調査してメモリモデルを形式的に作ったという論文があります. x86-TSO: A Rigorous and Usable Programmer’s Model for x86 Multiprocessors (論文PDFへのリンク)
Everything you want to know about x86 microcode, but might have been afraid to ask Playlists: '34c3' videos starting here / audio / related events 57 min 2017-12-28 12810 Fahrplan Microcode is an abstraction layer on top of the physical components of a CPU and present in most general-purpose CPUs today. While it is well-known that CPUs feature a microcode update mechanism, very little is known abo
Writing assembly language is something best left for the experts. To write code that runs directly on your microprocessor you need to know how memory segmentation works, what the intended use of each register is, how codes executes in real and protected modes and much, much more. And, of course, modern compilers will usually produce faster, more optimized code than you ever could, without making a
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く