Recent

Author Topic: BGRABitmap Error: Asm: [movq mem??,reg64] invalid  (Read 5130 times)

abtaylr

  • Full Member
  • ***
  • Posts: 107
BGRABitmap Error: Asm: [movq mem??,reg64] invalid
« on: June 14, 2016, 08:12:40 pm »
I am having difficulty with BGRABitmap.  I downloaded the latest version 8.9.2 after opening in Package -> Open Package File, I attempt to compile but I have received numerous errors:

bgradefaultbitmap.pas(2821,3) Error: Asm: [movq mem??,reg64] invalid combination of opcode and operands

I haven't found the offending asm code.  I wonder if the problem might be a compiler flag setting -- e.g. AT&T vs. Intel.

abtaylr

  • Full Member
  • ***
  • Posts: 107
Re: BGRABitmap Error: Asm: [movq mem??,reg64] invalid
« Reply #1 on: June 14, 2016, 08:25:57 pm »
The errors are all within the file BGRAdefaultbitmap.pas .  There are about 25 of them.

procedure TBGRADefaultBitmap.FillQuadLinearColor(pt1, pt2, pt3, pt4: TPointF;
  c1, c2, c3, c4: TBGRAPixel);
. . . .
  FillTriangleLinearColor(pt1,pt2,center, c1,c2,centerColor);
  FillTriangleLinearColor(pt2,pt3,center, c2,c3,centerColor);
  FillTriangleLinearColor(pt3,pt4,center, c3,c4,centerColor);
  FillTriangleLinearColor(pt4,pt1,center, c4,c1,centerColor);
end;

procedure TBGRADefaultBitmap.FillQuadLinearMappingLightness(pt1, pt2, pt3,
  pt4: TPointF; texture: IBGRAScanner; tex1, tex2, tex3, tex4: TPointF; light1,
  light2, light3, light4: word; TextureInterpolation: Boolean);
. . . .
  FillTriangleLinearMappingLightness(pt1,pt2,center, texture,tex1,tex2,centerTex, light1,light2,centerLight, TextureInterpolation);
  FillTriangleLinearMappingLightness(pt2,pt3,center, texture,tex2,tex3,centerTex, light2,light3,centerLight, TextureInterpolation);
  FillTriangleLinearMappingLightness(pt3,pt4,center, texture,tex3,tex4,centerTex, light3,light4,centerLight, TextureInterpolation);
  FillTriangleLinearMappingLightness(pt4,pt1,center, texture,tex4,tex1,centerTex, light4,light1,centerLight, TextureInterpolation);
end;

procedure BGRAGradientFill(bmp: TBGRACustomBitmap; x, y, x2, y2: integer;
  c1, c2: TBGRAPixel; gtype: TGradientType; o1, o2: TPointF; mode: TDrawMode;
  gammaColorCorrection: boolean = True; Sinus: Boolean=False);
begin
  bmp.GradientFill(x,y,x2,y2,c1,c2,gtype,o1,o2,mode,gammaColorCorrection,sinus);
end;

I am running Kubuntu 16.04 64bit

abtaylr

  • Full Member
  • ***
  • Posts: 107
Re: BGRABitmap Error: Asm: [movq mem??,reg64] invalid
« Reply #2 on: June 14, 2016, 08:41:05 pm »
While tracing back through the code, I came upon BGRAPoligonAliased.pas which shows Intel code.

abtaylr

  • Full Member
  • ***
  • Posts: 107
Re: BGRABitmap Error: Asm: [movq mem??,reg64] invalid
« Reply #3 on: June 14, 2016, 09:15:50 pm »
When I have encountered Intel code previously in Lazarus, I have had to convert over to AT&T to get passed the problem.  I have looked at the compiler flags, but don't see one dealing with AT&T vs. Intel. I noticed that this version has only been released earlier today. There might be a problem in the release -- small error somewhere, etc. Hopefully, the developer can take a look.

Cyrax

  • Hero Member
  • *****
  • Posts: 836
Re: BGRABitmap Error: Asm: [movq mem??,reg64] invalid
« Reply #4 on: June 15, 2016, 12:39:56 pm »
In problematic unit, add {$asmmode intel} after {$mode <x>}{$H+} switches.

Cooler

  • Newbie
  • Posts: 6
Re: BGRABitmap Error: Asm: [movq mem??,reg64] invalid
« Reply #5 on: January 22, 2022, 08:19:29 pm »
I have the same error in my own code:
Code: [Select]
/home/runner/work/ApusGameEngine/ApusGameEngine/Apus.Engine.ShadersGL.pas(639,3) Error: (8007) Asm: [movq mem??,reg64] invalid combination of opcode and operands
however, there is no ASM code in that unit. Moreover, this happens only when the target is Linux and at the GitHub servers only: https://github.com/Cooler2/ApusGameEngine/runs/4908563676?check_suite_focus=true
The same Lazarus version on my own PC compiles the code without errors, so it looks very strange.

 

TinyPortal © 2005-2018