Author Topic: Bug repport  (Read 28513 times)

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Bug repport
« on: February 03, 2016, 01:51:30 AM »
deleted
« Last Edit: February 25, 2022, 11:12:44 AM by nidud »

johnsa

  • Member
  • ****
  • Posts: 893
    • Uasm
Re: Bug repport
« Reply #1 on: February 03, 2016, 03:34:34 AM »
Thanks for an excellent/ detailed report!

Let's work through the issues one by one.

The first one is this annoyance around intptr_t in main.c

If we use long and forget about intptr_t.. (how it used to be once in the source) then the binary version of hjwasm works on Win7 but gives a general failure when executed on Win10...
If we use intptr_t .. it doesn't compile for some compilers like GCC ..

Code: [Select]


#ifdef __UNIX__
#if defined( intptr_t )
intptr_t    fh; //fixed by ToutEnMasm intptr_t instead of long
#else
long        fh; // more compatible type (linux builds etc) when intptr_t isn't valid.
#endif
#else
intptr_t    fh;
#endif

This block needs to be modified to something that works with EVERY C compiler then.. suggestions welcome? :)



ALIGN3.ASO: missing warning
We intentionally removed this warning, because you would have it using align 32 as well, which was very annoying when trying to align AVX structs / data.
For this particular case I would say we need to amend the regression, as a user I would expect to align things however I see fit. [open for discussion for values > 32]?

working bottom up..

Code: [Select]
HJWASM
00000124  C5F877                vzeroall
vs
ASMC/JWASM
00000124  C5FC77                vzeroall
0000000000402004 C5 FC 77             vzeroall 
0000000000402007 C5 F8 77             vzeroupper 
This is what the encoding should be.. so this is a BUG.

Code: [Select]
HJWASM
000000D6  C4E37D04C101          vpermilps ymm0, ymm1, 1
vs
ASMC/JWASM
000000D6  C4E37D0CC101          vpermilps ymm0, ymm1, 1
In this case HJWASM encoding is correct and confirmed against FASM and Intel manual..
FASM = C4 E3 7D 04 C1 01
Intel Manual: VEX.256.66.0F3A.W0 04 /r ib      [c4 e3 7d]= the vex portion which should be followed by 0x04.

Code: [Select]
vpsllq  xmm0, xmm1, xmm2
This one is a BUG, the src/dst registers are being encoded the wrong way around.

Code: [Select]
C4E2FD190500000000 vbroadcastsd ymm0, m64
The W bit of the 3 byte vex encoding SHOULD be 0 yielding 7D not FD as the 3rd byte... bug


mov   eax,HIGHWORD 80000000h appears to be leaving the top half of eax signed with 0xffff... this is wrong.


shld eax,ecx,1,2    <--- this isn't a valid instruction:  SHLD eax,ecx,1 is and works ?


johnsa

  • Member
  • ****
  • Posts: 893
    • Uasm
Re: Bug repport
« Reply #2 on: February 03, 2016, 03:42:49 AM »
I've logged the above into github issues and will start fixing them.
I suggest we get them sorted and then re-run the tests, Bearing in mind that there are a few cases where hjwasm is correct and the others not !

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: Bug repport
« Reply #3 on: February 03, 2016, 04:26:37 AM »
deleted
« Last Edit: February 25, 2022, 11:12:58 AM by nidud »

TWell

  • Member
  • ****
  • Posts: 743
Re: Bug repport
« Reply #4 on: February 03, 2016, 05:04:19 AM »
Quote
intptr_t   uintptr_t   Integer type capable of holding a value converted from a void pointer and then be converted back to that type with a value that compares equal to the original pointer.
Optional: These typedefs may not be defined in some library implementations.*
Quote
intptr_t    fh;
We compile hjwasm to x64 too. There have to use it?

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: Bug repport
« Reply #5 on: February 03, 2016, 06:26:05 AM »
deleted
« Last Edit: February 25, 2022, 11:13:08 AM by nidud »

johnsa

  • Member
  • ****
  • Posts: 893
    • Uasm
Re: Bug repport
« Reply #6 on: February 03, 2016, 08:33:54 AM »
size_t is working for me here on win7 and win10 using both Visual C and GCC 5.x builds, so for now I'm going to stick to that and see how it goes :)

habran

  • Member
  • *****
  • Posts: 1228
    • uasm
Re: Bug repport
« Reply #7 on: February 03, 2016, 08:42:13 AM »
Good job nidud :t
it works for me as well on windows 8.1
Cod-Father

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: Bug repport
« Reply #8 on: February 04, 2016, 04:49:37 AM »
deleted
« Last Edit: February 25, 2022, 11:13:19 AM by nidud »

johnsa

  • Member
  • ****
  • Posts: 893
    • Uasm
Re: Bug repport
« Reply #9 on: February 04, 2016, 08:26:56 AM »
Excellent thanks!

I'm slowly working my way through the regression findings one by one and putting them onto the github issues page, from whence Habran and I are making our way through them in batches.. it's a bit of a process but we'll get there shortly!

Thanks for all the testing and support!

TouEnMasm

  • Member
  • *****
  • Posts: 1764
    • EditMasm
Re: Bug repport
« Reply #10 on: February 04, 2016, 04:46:07 PM »
Win 10
Link problem,"corrupted object file"
Fa is a musical note to play with CL

habran

  • Member
  • *****
  • Posts: 1228
    • uasm
Re: Bug repport
« Reply #11 on: February 05, 2016, 09:26:28 AM »
ToutEnMasm, it happens because vblendvpd xmm0, xmm1,m128 is missing 4th operand,
it suppose to be vblendvpd xmm0, xmm1,m128,xmm2
It is now fixed but you have to wait until Johnsa upload it on Git.
He will let you know when ready.
Cod-Father

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: Bug repport
« Reply #12 on: February 05, 2016, 11:33:00 AM »
"repport" should have only one "p"

habran

  • Member
  • *****
  • Posts: 1228
    • uasm
Re: Bug repport
« Reply #13 on: February 05, 2016, 02:15:47 PM »
Pure thing, "rapport" is much better off ;)
Where is that equal opportunity , it also has 2 "p" :(
« Last Edit: February 05, 2016, 04:42:19 PM by habran »
Cod-Father

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: Bug repport
« Reply #14 on: February 05, 2016, 04:21:35 PM »
it was a bug, so i repported it   :lol: