altivec and C - mission inpossible
  • Cocoon
    Cocoon
    imax
    Posts: 41 from 2004/9/20
    From: Russia
    Hello !

    i need speed up for critical time code.
    1. how use variables for use altivec register ?
    2. how use assembler code for include to GCC C code ?
    Is it possible ?
  • »22.01.19 - 19:19
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 2649 from 2003/3/5
    From: Canada
    2. I think this is what you want to read about: https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html
  • »22.01.19 - 20:08
    Profile Visit Website
  • MorphOS Developer
    CISC
    Posts: 618 from 2005/8/27
    From: the land with ...
    You might want to read about AltiVec Intrinsics too, you don't have to use asm.


    - CISC
  • »23.01.19 - 07:42
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Intuition
    Posts: 1100 from 2013/5/24
    From: Nederland
    Quote:

    imax wrote:
    Hello !

    i need speed up for critical time code.
    1. how use variables for use altivec register ?
    2. how use assembler code for include to GCC C code ?
    Is it possible ?


    Have you tried using -Ofast -maltivec -mabi=altivec as gcc flags?

    [ Edited by Intuition 28.01.2019 - 19:56 ]
    1.67GHz 15" PowerBook G4, 1GB RAM, 128MB Radeon 9700M Pro, 64GB SSD, MorphOS 3.15

    2.7GHz DP G5, 4GB RAM, 512MB Radeon X1950 Pro, 500GB SSHD, MorphOS 3.9
  • »28.01.19 - 20:55
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    BSzili
    Posts: 552 from 2012/6/8
    From: Hungary
    I doubt that will do much, auto-vectorization in GCC was never really good.
    This is just like television, only you can see much further.
  • »29.01.19 - 12:19
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Intuition
    Posts: 1100 from 2013/5/24
    From: Nederland
    Quote:

    BSzili wrote:
    I doubt that will do much, auto-vectorization in GCC was never really good.


    It depends on the code, no harm in trying.

    -mavx makes a huge difference on some code I've been working with recently that uses a lot of vec3's.
    1.67GHz 15" PowerBook G4, 1GB RAM, 128MB Radeon 9700M Pro, 64GB SSD, MorphOS 3.15

    2.7GHz DP G5, 4GB RAM, 512MB Radeon X1950 Pro, 500GB SSHD, MorphOS 3.9
  • »29.01.19 - 20:11
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Tom01
    Posts: 171 from 2009/9/20
    Remember, that Altivec-Data has to be 16 Byte alligned.
    And to enable Vectorization of Floating-Point-Reductions add -ffast-math

    [ Edited by Tom01 01.02.2019 - 23:00 ]
  • »31.01.19 - 18:33
    Profile Visit Website