Author Topic: New HJWasm release  (Read 30907 times)

habran

  • Member
  • *****
  • Posts: 1228
    • uasm
Re: New HJWasm release
« Reply #15 on: May 18, 2016, 05:30:15 PM »
I was not aware of that :icon_eek:
Here it is:
mingw32-gcc.exe -O3 -DWIN64 -DNDEBUG -I.\H -I"C:\Program Files (x86)\mingw-w64\i686-4.9.2-posix-dwarf-rt_v3-rev0\mingw32\i686-w64-mingw32\bin" -I"C:\Program Files (x86)\CodeBlocks\MinGW\bin" -c "C:\Users\Brane
Cod-Father

TWell

  • Member
  • ****
  • Posts: 743
Re: New HJWasm release
« Reply #16 on: May 18, 2016, 05:38:08 PM »
-m64 isn't in commandline, so resut was 32-bit.

jj2007

  • Member
  • *****
  • Posts: 13957
  • Assembly is fun ;-)
    • MasmBasic
Re: New HJWasm release
« Reply #17 on: May 18, 2016, 05:38:56 PM »
It seems you picked the right options this time - almost as fast as AsmC :t

Code: [Select]
OxPT_Assembler HJWasm32 ; 3.15
OxPT_Assembler HJWasm64 ; 2.80 secs

Btw where are your bottlenecks? Is loading string arrays and finding matches in these strings one of them?
Code: [Select]
- the FAST option is typically about twice as fast as CRT strstr, but 3..4 times as fast when used with
  MasmBasic string arrays (Intel Core i5 timings for counting a rare word in a file with 800 MB, 6 Mio lines):
232 ms for fast Instr_
795 ms for "normal" Instr_
999 ms for Masm32 InString
929 ms for CRT strstr
;)

jj2007

  • Member
  • *****
  • Posts: 13957
  • Assembly is fun ;-)
    • MasmBasic
Re: New HJWasm release
« Reply #18 on: May 18, 2016, 05:40:34 PM »
-m64 isn't in commandline, so resut was 32-bit.

Oops, you are right - doping alarm :dazzled:

Btw you could check if you have an old GCC version. Google finds plenty of hits for gcc 64-bit slower than 32-bit, many of them around spring 2014. So maybe the developers have saved the honour of 64-bit compilers in the meantime 8)

habran

  • Member
  • *****
  • Posts: 1228
    • uasm
Re: New HJWasm release
« Reply #19 on: May 18, 2016, 07:34:55 PM »
OK, let see this one, is it x64 ::)
Cod-Father

jj2007

  • Member
  • *****
  • Posts: 13957
  • Assembly is fun ;-)
    • MasmBasic
Re: New HJWasm release
« Reply #20 on: May 18, 2016, 08:08:48 PM »
Is in my test something wrong :icon_confused:

Code: [Select]
OPT_Assembler hjwasm32gcc3 ; 2.7
OxPT_Assembler hjwasm64gcc ; 6.1
OPT_Assembler AsmC ; 2.1 secs
::)

jj2007

  • Member
  • *****
  • Posts: 13957
  • Assembly is fun ;-)
    • MasmBasic
Re: New HJWasm release
« Reply #21 on: May 18, 2016, 08:32:01 PM »
OK, let see this one, is it x64 ::)

2.55 secs, so far your best one :t

(one little problem: Olly says it's 32-bit code...)

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: New HJWasm release
« Reply #22 on: May 18, 2016, 09:02:29 PM »
deleted
« Last Edit: February 25, 2022, 11:48:22 AM by nidud »

jj2007

  • Member
  • *****
  • Posts: 13957
  • Assembly is fun ;-)
    • MasmBasic
Re: New HJWasm release
« Reply #23 on: May 18, 2016, 09:48:54 PM »
The switch still trashes registers

That seems not the only problem. Here is a snippet - try with the latest AsmC and HJWasm versions 8)
Code: [Select]
include \masm32\include\masm32rt.inc

.code
start:
  m2m edi, -5
  .Repeat
print chr$(13, 10)
print str$(edi), 9
.switch edi
.case -4
print "case -4 "
; .break
.case -2
print "case -2 "
; .break
.case 0
print "case 0 "
.break
.case 2
print "case +2 "
.break
.case 4
print "case +4 "
.break
.Default
print "default"
.Endsw
inc edi
  .Until sdword ptr edi>5
  inkey chr$(13, 10, "--- ok? ---")
  exit
end start

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: New HJWasm release
« Reply #24 on: May 18, 2016, 10:38:12 PM »
deleted
« Last Edit: February 25, 2022, 11:48:32 AM by nidud »

jj2007

  • Member
  • *****
  • Posts: 13957
  • Assembly is fun ;-)
    • MasmBasic
Re: New HJWasm release
« Reply #25 on: May 18, 2016, 11:32:39 PM »
With AsmC, no options but .break instead, the .break causes an exit of the .Repeat loop. Is that "by design"?

habran

  • Member
  • *****
  • Posts: 1228
    • uasm
Re: New HJWasm release
« Reply #26 on: May 18, 2016, 11:35:35 PM »
Hi nidud,
This code below is a brilliant idea, and I like it a lot, however, it is not applicable in 64 bit because it would force linker LARGEADDRESS  error, while I was writing the code my mind was focused on 64 bit and 32 bit was just conversion from 64 bit, now I see that I have to start to think from 32 bit side if I write 32 bit code 
Code: [Select]
cmp eax,min
jl endsw
cmp eax,max
jg endsw
push eax
movzx eax,index[eax-min]
mov eax,table[eax*4]
xchg eax,[esp]
retn
In the case of jj2007 source, I don't think that any ASM programmer would write such a code that would trash registers that are needed for next iteration.
You can, of course, push register on the stack, and then purposely overwrite that memory on the stack, and than complain that the assembler is not good because it let you overwrite the stack space ::)
If that happened I would not fill sorry for that "programmer"   
Cod-Father

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: New HJWasm release
« Reply #27 on: May 19, 2016, 12:07:59 AM »
deleted
« Last Edit: February 25, 2022, 11:48:49 AM by nidud »

jj2007

  • Member
  • *****
  • Posts: 13957
  • Assembly is fun ;-)
    • MasmBasic
Re: New HJWasm release
« Reply #28 on: May 19, 2016, 12:11:07 AM »
In the case of jj2007 source, I don't think that any ASM programmer would write such a code that would trash registers that are needed for next iteration ... would not fill sorry for that "programmer"

So far, I have tried to be helpful. Show me one occasion where I insulted you as a "programmer" or similar.

Besides, this is obviously valid code, since edi is a non-volatile register. I perfectly understand why you are pissed off, but please concentrate on your homework instead of attacking others.

habran

  • Member
  • *****
  • Posts: 1228
    • uasm
Re: New HJWasm release
« Reply #29 on: May 19, 2016, 12:21:33 AM »
My intention was not to attack you jj2007, I am grateful for your help and cooperation, and I already said before how much I appreciate you as a programmer, however, I am sure that you would never write this construction in your programs, and you have to admit that :biggrin:
Cod-Father