Skip to content

Commit d938f77

Browse files
committed
x86_64: Work around cg_gcc bug
rust-lang/rustc_codegen_gcc#485 ``` libgccjit.so: error: invalid register name for 'output_register' error: could not copy "/app/output.example.fb61ce7e3f5ff483-cgu.0.rcgu.s" to "/app/output.s": No such file or directory (os error 2) ```
1 parent f97604a commit d938f77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/imp/atomic128/x86_64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ unsafe fn cmpxchg16b(dst: *mut u128, old: u128, new: u128) -> (u128, bool) {
124124
asm!(
125125
"xchg {rbx_tmp}, rbx", // save rbx which is reserved by LLVM
126126
concat!("lock cmpxchg16b xmmword ptr [", $rdi, "]"),
127-
"sete r8b",
127+
"sete cl",
128128
"mov rbx, {rbx_tmp}", // restore rbx
129129
rbx_tmp = inout(reg) new.pair.lo => _,
130130
in("rcx") new.pair.hi,
131131
inout("rax") old.pair.lo => prev_lo,
132132
inout("rdx") old.pair.hi => prev_hi,
133133
in($rdi) dst,
134-
out("r8b") r,
134+
lateout("cl") r,
135135
// Do not use `preserves_flags` because CMPXCHG16B modifies the ZF flag.
136136
options(nostack),
137137
)

0 commit comments

Comments
 (0)