@@ -558,19 +558,24 @@ mod hw {
558
558
fn serialize_instruction_execution ( ) {
559
559
unsafe {
560
560
asm ! (
561
- "xor eax, eax" ,
561
+ "xor % eax, % eax" , // Intel syntax: "xor eax, eax"
562
562
// LLVM sometimes reserves `ebx` for its internal use, so we need to use
563
563
// a scratch register for it instead.
564
- "mov {tmp_rbx:r}, rbx" ,
564
+ "mov %rbx, {tmp_rbx:r}" , // Intel syntax: "mov {tmp_rbx:r}, rbx"
565
565
"cpuid" ,
566
- "mov rbx, {tmp_rbx:r}" ,
566
+ "mov {tmp_rbx:r}, % rbx" , // Intel syntax: "mov rbx, {tmp_rbx:r}"
567
567
tmp_rbx = lateout( reg) _,
568
568
// `cpuid` clobbers.
569
569
lateout( "eax" ) _,
570
570
lateout( "edx" ) _,
571
571
lateout( "ecx" ) _,
572
572
573
573
options( nostack) ,
574
+ // Older versions of LLVM do not support modifiers in
575
+ // Intel syntax inline asm; whenever Rust minimum LLVM version
576
+ // supports Intel syntax inline asm, remove and replace above
577
+ // instructions with Intel syntax version (from comments).
578
+ options( att_syntax) ,
574
579
) ;
575
580
}
576
581
}
@@ -588,7 +593,12 @@ mod hw {
588
593
in( "ecx" ) reg_idx,
589
594
lateout( "eax" ) lo,
590
595
lateout( "edx" ) hi,
591
- options( nostack)
596
+ options( nostack) ,
597
+ // Older versions of LLVM do not support modifiers in
598
+ // Intel syntax inline asm; whenever Rust minimum LLVM version
599
+ // supports Intel syntax inline asm, remove and replace above
600
+ // instructions with Intel syntax version (from comments).
601
+ options( att_syntax) ,
592
602
) ;
593
603
}
594
604
lo as u64 | ( hi as u64 ) << 32
0 commit comments