Author Topic: AVX safe FFmpeg  (Read 687 times)

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 205
  • Posts: 2927
  • Karma: +31/-0
    • View Profile
Re: AVX safe FFmpeg
« Reply #15 on: February 19, 2021, 08:56:04 pm »
You might want to try linking with wl.exe (wlink) as it seems to me the linker handles larger alignment

Unfortunately, wlink/wl  does not have an option/command to set  "between parts alignment"  within object.

Does it need it? The version I built previously used wl for linking and seemed to align stuff correctly, though I guess maybe a coincidence.

OS4User

  • Sr. Member
  • ****
  • Thank You
  • -Given: 89
  • -Receive: 12
  • Posts: 276
  • Karma: +5/-0
    • View Profile
Re: AVX safe FFmpeg
« Reply #16 on: February 19, 2021, 10:53:46 pm »
You might want to try linking with wl.exe (wlink) as it seems to me the linker handles larger alignment

Unfortunately, wlink/wl  does not have an option/command to set  "between parts alignment"  within object.

Does it need it? The version I built previously used wl for linking and seemed to align stuff correctly, though I guess maybe a coincidence.

Data for  AVX instruction can be situated in many places, for .ex  - stack, dynamically allocated memory, static vars, etc.

I am speaking about static variables now. Our last GCC is able generate  proper .obj files with necessary  alignments. But if final data object  in LX module  is linked from parts (from several files)    we can meet and we indeed meet   wrong alignment.

Compiler reflects in obj file a demand that  it has to be linked with previous file  with certain alignment    in case current file  contains  data with specific alignment.

But not in our case. Historically, GCC for OS/2  uses a.out  as object format. A.out  is not able to carry info about requested alignment  to linker   that is why  we meet  wrong alignment in final binary.

The  best solution  is  to use  ELF  format  for objects files  (it requested a lot of time  for coding and fixing  GCC for OS/2).    One more way  -  could be just request  from linker   to  link every data parts  with 64 bytes align -  but wlink does not have such option/command -  so no way here.




Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 205
  • Posts: 2927
  • Karma: +31/-0
    • View Profile
Re: AVX safe FFmpeg
« Reply #17 on: February 27, 2021, 09:01:24 am »
There's a new version uploaded to netlabs-exp. To quote,
Quote
I've uploaded a new version 4.2.2-4 to netlabs-exp with -fno-common --disable-avx2 --disable-avx512. Note that I still use --disable-avx2 because of my current assumption that it is not safe to generate AVX2 code w/o a proper alignment support from GCC (see my comment above). I guess that it works for you now just by accident.

Closing this. Please feel free to reopen if the new RPMs don't work for you.
untested here.