Browse Source

* Replaced 'movzbl %r8b, %r8' because it is rejected by GAS (suffix does not match the operand size). The correct instruction is 'movzbq %r8b, %r8' but that one is rejected by FPC reader instead. Provides a fix for broken builds of targets using external assembler (Mantis #19188).

git-svn-id: trunk@17339 -
sergei 14 years ago
parent
commit
e1616fd8ef
1 changed files with 9 additions and 1 deletions
  1. 9 1
      rtl/x86_64/x86_64.inc

+ 9 - 1
rtl/x86_64/x86_64.inc

@@ -365,8 +365,16 @@ Procedure FillChar(var x;count:SizeInt;value:byte);assembler;nostackframe;
     cmp    $8, %rdx
     jl     .Ltiny
 
+// TODO: movz?q and movs?q are not accepted by FPC asmreader, it needs fixing.
+// `movzbl' instead is accepted and generates correct code with internal assembler,
+// but breaks targets using external GAS (Mantis #19188).
+// So use a different instruction for now.
+
     { expand byte value  }
-    movzbl %r8b, %r8
+    andq   $0xffffffffffffff00, %r8
+{
+    movzbq %r8b, %r8
+}
     mov    $0x0101010101010101,%r9
     imul   %r9, %r8