Error: operand size mismatch for `movupd'

For other topics related to the FreeBASIC project or its community.
BurghHouse
Posts: 34
Joined: Jul 09, 2008 21:57
Contact:

Error: operand size mismatch for `movupd'

Postby BurghHouse » Dec 06, 2013 17:01

Sometimes - and only occasionally - the compiler compiles OK but the linker rejects the .ASM code with the above error. Obviously I can re-compile with -R and see the .ASM, and yes indeed there is a movupd instruction at the given line number but then its down to me to figure out what I have to change in my .bas to fix it.

Surely it's a bug if the compiler is generating bad .ASM?

I wish I could append a simple program example but the only case I have at present is a very complex program (c10,000 lines of code) and I'm sure you don't want me to post that!

Help!
BurghHouse
Posts: 34
Joined: Jul 09, 2008 21:57
Contact:

Re: Error: operand size mismatch for `movupd'

Postby BurghHouse » Dec 06, 2013 17:08

If it helps, the bad instruction follows a

Code: Select all

call _fb_StrAssign@20

and the actual instructions the compiler is objecting to are

Code: Select all

movupd qword Ptr [eax+24], xmm6

and

Code: Select all

movupd xmm7, qword Ptr [eax+24]
movupd qword Ptr [ebx+24], xmm7
BurghHouse
Posts: 34
Joined: Jul 09, 2008 21:57
Contact:

Re: Error: operand size mismatch for `movupd'

Postby BurghHouse » Dec 06, 2013 17:16

Bit more (useful?) info:

In my program I have the following TYPE definition

Code: Select all

Type ResultSizeDataItemType
  Desc As String
  FullDesc As String
  SizeMM_X As Double
  SizeMM_Y As Double
  ImageXmin As Integer
  ImageYmin As Integer
  ImageXmax As Integer
  ImageYmax As Integer
  BoxText As String
  BoxBackground As Integer
End Type


Nothing odd about that, I hear you say, and indeed not - I use similar structures all the time. But it's somthing to do with this because if I recode it thus:

Code: Select all

Type ResultSizeDataItemType
  Desc As String*2048
  FullDesc As String*2048
  SizeMM_X As Double
  SizeMM_Y As Double
  ImageXmin As Integer
  ImageYmin As Integer
  ImageXmax As Integer
  ImageYmax As Integer
  BoxText As String*2048
  BoxBackground As Integer
End Type

everything magically works - it compiles and runs.

I can't list all the things I do with this structure - there are too many - but give me a while and, by trial and error I'll try to narrow it down.
TJF
Posts: 3502
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: Error: operand size mismatch for `movupd'

Postby TJF » Dec 06, 2013 19:00

Compiler version? OS?

Do you use SHARED variables named like cpu registers?
dkl
Site Admin
Posts: 3210
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Error: operand size mismatch for `movupd'

Postby dkl » Dec 06, 2013 20:34

fbc doesn't normally generate code using xmm* registers; are you using -fpu sse? or is it inline asm?
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Re: Error: operand size mismatch for `movupd'

Postby MichaelW » Dec 07, 2013 8:51

In general, for instructions with two operands the source and destination operands must be the same size. Per the Intel manual, the MOVUPD instruction “Moves a double quadword containing two packed double-precision floating-point values from the source operand (second operand) to the destination operand (first operand).” For as a qword is a quad-word with a length of 8 bytes. To specify a double quadword you can use OWORD, short for octal-word, with a length of 16 bytes or 128 bits, same as the XMM registers.

Code: Select all

movupd OWORD PTR [eax+24], xmm6

If you can manage a 16-byte alignment for the relevant parts of your structure, you can use the faster MOVAPD instruction.

And the corresponding as directive for declaring octal-word data is .octa

Code: Select all

asm
    .section .data
    .balign 16
    x1: .octa 0
    .section .text
end asm
BurghHouse
Posts: 34
Joined: Jul 09, 2008 21:57
Contact:

Re: Error: operand size mismatch for `movupd'

Postby BurghHouse » Dec 07, 2013 18:20

Compiler version 0.90.1, OS Wiondows XP Sp3
I'm not using inline asm, just vanilla FreeBASIC statements
I'm not sure how I act upon MichealW's suggestion
BurghHouse
Posts: 34
Joined: Jul 09, 2008 21:57
Contact:

Re: Error: operand size mismatch for `movupd'

Postby BurghHouse » Dec 07, 2013 18:32

One of the code segments causing the error is this one:

Code: Select all

'''' reminder - this is how the structure is defined
Type ResultSizeDataItemType
  Desc As String
  FullDesc As String
  SizeMM_X As Double
  SizeMM_Y As Double
  ImageXmin As Integer
  ImageYmin As Integer
  ImageXmax As Integer
  ImageYmax As Integer
  BoxText As String
  BoxBackground As Integer
End Type

Const MaxResultSizeDataItems = 100
Dim Shared As ResultSizeDataItemType ResultSizeDataItem(MaxResultSizeDataItems)
Dim Shared As Integer NumResultSizeDataItems, ResultSizeDataItemIX

'''' and this is the code that causes (one of) the errors

Sub CreateAnyControlSizeItem(UsrItemNum As Integer, UsrDesc As String)
With ResultSizeDataItem(UsrItemNum)
  .Desc = UsrDesc
  .FullDesc = .Desc
  .SizeMM_X = MinSizeDataItemDisplaySizePX    [defined thus: Const MinSizeDataItemDisplaySizePX = 50.0]
  .SizeMM_Y = MinSizeDataItemDisplaySizePX
  .ImageXmin = 1
  .ImageYmin = 1
  .ImageXmax = 2
  .ImageYmax = 2
  .BoxText = ""
  .BoxBackground = ControlBoxBackground         [defined thus: Dim Shared As Integer ControlBoxBackground]
End With
End Sub
BurghHouse
Posts: 34
Joined: Jul 09, 2008 21:57
Contact:

Re: Error: operand size mismatch for `movupd'

Postby BurghHouse » Dec 07, 2013 18:40

Right, I've reduced it to a simple program that exhibits the error. The following is the entire code:

Code: Select all

Const MinSizeDataItemDisplaySizePX = 50.0
Dim Shared As Integer ControlBoxBackground

Type ResultSizeDataItemType
  Desc As String
  FullDesc As String
  SizeMM_X As Double
  SizeMM_Y As Double
  ImageXmin As Integer
  ImageYmin As Integer
  ImageXmax As Integer
  ImageYmax As Integer
  BoxText As String
  BoxBackground As Integer
End Type

Const MaxResultSizeDataItems = 100
Dim Shared As ResultSizeDataItemType ResultSizeDataItem(MaxResultSizeDataItems)
Dim Shared As Integer NumResultSizeDataItems, ResultSizeDataItemIX

Sub CreateAnyControlSizeItem(UsrItemNum As Integer, UsrDesc As String)
With ResultSizeDataItem(UsrItemNum)
  .Desc = UsrDesc
  .FullDesc = .Desc
  .SizeMM_X = MinSizeDataItemDisplaySizePX
  .SizeMM_Y = MinSizeDataItemDisplaySizePX
  '- Following may be changed later
  .ImageXmin = 1
  .ImageYmin = 1
  .ImageXmax = 2
  .ImageYmax = 2
  .BoxText = ""
  .BoxBackground = ControlBoxBackground
End With
End Sub

It compiles but won't link. The comiler/linker output is thus:

Code: Select all

FreeBASIC Compiler - Version 0.90.1 (07-17-2013) for win32
Copyright (C) 2004-2013 The FreeBASIC development team.
standalone
compiling:    J:\Burgh House Software\Projects\SimplePhotoResize\BUG_ResultSizeDataItem_2.BAS -o J:\Burgh House Software\Projects\SimplePhotoResize\BUG_ResultSizeDataItem_2.asm (main module)
assembling:   C:\Program Files\freeBASIC\bin\win32\as.exe --32 --strip-local-absolute "J:\Burgh House Software\Projects\SimplePhotoResize\BUG_ResultSizeDataItem_2.asm" -o "J:\Burgh House Software\Projects\SimplePhotoResize\BUG_ResultSizeDataItem_2.o"
assembling failed: 'C:\Program Files\freeBASIC\bin\win32\as.exe' terminated with exit code 1
J:\Burgh House Software\Projects\SimplePhotoResize\BUG_ResultSizeDataItem_2.asm: Assembler messages:
J:\Burgh House Software\Projects\SimplePhotoResize\BUG_ResultSizeDataItem_2.asm:40: Error: operand size mismatch for `movupd'
J:\Burgh House Software\Projects\SimplePhotoResize\BUG_ResultSizeDataItem_2.asm:152: Error: operand size mismatch for `movupd'
J:\Burgh House Software\Projects\SimplePhotoResize\BUG_ResultSizeDataItem_2.asm:153: Error: operand size mismatch for `movupd'


Thoughts?
BurghHouse
Posts: 34
Joined: Jul 09, 2008 21:57
Contact:

Re: Error: operand size mismatch for `movupd'

Postby BurghHouse » Dec 07, 2013 18:45

PS compile options are:
-v -w all -fpu sse -vec 2
BurghHouse
Posts: 34
Joined: Jul 09, 2008 21:57
Contact:

Re: Error: operand size mismatch for `movupd'

Postby BurghHouse » Dec 07, 2013 18:49

If I remove "-fpu sse" I get:

Code: Select all

FreeBASIC Compiler - Version 0.90.1 (07-17-2013) for win32
Copyright (C) 2004-2013 The FreeBASIC development team.
standalone
compiling:    J:\Burgh House Software\Projects\SimplePhotoResize\BUG_ResultSizeDataItem_2.BAS -o J:\Burgh House Software\Projects\SimplePhotoResize\BUG_ResultSizeDataItem_2.asm (main module)

Aborting due to runtime error 12 ("segmentation violation" signal)

If I remove both "-fpu sse -vec 2" it compiles OK.
So I have a workaround, but I would like to use -fpu sse -vec 2 . . .
dkl
Site Admin
Posts: 3210
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Error: operand size mismatch for `movupd'

Postby dkl » Dec 07, 2013 19:56

I can reproduce it when using -fpu sse -vec 2, it looks like it's a bug in fbc's SSE emitter. (also the compiler crash when using -vec 2 without -fpu sse, that's probably a separate issue)
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Re: Error: operand size mismatch for `movupd'

Postby MichaelW » Dec 08, 2013 1:01

BurghHouse wrote:It compiles but won't link

The error is being caught by as, before the linking stage.

Starting with your simple program that exhibits the error, and bracketing the problem statement that I can identify with NOP instructions to make the code easy to identify in the assembly output:

Code: Select all

Const MinSizeDataItemDisplaySizePX = 50.0
Dim Shared As Integer ControlBoxBackground

Type ResultSizeDataItemType
  Desc As String
  FullDesc As String
  SizeMM_X As Double
  SizeMM_Y As Double
  ImageXmin As Integer
  ImageYmin As Integer
  ImageXmax As Integer
  ImageYmax As Integer
  BoxText As String
  BoxBackground As Integer
End Type

Const MaxResultSizeDataItems = 100
asm nop
Dim Shared As ResultSizeDataItemType ResultSizeDataItem(MaxResultSizeDataItems)
asm nop
Dim Shared As Integer NumResultSizeDataItems, ResultSizeDataItemIX

Sub CreateAnyControlSizeItem(UsrItemNum As Integer, UsrDesc As String)
With ResultSizeDataItem(UsrItemNum)
  .Desc = UsrDesc
  .FullDesc = .Desc
  asm nop
  .SizeMM_X = MinSizeDataItemDisplaySizePX
  .SizeMM_Y = MinSizeDataItemDisplaySizePX
  asm nop
  '- Following may be changed later
  .ImageXmin = 1
  .ImageYmin = 1
  .ImageXmax = 2
  .ImageYmax = 2
  .BoxText = ""
  .BoxBackground = ControlBoxBackground
End With
End Sub

And using this command line with the added -C and -R to prevent FBC from deleting the assembly file and object module:

Code: Select all

fbc -v -C -R -w all -fpu sse -vec 2 test.bas

In the cmd console I get:

Code: Select all

D:\Program Files\FreeBASIC\My\SIMD\BurghHouse>fbc -v -C -R -w all -fpu sse -vec
2 test.bas
FreeBASIC Compiler - Version 0.90.1 (07-17-2013) for win32
Copyright (C) 2004-2013 The FreeBASIC development team.
standalone
compiling:    test.bas -o test.asm (main module)
assembling:   D:\Program Files\FreeBASIC\bin\win32\as.exe --32 --strip-local-abs
olute "test.asm" -o "test.o"
test.asm: Assembler messages:
test.asm:43: Error: operand size mismatch for `movupd'
test.asm:166: Error: operand size mismatch for `movupd'
test.asm:167: Error: operand size mismatch for `movupd'
assembling failed: 'D:\Program Files\FreeBASIC\bin\win32\as.exe' terminated with
 exit code 1

And here is the assembly output, starting with line 39 and ending with line 167:

Code: Select all

nop
movlpd xmm6, qword ptr [_Lt_0011]
unpcklpd xmm6, xmm6
mov eax, dword ptr [ebp-4]
movupd qword ptr [eax+24], xmm6
nop
mov eax, dword ptr [ebp-4]
mov dword ptr [eax+40], 1
mov eax, dword ptr [ebp-4]
mov dword ptr [eax+44], 1
mov eax, dword ptr [ebp-4]
mov dword ptr [eax+48], 2
mov eax, dword ptr [ebp-4]
mov dword ptr [eax+52], 2
push 0
push 1
push offset _Lt_0000
push -1
mov eax, dword ptr [ebp-4]
lea ebx, [eax+56]
push ebx
call _fb_StrAssign@20
mov ebx, dword ptr [ebp-4]
mov eax, dword ptr [_CONTROLBOXBACKGROUND]
mov dword ptr [ebx+68], eax
.Lt_000F:
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
.balign 16

.globl _main
_main:
push ebp
mov ebp, esp
and esp, 0xFFFFFFF0
sub esp, 4
push ebx
push esi
push edi
mov dword ptr [ebp-4], 0
call ___main
push 0
push dword ptr [ebp+12]
push dword ptr [ebp+8]
call _fb_Init@12
.Lt_0002:
nop
nop
.Lt_0003:
push 0
call _fb_End@4
mov eax, dword ptr [ebp-4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
.balign 16
__ZN22RESULTSIZEDATAITEMTYPEC1Ev:
push ebp
mov ebp, esp
mov eax, dword ptr [ebp+8]
mov dword ptr [eax], 0
mov dword ptr [eax+4], 0
mov dword ptr [eax+8], 0
mov eax, dword ptr [ebp+8]
mov dword ptr [eax+12], 0
mov dword ptr [eax+16], 0
mov dword ptr [eax+20], 0
mov eax, dword ptr [ebp+8]
mov dword ptr [eax+24], 0
mov dword ptr [eax+28], 0
mov eax, dword ptr [ebp+8]
mov dword ptr [eax+32], 0
mov dword ptr [eax+36], 0
mov eax, dword ptr [ebp+8]
mov dword ptr [eax+40], 0
mov eax, dword ptr [ebp+8]
mov dword ptr [eax+44], 0
mov eax, dword ptr [ebp+8]
mov dword ptr [eax+48], 0
mov eax, dword ptr [ebp+8]
mov dword ptr [eax+52], 0
mov eax, dword ptr [ebp+8]
mov dword ptr [eax+56], 0
mov dword ptr [eax+60], 0
mov dword ptr [eax+64], 0
mov eax, dword ptr [ebp+8]
mov dword ptr [eax+68], 0
.Lt_0004:
.Lt_0005:
mov esp, ebp
pop ebp
ret
.balign 16
__ZN22RESULTSIZEDATAITEMTYPEaSERS_:
push ebp
mov ebp, esp
push ebx
.Lt_0008:
push 0
push -1
mov eax, dword ptr [ebp+12]
lea ebx, [eax]
push ebx
push -1
mov ebx, dword ptr [ebp+8]
lea eax, [ebx]
push eax
call _fb_StrAssign@20
push 0
push -1
mov eax, dword ptr [ebp+12]
lea ebx, [eax+12]
push ebx
push -1
mov ebx, dword ptr [ebp+8]
lea eax, [ebx+12]
push eax
call _fb_StrAssign@20
mov eax, dword ptr [ebp+12]
mov ebx, dword ptr [ebp+8]
movupd xmm7, qword ptr [eax+24]
movupd qword ptr [ebx+24], xmm7

QWORD PTR is correct for a single DOUBLE, but not for two DOUBLES packed in a double quadword. So far, I can see no fix for this problem other than coding the SSE operations in inline assembly.

FWIW, if I remove the inline assembly, then compile with this command line:

Code: Select all

fbc -gen gcc -v -C -R -RR -w all -fpu sse -vec 2 test.bas

Then in the cmd console I get:

Code: Select all

D:\Program Files\FreeBASIC\My\SIMD\BurghHouse>fbc -gen gcc -v -C -R -RR -w all -
fpu sse -vec 2 test.bas
FreeBASIC Compiler - Version 0.90.1 (07-17-2013) for win32
Copyright (C) 2004-2013 The FreeBASIC development team.
standalone
compiling:    test.bas -o test.c (main module)
compiling C:  C:\MinGW\bin\gcc.exe -m32 -S -nostdlib -nostdinc -Wall -Wno-unused
-label -Wno-unused-function -Wno-unused-variable -Wno-main -Werror-implicit-func
tion-declaration -O0 -fno-strict-aliasing -frounding-math -fno-math-errno -mtune
=i486 -mfpmath=sse -msse2 "test.c" -o "test.asm"
assembling:   D:\Program Files\FreeBASIC\bin\win32\as.exe --32 --strip-local-abs
olute "test.asm" -o "test.o"
linking:      D:\Program Files\FreeBASIC\bin\win32\ld.exe -o "test.exe" -subsyst
em console "D:\Program Files\FreeBASIC\lib\win32\fbextra.x" --stack 1048576,1048
576 -s -L "D:\Program Files\FreeBASIC\lib\win32" -L "." "D:\Program Files\FreeBA
SIC\lib\win32\crt2.o" "D:\Program Files\FreeBASIC\lib\win32\crtbegin.o" "D:\Prog
ram Files\FreeBASIC\lib\win32\fbrt0.o" "test.o" "-(" -lfb -lgcc -lmsvcrt -lkerne
l32 -lmingw32 -lmingwex -lmoldname -lsupc++ -lgcc_eh "-)" "D:\Program Files\Free
BASIC\lib\win32\crtend.o"

And along with the EXE and object module, I get the intermediate C source and AT&T syntax assembly output, but despite the SSE references above the assembly output contains no SSE code:

Code: Select all

   .file   "test.c"
.lcomm _CONTROLBOXBACKGROUND$,4,4
.lcomm _RESULTSIZEDATAITEM$,7272,32
.lcomm _NUMRESULTSIZEDATAITEMS$,4,4
.lcomm _RESULTSIZEDATAITEMIX$,4,4
   .section .rdata,"dr"
LC1:
   .ascii "\0"
   .text
   .globl   _CREATEANYCONTROLSIZEITEM@8
   .def   _CREATEANYCONTROLSIZEITEM@8;   .scl   2;   .type   32;   .endef
_CREATEANYCONTROLSIZEITEM@8:
LFB0:
   .cfi_startproc
   pushl   %ebp
   .cfi_def_cfa_offset 8
   .cfi_offset 5, -8
   movl   %esp, %ebp
   .cfi_def_cfa_register 5
   subl   $56, %esp
L2:
   movl   8(%ebp), %edx
   movl   %edx, %eax
   sall   $3, %eax
   addl   %edx, %eax
   sall   $3, %eax
   addl   $_RESULTSIZEDATAITEM$, %eax
   movl   %eax, -12(%ebp)
   movl   $0, 16(%esp)
   movl   $-1, 12(%esp)
   movl   12(%ebp), %eax
   movl   %eax, 8(%esp)
   movl   $-1, 4(%esp)
   movl   -12(%ebp), %eax
   movl   %eax, (%esp)
   call   _fb_StrAssign@20
   subl   $20, %esp
   movl   %eax, -16(%ebp)
   movl   -12(%ebp), %eax
   leal   12(%eax), %edx
   movl   $0, 16(%esp)
   movl   $-1, 12(%esp)
   movl   -12(%ebp), %eax
   movl   %eax, 8(%esp)
   movl   $-1, 4(%esp)
   movl   %edx, (%esp)
   call   _fb_StrAssign@20
   subl   $20, %esp
   movl   %eax, -20(%ebp)
   movl   -12(%ebp), %eax
   leal   24(%eax), %ecx
   movl   $0, %eax
   movl   $1078525952, %edx
   movl   %eax, (%ecx)
   movl   %edx, 4(%ecx)
   movl   -12(%ebp), %eax
   addl   $40, %eax
   movl   $1, (%eax)
   movl   -12(%ebp), %eax
   addl   $44, %eax
   movl   $1, (%eax)
   movl   -12(%ebp), %eax
   addl   $48, %eax
   movl   $2, (%eax)
   movl   -12(%ebp), %eax
   addl   $52, %eax
   movl   $2, (%eax)
   movl   -12(%ebp), %eax
   addl   $56, %eax
   movl   $0, 16(%esp)
   movl   $1, 12(%esp)
   movl   $LC1, 8(%esp)
   movl   $-1, 4(%esp)
   movl   %eax, (%esp)
   call   _fb_StrAssign@20
   subl   $20, %esp
   movl   -12(%ebp), %eax
   leal   68(%eax), %edx
   movl   _CONTROLBOXBACKGROUND$, %eax
   movl   %eax, (%edx)
L3:
   leave
   .cfi_restore 5
   .cfi_def_cfa 4, 4
   ret   $8
   .cfi_endproc
LFE0:
   .def   ___main;   .scl   2;   .type   32;   .endef
   .globl   _main
   .def   _main;   .scl   2;   .type   32;   .endef
_main:
LFB1:
   .cfi_startproc
   leal   4(%esp), %ecx
   .cfi_def_cfa 1, 0
   andl   $-16, %esp
   pushl   -4(%ecx)
   pushl   %ebp
   .cfi_escape 0x10,0x5,0x2,0x75,0
   movl   %esp, %ebp
   pushl   %ebx
   pushl   %ecx
   .cfi_escape 0xf,0x3,0x75,0x78,0x6
   .cfi_escape 0x10,0x3,0x2,0x75,0x7c
   subl   $32, %esp
   movl   %ecx, %ebx
   call   ___main
   movl   $0, -12(%ebp)
   movl   $0, 8(%esp)
   movl   4(%ebx), %eax
   movl   %eax, 4(%esp)
   movl   (%ebx), %eax
   movl   %eax, (%esp)
   call   _fb_Init@12
   subl   $12, %esp
L5:
L6:
   movl   $0, (%esp)
   call   _fb_End@4
   subl   $4, %esp
   movl   -12(%ebp), %eax
   leal   -8(%ebp), %esp
   popl   %ecx
   .cfi_restore 1
   .cfi_def_cfa 1, 0
   popl   %ebx
   .cfi_restore 3
   popl   %ebp
   .cfi_restore 5
   leal   -4(%ecx), %esp
   .cfi_def_cfa 4, 4
   ret
   .cfi_endproc
LFE1:
   .def   __ZN22RESULTSIZEDATAITEMTYPEC1Ev;   .scl   3;   .type   32;   .endef
__ZN22RESULTSIZEDATAITEMTYPEC1Ev:
LFB2:
   .cfi_startproc
   pushl   %ebp
   .cfi_def_cfa_offset 8
   .cfi_offset 5, -8
   movl   %esp, %ebp
   .cfi_def_cfa_register 5
   pushl   %edi
   pushl   %ebx
   .cfi_offset 7, -12
   .cfi_offset 3, -16
   movl   8(%ebp), %eax
   movl   %eax, %edx
   movl   $12, %ebx
   movl   $0, %eax
   movl   %edx, %ecx
   andl   $1, %ecx
   testl   %ecx, %ecx
   je   L9
   movb   %al, (%edx)
   incl   %edx
   decl   %ebx
L9:
   movl   %edx, %ecx
   andl   $2, %ecx
   testl   %ecx, %ecx
   je   L10
   movw   %ax, (%edx)
   addl   $2, %edx
   subl   $2, %ebx
L10:
   movl   %ebx, %ecx
   shrl   $2, %ecx
   movl   %edx, %edi
   rep stosl
   movl   %edi, %edx
   movl   %ebx, %ecx
   andl   $2, %ecx
   testl   %ecx, %ecx
   je   L11
   movw   %ax, (%edx)
   addl   $2, %edx
L11:
   movl   %ebx, %ecx
   andl   $1, %ecx
   testl   %ecx, %ecx
   je   L12
   movb   %al, (%edx)
   incl   %edx
L12:
   movl   8(%ebp), %eax
   addl   $12, %eax
   movl   %eax, %edx
   movl   $12, %ebx
   movl   $0, %eax
   movl   %edx, %ecx
   andl   $1, %ecx
   testl   %ecx, %ecx
   je   L13
   movb   %al, (%edx)
   incl   %edx
   decl   %ebx
L13:
   movl   %edx, %ecx
   andl   $2, %ecx
   testl   %ecx, %ecx
   je   L14
   movw   %ax, (%edx)
   addl   $2, %edx
   subl   $2, %ebx
L14:
   movl   %ebx, %ecx
   shrl   $2, %ecx
   movl   %edx, %edi
   rep stosl
   movl   %edi, %edx
   movl   %ebx, %ecx
   andl   $2, %ecx
   testl   %ecx, %ecx
   je   L15
   movw   %ax, (%edx)
   addl   $2, %edx
L15:
   movl   %ebx, %ecx
   andl   $1, %ecx
   testl   %ecx, %ecx
   je   L16
   movb   %al, (%edx)
   incl   %edx
L16:
   movl   8(%ebp), %eax
   addl   $24, %eax
   movl   $0, (%eax)
   movl   $0, 4(%eax)
   movl   8(%ebp), %eax
   addl   $32, %eax
   movl   $0, (%eax)
   movl   $0, 4(%eax)
   movl   8(%ebp), %eax
   addl   $40, %eax
   movl   $0, (%eax)
   movl   8(%ebp), %eax
   addl   $44, %eax
   movl   $0, (%eax)
   movl   8(%ebp), %eax
   addl   $48, %eax
   movl   $0, (%eax)
   movl   8(%ebp), %eax
   addl   $52, %eax
   movl   $0, (%eax)
   movl   8(%ebp), %eax
   addl   $56, %eax
   movl   %eax, %edx
   movl   $12, %ebx
   movl   $0, %eax
   movl   %edx, %ecx
   andl   $1, %ecx
   testl   %ecx, %ecx
   je   L17
   movb   %al, (%edx)
   incl   %edx
   decl   %ebx
L17:
   movl   %edx, %ecx
   andl   $2, %ecx
   testl   %ecx, %ecx
   je   L18
   movw   %ax, (%edx)
   addl   $2, %edx
   subl   $2, %ebx
L18:
   movl   %ebx, %ecx
   shrl   $2, %ecx
   movl   %edx, %edi
   rep stosl
   movl   %edi, %edx
   movl   %ebx, %ecx
   andl   $2, %ecx
   testl   %ecx, %ecx
   je   L19
   movw   %ax, (%edx)
   addl   $2, %edx
L19:
   movl   %ebx, %ecx
   andl   $1, %ecx
   testl   %ecx, %ecx
   je   L20
   movb   %al, (%edx)
   incl   %edx
L20:
   movl   8(%ebp), %eax
   addl   $68, %eax
   movl   $0, (%eax)
L21:
L22:
   popl   %ebx
   .cfi_restore 3
   popl   %edi
   .cfi_restore 7
   popl   %ebp
   .cfi_restore 5
   .cfi_def_cfa 4, 4
   ret
   .cfi_endproc
LFE2:
   .def   __ZN22RESULTSIZEDATAITEMTYPEaSERS_;   .scl   3;   .type   32;   .endef
__ZN22RESULTSIZEDATAITEMTYPEaSERS_:
LFB3:
   .cfi_startproc
   pushl   %ebp
   .cfi_def_cfa_offset 8
   .cfi_offset 5, -8
   movl   %esp, %ebp
   .cfi_def_cfa_register 5
   subl   $56, %esp
L24:
   movl   $0, 16(%esp)
   movl   $-1, 12(%esp)
   movl   12(%ebp), %eax
   movl   %eax, 8(%esp)
   movl   $-1, 4(%esp)
   movl   8(%ebp), %eax
   movl   %eax, (%esp)
   call   _fb_StrAssign@20
   subl   $20, %esp
   movl   %eax, -12(%ebp)
   movl   12(%ebp), %eax
   leal   12(%eax), %edx
   movl   8(%ebp), %eax
   addl   $12, %eax
   movl   $0, 16(%esp)
   movl   $-1, 12(%esp)
   movl   %edx, 8(%esp)
   movl   $-1, 4(%esp)
   movl   %eax, (%esp)
   call   _fb_StrAssign@20
   subl   $20, %esp
   movl   %eax, -16(%ebp)
   movl   8(%ebp), %eax
   leal   24(%eax), %ecx
   movl   12(%ebp), %eax
   movl   28(%eax), %edx
   movl   24(%eax), %eax
   movl   %eax, (%ecx)
   movl   %edx, 4(%ecx)
   movl   8(%ebp), %eax
   leal   40(%eax), %edx
   movl   12(%ebp), %eax
   movl   40(%eax), %eax
   movl   %eax, (%edx)
   movl   8(%ebp), %eax
   leal   44(%eax), %edx
   movl   12(%ebp), %eax
   movl   44(%eax), %eax
   movl   %eax, (%edx)
   movl   8(%ebp), %eax
   leal   48(%eax), %edx
   movl   12(%ebp), %eax
   movl   48(%eax), %eax
   movl   %eax, (%edx)
   movl   8(%ebp), %eax
   leal   52(%eax), %edx
   movl   12(%ebp), %eax
   movl   52(%eax), %eax
   movl   %eax, (%edx)
   movl   12(%ebp), %eax
   leal   56(%eax), %edx
   movl   8(%ebp), %eax
   addl   $56, %eax
   movl   $0, 16(%esp)
   movl   $-1, 12(%esp)
   movl   %edx, 8(%esp)
   movl   $-1, 4(%esp)
   movl   %eax, (%esp)
   call   _fb_StrAssign@20
   subl   $20, %esp
   movl   %eax, -20(%ebp)
   movl   8(%ebp), %eax
   leal   68(%eax), %edx
   movl   12(%ebp), %eax
   movl   68(%eax), %eax
   movl   %eax, (%edx)
L25:
   leave
   .cfi_restore 5
   .cfi_def_cfa 4, 4
   ret
   .cfi_endproc
LFE3:
   .def   __ZN22RESULTSIZEDATAITEMTYPED1Ev;   .scl   3;   .type   32;   .endef
__ZN22RESULTSIZEDATAITEMTYPED1Ev:
LFB4:
   .cfi_startproc
   pushl   %ebp
   .cfi_def_cfa_offset 8
   .cfi_offset 5, -8
   movl   %esp, %ebp
   .cfi_def_cfa_register 5
   subl   $24, %esp
L27:
L28:
   movl   8(%ebp), %eax
   addl   $56, %eax
   movl   %eax, (%esp)
   call   _fb_StrDelete@4
   subl   $4, %esp
   movl   8(%ebp), %eax
   addl   $12, %eax
   movl   %eax, (%esp)
   call   _fb_StrDelete@4
   subl   $4, %esp
   movl   8(%ebp), %eax
   movl   %eax, (%esp)
   call   _fb_StrDelete@4
   subl   $4, %esp
   leave
   .cfi_restore 5
   .cfi_def_cfa 4, 4
   ret
   .cfi_endproc
LFE4:
   .def   __GLOBAL__I;   .scl   3;   .type   32;   .endef
__GLOBAL__I:
LFB5:
   .cfi_startproc
   pushl   %ebp
   .cfi_def_cfa_offset 8
   .cfi_offset 5, -8
   movl   %esp, %ebp
   .cfi_def_cfa_register 5
   subl   $20, %esp
L30:
   movl   $_RESULTSIZEDATAITEM$, -8(%ebp)
   movl   $0, -4(%ebp)
   jmp   L31
L33:
   nop
L31:
   movl   -8(%ebp), %eax
   movl   %eax, (%esp)
   call   __ZN22RESULTSIZEDATAITEMTYPEC1Ev
   addl   $72, -8(%ebp)
   incl   -4(%ebp)
   cmpl   $101, -4(%ebp)
   jne   L33
L32:
L29:
   leave
   .cfi_restore 5
   .cfi_def_cfa 4, 4
   ret
   .cfi_endproc
LFE5:
   .section   .ctors,"w"
   .align 4
   .long   __GLOBAL__I
   .text
   .def   __GLOBAL__D;   .scl   3;   .type   32;   .endef
__GLOBAL__D:
LFB6:
   .cfi_startproc
   pushl   %ebp
   .cfi_def_cfa_offset 8
   .cfi_offset 5, -8
   movl   %esp, %ebp
   .cfi_def_cfa_register 5
   subl   $40, %esp
L35:
   movl   $_RESULTSIZEDATAITEM$+7200, -16(%ebp)
   movl   $0, -12(%ebp)
   jmp   L36
L38:
   nop
L36:
   movl   -16(%ebp), %eax
   movl   %eax, (%esp)
   call   __ZN22RESULTSIZEDATAITEMTYPED1Ev
   subl   $72, -16(%ebp)
   incl   -12(%ebp)
   cmpl   $101, -12(%ebp)
   jne   L38
L37:
L34:
   leave
   .cfi_restore 5
   .cfi_def_cfa 4, 4
   ret
   .cfi_endproc
LFE6:
   .section   .dtors,"w"
   .align 4
   .long   __GLOBAL__D
   .def   _fb_StrAssign@20;   .scl   2;   .type   32;   .endef
   .def   _fb_Init@12;   .scl   2;   .type   32;   .endef
   .def   _fb_End@4;   .scl   2;   .type   32;   .endef
   .def   _fb_StrDelete@4;   .scl   2;   .type   32;   .endef
BurghHouse
Posts: 34
Joined: Jul 09, 2008 21:57
Contact:

Re: Error: operand size mismatch for `movupd'

Postby BurghHouse » Dec 09, 2013 9:29

dkl wrote:I can reproduce it when using -fpu sse -vec 2, it looks like it's a bug in fbc's SSE emitter. (also the compiler crash when using -vec 2 without -fpu sse, that's probably a separate issue)


That was what I'd concluded too. I don't know how to log such a bug but I guess you do so do you mind logging it?

I'll continue compiling without -fpu sse -vec 2 until 0.90.2 (or whatever)

Many thanks.
brybry
Project Member
Posts: 69
Joined: Aug 27, 2005 14:43

Re: Error: operand size mismatch for `movupd'

Postby brybry » Dec 09, 2013 18:35

I will look into this soon. I know this type of bug has showed up a number of times over the years. Previous versions of the assembler and the linker didn't complain about these mismatches and allowed my mistakes to go undetected.

This should be a simple fix.

Return to “Community Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest