about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlessandro Decina <alessandro.d@gmail.com>2021-04-20 19:03:10 +1000
committerAlessandro Decina <alessandro.d@gmail.com>2021-05-23 18:03:27 +1000
commitb2a6967114b2fa9d477226ff7ad53fb55fb692bc (patch)
treee3cdff4b6c254131063dd7f4ef4bada6d3bba4fc /src
parent12ac719b99560072cbe52a957f22d3fe6946cf2a (diff)
downloadrust-b2a6967114b2fa9d477226ff7ad53fb55fb692bc.tar.gz
rust-b2a6967114b2fa9d477226ff7ad53fb55fb692bc.zip
Add support for BPF inline assembly
Diffstat (limited to 'src')
-rw-r--r--src/doc/unstable-book/src/library-features/asm.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/doc/unstable-book/src/library-features/asm.md b/src/doc/unstable-book/src/library-features/asm.md
index 5503b3b4b32..77080b54dc8 100644
--- a/src/doc/unstable-book/src/library-features/asm.md
+++ b/src/doc/unstable-book/src/library-features/asm.md
@@ -30,6 +30,7 @@ Inline assembly is currently supported on the following architectures:
 - Hexagon
 - MIPS32r2 and MIPS64r2
 - wasm32
+- BPF
 
 ## Basic usage
 
@@ -570,6 +571,8 @@ Here is the list of currently supported register classes:
 | PowerPC | `reg_nonzero` | | `r[1-31]` | `b` |
 | PowerPC | `freg` | `f[0-31]` | `f` |
 | wasm32 | `local` | None\* | `r` |
+| BPF | `reg` | `r[0-10]` | `r`|
+| BPF | `wreg` | `w[0-10]` | `w`|
 
 > **Note**: On x86 we treat `reg_byte` differently from `reg` because the compiler can allocate `al` and `ah` separately whereas `reg` reserves the whole register.
 >
@@ -615,6 +618,8 @@ Each register class has constraints on which value types they can be used with.
 | PowerPC | `reg_nonzero` | None | `i8`, `i16`, `i32` |
 | PowerPC | `freg` | None | `f32`, `f64` |
 | wasm32 | `local` | None | `i8` `i16` `i32` `i64` `f32` `f64` |
+| BPF | `reg` | None | `i8` `i16` `i32` `i64` |
+| BPF | `wreg` | `alu32` | `i8` `i16` `i32`|
 
 > **Note**: For the purposes of the above table pointers, function pointers and `isize`/`usize` are treated as the equivalent integer type (`i16`/`i32`/`i64` depending on the target).
 
@@ -674,6 +679,7 @@ Some registers have multiple names. These are all treated by the compiler as ide
 | Hexagon | `r29` | `sp` |
 | Hexagon | `r30` | `fr` |
 | Hexagon | `r31` | `lr` |
+| BPF | `r[0-10]` | `w[0-10]` |
 
 Some registers cannot be used for input or output operands: