Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6871291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:47:14+00:00 2026-05-27T03:47:14+00:00

typedef float v4sf __attribute__ ((mode(V4SF))); This is in GCC. Anyone knows the equivalence syntax?

  • 0
typedef float v4sf __attribute__ ((mode(V4SF)));

This is in GCC. Anyone knows the equivalence syntax?

VS 2010 will show __attribute__ has no storage class of this type, and mode is not defined.

I searched on the Internet and it said

Equivalent to __attribute__( aligned( size ) ) in GCC

It is helpful
for former unix developers or people writing code that works on
multiple platforms that in GCC you achieve the same results using
attribute( aligned( … ) )

See here for more information:
http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Type-Attributes.html#Type-Attributes

The full GCC code is here: http://pastebin.com/bKkTTmH1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:47:14+00:00Added an answer on May 27, 2026 at 3:47 am

    If you’re looking for the alignment directive in VC++ it’s __declspec(align(16)). (or whatever you want the alignment to be)

    And example usage is this:

    __declspec(align(16)) float x[] = {1.,2.,3.,4.};
    

    http://msdn.microsoft.com/en-us/library/83ythb65.aspx

    Note that both attribute (in GCC) and __declspec (in VC++) are compiler-specific extensions.

    EDIT :

    Now that I take a second look at the code, it’s gonna take more work than just replacing the __attribute__ line with the VC++ equivalent to get it to compile in VC++.

    VC++ doesn’t have any if these macros/functions that you are using:

    • __builtin_ia32_xorps
    • __builtin_ia32_loadups
    • __builtin_ia32_mulps
    • __builtin_ia32_addps
    • __builtin_ia32_storeups

    You’re better off just replacing all of those with SSE intrinsics – which will work on both GCC and VC++.


    Here’s the code converted to intrinsics:

    float *mv_mult(float mat[SIZE][SIZE], float vec[SIZE]) {
        static float ret[SIZE];
        float temp[4];
        int i, j;
        __m128 m, v, r;
    
        for (i = 0; i < SIZE; i++) {
            r = _mm_xor_ps(r, r);
    
            for (j = 0; j < SIZE; j += 4) {
                m = _mm_loadu_ps(&mat[i][j]);
                v = _mm_loadu_ps(&vec[j]);
                v = _mm_mul_ps(m, v);
                r = _mm_add_ps(r, v);
            }
    
            _mm_storeu_ps(temp, r);
            ret[i] = temp[0] + temp[1] + temp[2] + temp[3];
        }
    
        return ret;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok so I have struct like this typedef struct { float x; float y;
If I have a class like this: typedef union { __m128 quad; float numbers[4];
I'm making a vector/matrix library. (GCC, ARM NEON, iPhone) typedef struct{ float v[4]; }
I made a typedef for float arrays, like this: typedef float fooType[]; So that
I see a code as below: #include stdio.h #define VECTOR_SIZE 4 typedef float v4sf
I'm trying to do this: typedef struct { float x; float y; } coords;
In C code, I am trying to convert this (example): typedef struct { float
Having problems with the output of this formula: typedef struct { float t, Vx,
template struct A{ typedef float atype; typedef typename tB::btype typeB; }; template struct B{
This typedef: typedef DWORD WINAPI (* CM_Open_DevNode_Key)(DWORD, DWORD, DWORD, DWORD, PHKEY, DWORD); compiles fine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.