Forum > FPC development
Bug ? [vsqrtss xmmreg,xmmreg,mem128] invalid combination of opcode and operand
(1/1)
Nitorami:
I get an error message on compiling this bit of code. Windows10 & 7, FPC 3.0.4. Can anybody test and confirm this please ? Seems to be a problem with AVX instruction set and optimisation for register variables. CPU-Z reports that my machine supports the AVX instruction set, so I suspect this is a bug.
Compile with: fpc mist.pas -CfSSE2 -CpCOREAVX -Mobjfpc -O2 -Twin32
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---//fpc mist.pas -CfSSE2 -CpCOREAVX -Mobjfpc -O2 -Twin32 type float = single; TVector = array of float; TMatrix = array of TVector; function mtx_cholesky (const a:TMatrix):TMatrix;var l : TMatrix; c : float;begin c := 3; c := sqrt(c); //-> invalid combination of opcode and operand SetLength (l,3,3); l[0,0]:=c; result:=l;end; beginend.
ASerge:
Confirm.
It is interesting that if you add the generation of asm code (-al), then everything passes.
--- Code: ASM [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---...# [12] c := 3; vmovss _$PROGRAM$_Ld1,%xmm0 movss %xmm0,-56(%ebp)# [13] c := sqrt(c); //-> invalid combination of opcode and operand vsqrtss -56(%ebp),%xmm0,%xmm0 vmovss %xmm0,-56(%ebp)...
Nitorami:
Indeed, very odd. I will file a bug report.
marcov:
Did you try -CfAVX ?
Seems a bit strange to allow AVX instructions, but not for the CPU?
Nitorami:
Yes, same behaviour.
Navigation
[0] Message Index