Skip to contentSkip to conversation

x86/assembly: replace MOVSD uses

PATCH New Jan Beulich 1 participant 1 message Oct 6, 2022 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/assembly: replace MOVSD uses

D-suffixed mnemonics do not exist in AT&T syntax; an L suffix is to be used instead. MOVSD and CMPSD are only SSE2 instructions in AT&T mode. Future gas versions may at least warn about such bogus uses. (Due to an implementation detail [read: bug] gas has been supporting MOVSD and CMPSD as string instructions, but not any of the other mnemonics where Intel/AMD documentation enumerates a possible D suffix, e.g. STOS or IRET. Clang's integrated assembler, yet more oddly, supports only MOVSD as a string instruction, and apparently only without any operands.)

---
I also view as questionable the use of semicolons in two of the three instances changed - REP isn't really an instruction on its own. I wasn't sure though whether adjusting this at the same time would be deemed acceptable.

arch/x86/boot/bioscall.S +2 -2
@@ -32,7 +32,7 @@ intcall:
 	movw	%dx, %si
 	movw	%sp, %di
 	movw	$11, %cx
-	rep; movsd
+	rep; movsl
 
 	/* Pop full state from the stack */
 	popal
@@ -67,7 +67,7 @@ intcall:
 	jz	4f
 	movw	%sp, %si
 	movw	$11, %cx
-	rep; movsd
+	rep; movsl
 4:	addw	$44, %sp
 
 	/* Restore state and return */
arch/x86/lib/iomap_copy_64.S +1 -1
@@ -10,6 +10,6 @@
  */
 SYM_FUNC_START(__iowrite32_copy)
 	movl %edx,%ecx
-	rep movsd
+	rep movsl
 	RET
 SYM_FUNC_END(__iowrite32_copy)