about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTaiki Endo <te316e89@gmail.com>2024-11-07 21:19:03 +0900
committerTaiki Endo <te316e89@gmail.com>2024-11-07 21:19:03 +0900
commit241f82ad915b167992ec9d3bb729f095a7829424 (patch)
tree929b6fb781d5536274cb0cef82d76d81e1eba399 /src
parentc07aa1e17199e27f6f7ac8f3307bca7bda0084b6 (diff)
downloadrust-241f82ad915b167992ec9d3bb729f095a7829424.tar.gz
rust-241f82ad915b167992ec9d3bb729f095a7829424.zip
Basic inline assembly support for SPARC and SPARC64
Diffstat (limited to 'src')
-rw-r--r--src/doc/unstable-book/src/language-features/asm-experimental-arch.md22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/doc/unstable-book/src/language-features/asm-experimental-arch.md b/src/doc/unstable-book/src/language-features/asm-experimental-arch.md
index 5264f778a93..3029c3989c9 100644
--- a/src/doc/unstable-book/src/language-features/asm-experimental-arch.md
+++ b/src/doc/unstable-book/src/language-features/asm-experimental-arch.md
@@ -20,6 +20,7 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
 - CSKY
 - s390x
 - Arm64EC
+- SPARC
 
 ## Register classes
 
@@ -56,6 +57,8 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
 | s390x        | `freg`         | `f[0-15]`                          | `f`                  |
 | s390x        | `vreg`         | `v[0-31]`                          | Only clobbers        |
 | s390x        | `areg`         | `a[2-15]`                          | Only clobbers        |
+| SPARC        | `reg`          | `r[2-29]`                          | `r`                  |
+| SPARC        | `yreg`         | `y`                                | Only clobbers        |
 | Arm64EC      | `reg`          | `x[0-12]`, `x[15-22]`, `x[25-27]`, `x30` | `r`            |
 | Arm64EC      | `vreg`         | `v[0-15]`                          | `w`                  |
 | Arm64EC      | `vreg_low16`   | `v[0-15]`                          | `x`                  |
@@ -97,6 +100,8 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
 | s390x        | `freg`                          | None           | `f32`, `f64`                            |
 | s390x        | `vreg`                          | N/A            | Only clobbers                           |
 | s390x        | `areg`                          | N/A            | Only clobbers                           |
+| SPARC        | `reg`                           | None           | `i8`, `i16`, `i32`, `i64` (SPARC64 only) |
+| SPARC        | `yreg`                          | N/A            | Only clobbers                           |
 | Arm64EC      | `reg`                           | None           | `i8`, `i16`, `i32`, `f32`, `i64`, `f64` |
 | Arm64EC      | `vreg`                          | None           | `i8`, `i16`, `i32`, `f32`, `i64`, `f64`, <br> `i8x8`, `i16x4`, `i32x2`, `i64x1`, `f32x2`, `f64x1`, <br> `i8x16`, `i16x8`, `i32x4`, `i64x2`, `f32x4`, `f64x2` |
 
@@ -135,6 +140,10 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
 | CSKY         | `r29`         | `rtb`     |
 | CSKY         | `r30`         | `svbr`    |
 | CSKY         | `r31`         | `tls`     |
+| SPARC        | `r[0-7]`      | `g[0-7]`  |
+| SPARC        | `r[8-15]`     | `o[0-7]`  |
+| SPARC        | `r[16-23]`    | `l[0-7]`  |
+| SPARC        | `r[24-31]`    | `i[0-7]`  |
 | Arm64EC      | `x[0-30]`     | `w[0-30]` |
 | Arm64EC      | `x29`         | `fp`      |
 | Arm64EC      | `x30`         | `lr`      |
@@ -150,8 +159,8 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
 
 | Architecture | Unsupported register                    | Reason                                                                                                                                                                              |
 | ------------ | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| All          | `sp`, `r15` (s390x)                     | The stack pointer must be restored to its original value at the end of an asm code block.                                                                                           |
-| All          | `fr` (Hexagon), `fp` (PowerPC), `$fp` (MIPS), `Y` (AVR), `r4` (MSP430), `a6` (M68k), `r11` (s390x), `x29` (Arm64EC) | The frame pointer cannot be used as an input or output.                                                 |
+| All          | `sp`, `r15` (s390x), `r14`/`o6` (SPARC) | The stack pointer must be restored to its original value at the end of an asm code block.                                                                                           |
+| All          | `fr` (Hexagon), `fp` (PowerPC), `$fp` (MIPS), `Y` (AVR), `r4` (MSP430), `a6` (M68k), `r11` (s390x), `r30`/`i6` (SPARC), `x29` (Arm64EC) | The frame pointer cannot be used as an input or output.                             |
 | All          | `r19` (Hexagon), `r29` (PowerPC), `r30` (PowerPC), `x19` (Arm64EC) | These are used internally by LLVM as "base pointer" for functions with complex stack frames.                                                             |
 | MIPS         | `$0` or `$zero`                         | This is a constant zero register which can't be modified.                                                                                                                           |
 | MIPS         | `$1` or `$at`                           | Reserved for assembler.                                                                                                                                                             |
@@ -174,6 +183,11 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
 | CSKY         | `r31`                                   | This is the TLS register.  |
 | s390x        | `c[0-15]`                               | Reserved by the kernel. |
 | s390x        | `a[0-1]`                                | Reserved for system use. |
+| SPARC        | `r0`/`g0`                               | This is always zero and cannot be used as inputs or outputs. |
+| SPARC        | `r1`/`g1`                               | Used internally by LLVM. |
+| SPARC        | `r5`/`g5`                               | Reserved for system. (SPARC32 only) |
+| SPARC        | `r6`/`g6`, `r7`/`g7`                    | Reserved for system. |
+| SPARC        | `r31`/`i7`                              | Return address cannot be used as inputs or outputs. |
 | Arm64EC      | `xzr`                                   | This is a constant zero register which can't be modified. |
 | Arm64EC      | `x18`                                   | This is an OS-reserved register. |
 | Arm64EC      | `x13`, `x14`, `x23`, `x24`, `x28`, `v[16-31]` | These are AArch64 registers that are not supported for Arm64EC. |
@@ -195,6 +209,7 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
 | s390x        | `reg`          | None     | `%r0`          | None          |
 | s390x        | `reg_addr`     | None     | `%r1`          | None          |
 | s390x        | `freg`         | None     | `%f0`          | None          |
+| SPARC        | `reg`          | None     | `%o0`          | None          |
 | CSKY         | `reg`          | None     | `r0`           | None          |
 | CSKY         | `freg`         | None     | `f0`           | None          |
 | Arm64EC      | `reg`          | None     | `x0`           | `x`           |
@@ -219,6 +234,9 @@ These flags registers must be restored upon exiting the asm block if the `preser
   - The condition code register `ccr`.
 - s390x
   - The condition code register `cc`.
+- SPARC
+  - Integer condition codes (`icc` and `xcc`)
+  - Floating-point condition codes (`fcc[0-3]`)
 - Arm64EC
   - Condition flags (`NZCV` register).
   - Floating-point status (`FPSR` register).