We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1fdf932 commit 0a0fa0bCopy full SHA for 0a0fa0b
src/mem/x86_64.rs
@@ -179,24 +179,25 @@ pub unsafe fn c_string_length(s: *const core::ffi::c_char) -> usize {
179
180
asm!(
181
// search for a zero byte
182
- "xor al, al",
+ "xor %eax, %eax",
183
184
// unbounded memory region
185
- "xor rcx, rcx",
186
- "not rcx",
+ "xor %ecx, %ecx",
+ "not %rcx",
187
188
// forward direction
189
- "cld",
+ // (already set thanks to abi)
190
+ //"cld",
191
192
// perform search
- "repne scasb",
193
+ "repne scasb (%rdi), %al",
194
195
// extract length
196
- "dec rcx",
197
+ "dec %rcx",
198
inout("rdi") s => _,
199
out("rcx") n,
- options(nostack),
200
+ options(att_syntax, nostack),
201
);
202
203
n
0 commit comments