Skip to content

Commit 4891828

Browse files
committed
Update Inline Assembly to 1.9
1 parent 66a52ad commit 4891828

File tree

2 files changed

+8
-24
lines changed

2 files changed

+8
-24
lines changed

1.9/ja/book/inline-assembly.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33

44
<!-- For extremely low-level manipulations and performance reasons, one -->
55
<!-- might wish to control the CPU directly. Rust supports using inline -->
6-
<!-- assembly to do this via the `asm!` macro. The syntax roughly matches -->
7-
<!-- that of GCC & Clang: -->
6+
<!-- assembly to do this via the `asm!` macro.
87
極めて低レベルな技巧やパフォーマンス上の理由から、CPUを直接コントロールしたいと思う人もいるでしょう。
98
Rustはそのような処理を行うためにインラインアセンブリを `asm!` マクロによってサポートしています。
10-
インラインアセンブリの構文はGCCやClangのものとおおまかに一致しています。
119
1210
```ignore
1311
# // asm!(assembly template
@@ -25,11 +23,11 @@ asm!(アセンブリのテンプレート
2523
2624
<!-- Any use of `asm` is feature gated (requires `#![feature(asm)]` on the -->
2725
<!-- crate to allow) and of course requires an `unsafe` block. -->
28-
`asm` のいかなる利用もフィーチャーゲートの対象です(利用するには `#![feature(asm)]` がクレートに必要になります)
26+
`asm` のいかなる利用もフィーチャーゲートの対象です(利用するには `#![feature(asm)]` がクレートに必要になります)
2927
そしてもちろん `unsafe` ブロックも必要です。
3028

31-
<!-- > **Note**: the examples here are given in x86/x86-64 assembly, but -->
32-
<!-- > all platforms are supported. -->
29+
<!-- &gt; **Note**: the examples here are given in x86/x86-64 assembly, but -->
30+
<!-- &gt; all platforms are supported. -->
3331
> **メモ**: ここでの例はx86/x86-64のアセンブリで示されますが、すべてのプラットフォームがサポートされています。
3432
3533
<!-- ## Assembly template -->
@@ -146,9 +144,8 @@ result
146144
<!-- different values so we use the clobbers list to indicate to the -->
147145
<!-- compiler not to assume any values loaded into those registers will -->
148146
<!-- stay valid. -->
149-
幾つかのインストラクションは異なる値を持っている可能性のあるレジスタを変更する事があります、
150-
そのため、コンパイラがそれらのレジスタに格納された値が処理後にも有効であると思わないように、
151-
破壊されるデータのリストを利用します。
147+
幾つかのインストラクションは異なる値を持っている可能性のあるレジスタを変更する事があります。
148+
そのため、コンパイラがそれらのレジスタに格納された値が処理後にも有効であると思わないように、破壊されるデータのリストを利用します。
152149

153150
```rust
154151
# #![feature(asm)]
@@ -193,7 +190,7 @@ asm!("mov $$0x200, %eax" : /* 出力なし */ : /* 入力無し */ : "{eax}");
193190
<!-- the compiler to insert its usual stack alignment code-->
194191
<!-- 3. *intel* - use intel syntax instead of the default AT&T.-->
195192
1. *volatile* - このオプションを指定することは、gcc/clangで `__asm__ __volatile__ (...)` を指定することと類似しています。
196-
2. *alignstack* - いくつかのインストラクションはスタックが決まった方式(例: SSE)でアラインされていることを期待しています
193+
2. *alignstack* - いくつかのインストラクションはスタックが決まった方式(例: SSE)でアラインされていることを期待しています
197194
このオプションを指定することはコンパイラに通常のスタックをアラインメントするコードの挿入を指示します。
198195
3. *intel* - デフォルトのAT&T構文の代わりにインテル構文を利用することを意味しています。
199196

@@ -216,7 +213,7 @@ println!("eax is currently {}", result);
216213
<!-- inline assembler expressions][llvm-docs], so be sure to check out [their -->
217214
<!-- documentation as well][llvm-docs] for more information about clobbers, -->
218215
<!-- constraints, etc. -->
219-
現在の `asm!` マクロの実装は [LLVMのインラインアセンブリ表現][llvm-docs] への直接的なバインディングです
216+
現在の `asm!` マクロの実装は [LLVMのインラインアセンブリ表現][llvm-docs] への直接的なバインディングです
220217
そのため破壊されるデータのリストや、制約、その他の情報について [LLVMのドキュメント][llvm-docs] を確認してください。
221218

222219
[llvm-docs]: http://llvm.org/docs/LangRef.html#inline-assembler-expressions

diff-1.6.0..1.9.0/src/doc/book/inline-assembly.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)