rust/src
Jacob Pratt 0de2341fef
Rollup merge of #136217 - taiki-e:csky-asm-flags, r=Amanieu
Mark condition/carry bit as clobbered in C-SKY inline assembly

C-SKY's compare and some arithmetic/logical instructions modify condition/carry bit (C) in PSR, but there is currently no way to mark it as clobbered in `asm!`.

This PR marks it as clobbered except when [`options(preserves_flags)`](https://doc.rust-lang.org/reference/inline-assembly.html#r-asm.options.supported-options.preserves_flags) is used.

Refs:
- Section 1.3 "Programming model" and Section 1.3.5 "Condition/carry bit" in CSKY Architecture user_guide:
  9f7121f7d4/CSKY%20Architecture%20user_guide.pdf

  > Under user mode, condition/carry bit (C) is located in the lowest bit of PSR, and it can be
accessed and changed by common user instructions. It is the only data bit that can be visited
under user mode in PSR.

  > Condition or carry bit represents the result after one operation. Condition/carry bit can be
clearly set according to the results of compare instructions or unclearly set as some
high-precision arithmetic or logical instructions. In addition, special instructions such as
DEC[GT,LT,NE] and XTRB[0-3] will influence the value of condition/carry bit.

- Register definition in LLVM:
  https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/CSKY/CSKYRegisterInfo.td#L88

cc ```@Dirreke``` ([target maintainer](aa6f5ab18e/src/doc/rustc/src/platform-support/csky-unknown-linux-gnuabiv2.md (target-maintainers)))

r? ```@Amanieu```

```@rustbot``` label +O-csky +A-inline-assembly
2025-02-12 20:09:58 -05:00
..
bootstrap Rollup merge of #136916 - onur-ozkan:fix-cc2ar, r=jieyouxu 2025-02-12 20:30:56 +01:00
build_helper Update username in build helper example 2025-01-28 10:51:30 +01:00
ci Auto merge of #136571 - marcoieni:ubuntu-24-large-runners, r=Mark-Simulacrum 2025-02-11 13:06:54 +00:00
doc Rollup merge of #136217 - taiki-e:csky-asm-flags, r=Amanieu 2025-02-12 20:09:58 -05:00
etc Update bootstrap completions 2025-02-05 15:33:40 +01:00
gcc@fd3498bff0 Update GCC version 2024-09-06 16:01:46 +02:00
librustdoc Nuke Buffer abstraction from librustdoc 💣 2025-02-12 15:50:06 +00:00
llvm-project@7e8c93c87c Update to LLVM 19.1.7 2025-01-14 14:46:09 +01:00
rustc-std-workspace update rustc-std-workspace crates 2024-11-04 07:45:15 +01:00
rustdoc-json-types rustdoc-json-types: Document that crate name isn't package name. 2025-02-01 19:57:59 +00:00
tools Rollup merge of #136890 - saethlin:swap_nonoverlapping, r=RalfJung 2025-02-12 20:30:54 +01:00
README.md
stage0 Update bootstrap compiler and rustfmt 2025-02-08 22:07:11 +00:00
version bump version 2025-01-03 10:36:06 +01:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.