[quake3-commits] [ioquake/ioq3] 5909b9: Isolate the Altivec code so non-Altivec PPC target...

Simon McVittie smcv at debian.org
Sat May 12 14:14:51 EDT 2018


  Branch: refs/heads/master
  Home:   https://github.com/ioquake/ioq3
  Commit: 5909b9a1cf759ce1cdb1f7492e91fc0f0c0c48c4
      https://github.com/ioquake/ioq3/commit/5909b9a1cf759ce1cdb1f7492e91fc0f0c0c48c4
  Author: Simon McVittie <smcv at debian.org>
  Date:   2018-05-12 (Sat, 12 May 2018)

  Changed paths:
    M Makefile
    A code/client/snd_altivec.c
    M code/client/snd_local.h
    M code/client/snd_mix.c
    A code/renderergl1/tr_altivec.c
    M code/renderergl1/tr_local.h
    M code/renderergl1/tr_shade.c
    M code/renderergl1/tr_shade_calc.c
    M code/renderergl1/tr_surface.c
    M code/renderergl2/tr_shade.c
    M code/renderergl2/tr_shade_calc.c
    M code/renderergl2/tr_surface.c

  Log Message:
  -----------
  Isolate the Altivec code so non-Altivec PPC targets can use the same binary.

Moved all the code using Altivec intrinsics to separate files. This 
means we can optionally use GCC's -maltivec on just these files, which
are chosen at runtime if the CPU supports Altivec, and compile the rest
without it, making a single binary that has Altivec optimizations but
can still work on G3.

Unlike SSE and similar extensions on x86, there does not seem to be
a way to enable conditional, targeted use of Altivec based on runtime
detection (which is what ioquake3 wants to do) without also giving the
compiler permission to use Altivec in code generation; so to not crash
on CPUs that do not implement Altivec, we'll have to turn it off
altogether, except in translation units that are only entered when
runtime Altivec detection is successful.

This has been tested on Linux PPC (on an Altivec-enabled CPU),
but we may need further work after testing trickles out to other
PowerPC devices and ancient Mac OS X builds.

I did a little work on this patch, but the majority of the effort belongs 
to Simon McVittie (thanks!).



      **NOTE:** This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the quake3-commits mailing list