Author Topic: Code location sensitivity of timings  (Read 40263 times)

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: Code location sensitivity of timings
« Reply #15 on: July 21, 2014, 06:19:30 AM »
deleted
« Last Edit: February 25, 2022, 08:25:48 AM by nidud »

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: Code location sensitivity of timings
« Reply #16 on: July 23, 2014, 01:21:19 AM »
deleted
« Last Edit: February 25, 2022, 08:26:02 AM by nidud »

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: Code location sensitivity of timings
« Reply #17 on: July 23, 2014, 01:28:20 AM »
deleted
« Last Edit: February 25, 2022, 08:26:16 AM by nidud »

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: Code location sensitivity of timings
« Reply #18 on: July 23, 2014, 01:55:38 AM »
deleted
« Last Edit: February 25, 2022, 08:26:31 AM by nidud »

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: Code location sensitivity of timings
« Reply #19 on: July 23, 2014, 02:08:28 AM »
deleted
« Last Edit: February 25, 2022, 08:26:47 AM by nidud »

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: Code location sensitivity of timings
« Reply #20 on: July 23, 2014, 03:41:08 AM »
deleted
« Last Edit: February 25, 2022, 08:27:00 AM by nidud »

jj2007

  • Member
  • *****
  • Posts: 12661
  • Assembler is fun ;-)
    • MasmBasic
Re: Code location sensitivity of timings
« Reply #21 on: July 23, 2014, 05:36:38 AM »
Minimum supported client
Windows XP

The SSE level used is SSE2 so how common is this combination?

It may hurt the feelings of some fans of old hard- and software, but writing code for >=(SSE2 & Win XP) should be OK for 99% of the users.

There is a poll on SSE support here: "I'm still waiting for SSE support :) (5 votes [2.45%])"

That was 2006, 8 years ago ;)

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: Code location sensitivity of timings
« Reply #22 on: July 23, 2014, 06:43:29 AM »
deleted
« Last Edit: February 25, 2022, 08:27:12 AM by nidud »

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: Code location sensitivity of timings
« Reply #23 on: July 23, 2014, 07:48:38 AM »
...or provide fallback routines
you can run a little startup init routine - detect SSE support level - and fill in addresses of PROC's
i am working on something along that line at the moment

these define TYPE's for up to 6 dword parms - you can extend it easily
Code: [Select]
_FUNC00  TYPEDEF PROTO
_FUNC04  TYPEDEF PROTO :DWORD
_FUNC08  TYPEDEF PROTO :DWORD,:DWORD
_FUNC12  TYPEDEF PROTO :DWORD,:DWORD,:DWORD
_FUNC16  TYPEDEF PROTO :DWORD,:DWORD,:DWORD,:DWORD
_FUNC20  TYPEDEF PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD
_FUNC24  TYPEDEF PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD

_PFUNC00 TYPEDEF Ptr _FUNC00
_PFUNC04 TYPEDEF Ptr _FUNC04
_PFUNC08 TYPEDEF Ptr _FUNC08
_PFUNC12 TYPEDEF Ptr _FUNC12
_PFUNC16 TYPEDEF Ptr _FUNC16
_PFUNC20 TYPEDEF Ptr _FUNC20
_PFUNC24 TYPEDEF Ptr _FUNC24

then, i am using a structure with function pointers in it
Code: [Select]
_FUNC STRUCT
  lpfnFunc1  _PFUNC04 ?    ;this function has 1 dword arg
  lpfnFunc2  _PFUNC12 ?    ;this function has 3 dword args
_FUNC STRUCT

and, in the .DATA? section...
Code: [Select]
_Func _FUNC <>
so, you set _Func.lpfnFunc1 and _Func.lpfnFunc2 to point at appropriate routines for the supported SSE level
then.....
Code: [Select]
    INVOKE  _Func.lpfnFunc1,arg1
    INVOKE  _Func.lpfnFunc2,arg1,arg2,arg3

;or

    push    edi
    mov     edi,offset _Func
    INVOKE  [edi]._FUNC.lpfnFunc1,arg1
    INVOKE  [edi]._FUNC.lpfnFunc2,arg1,arg2,arg3
    pop     edi

another way to go would be to put all the routines for each support level into a DLL
then, at init, load the DLL that is appropriate for the machine
the routines can then all have the same names

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: Code location sensitivity of timings
« Reply #24 on: July 23, 2014, 07:53:25 AM »
most people probably have at least SSE3
however, we can look at the forum members, alone, and find a few machines
some that probably support only MMX or SSE(1)

i bought this machine in 2005 - it supports SSE3, which was a new thing at the time
so - it's almost 10 years old

Gunther

  • Member
  • *****
  • Posts: 4067
  • Forgive your enemies, but never forget their names
Re: Code location sensitivity of timings
« Reply #25 on: July 23, 2014, 09:03:40 AM »
i bought this machine in 2005 - it supports SSE3, which was a new thing at the time
so - it's almost 10 years old

SSE3 was introduced in April 2005 with the Prescott revision of the Pentium 4 processor.

Gunther
Get your facts first, and then you can distort them.

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: Code location sensitivity of timings
« Reply #26 on: July 23, 2014, 09:26:21 AM »
deleted
« Last Edit: February 25, 2022, 08:27:28 AM by nidud »

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: Code location sensitivity of timings
« Reply #27 on: July 24, 2014, 03:45:40 AM »
deleted
« Last Edit: February 25, 2022, 08:27:42 AM by nidud »

jj2007

  • Member
  • *****
  • Posts: 12661
  • Assembler is fun ;-)
    • MasmBasic
Re: Code location sensitivity of timings
« Reply #28 on: July 24, 2014, 04:32:46 AM »
SSE3 was introduced in April 2005 with the Prescott revision of the Pentium 4 processor.

SSE2 was introduced in November 2000 with the P4 Willamette. In general, it's absolutely sufficient (try your luck, make Instr_() faster with SSE7.8...); in particular, pcmpeqb and pmovmskb are important improvements.
« Last Edit: July 24, 2014, 10:20:50 AM by jj2007 »

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: Code location sensitivity of timings
« Reply #29 on: July 25, 2014, 04:29:11 AM »
deleted
« Last Edit: February 25, 2022, 08:28:05 AM by nidud »