rust/tests/codegen/asm
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
..
aarch64-clobbers.rs tests/codegen/asm: Remove uses of rustc_attrs and lang_items features by using minicore 2024-12-20 23:19:12 +09:00
avr-clobbers.rs tests/codegen/asm: Remove uses of rustc_attrs and lang_items features by using minicore 2024-12-20 23:19:12 +09:00
bpf-clobbers.rs Support clobber_abi in BPF inline assembly 2025-01-29 02:14:25 +09:00
csky-clobbers.rs Mark condition/carry bit as clobbered in C-SKY inline assembly 2025-01-29 06:46:05 +09:00
foo.s
global_asm.rs
global_asm_include.rs
global_asm_x2.rs
goto.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
hexagon-clobbers.rs tests/codegen/asm: Remove uses of rustc_attrs and lang_items features by using minicore 2024-12-20 23:19:12 +09:00
may_unwind.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
maybe-uninit.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
msp430-clobbers.rs tests/codegen/asm: Remove uses of rustc_attrs and lang_items features by using minicore 2024-12-20 23:19:12 +09:00
multiple-options.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
options.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
powerpc-clobbers.rs tests/codegen/asm: Remove uses of rustc_attrs and lang_items features by using minicore 2024-12-20 23:19:12 +09:00
riscv-clobbers.rs tests/codegen/asm: Remove uses of rustc_attrs and lang_items features by using minicore 2024-12-20 23:19:12 +09:00
s390x-clobbers.rs tests/codegen/asm: Remove uses of rustc_attrs and lang_items features by using minicore 2024-12-20 23:19:12 +09:00
sanitize-llvm.rs tests/codegen/asm: Remove uses of rustc_attrs and lang_items features by using minicore 2024-12-20 23:19:12 +09:00
sparc-clobbers.rs tests/codegen/asm: Remove uses of rustc_attrs and lang_items features by using minicore 2024-12-20 23:19:12 +09:00
x86-clobber_abi.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
x86-clobbers.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
x86-target-clobbers.rs