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 4237658
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:48:08+00:00 2026-05-21T02:48:08+00:00

I have some SIMD code in Altivec processing 32 bit integer values in parallel.

  • 0

I have some SIMD code in Altivec processing 32 bit integer values in parallel. In some cases I want to load the integers as little endian, in other cases as big endian (note: this choice is regardless of the native CPU endianess; it is based on what algorithm is running). Doing the actual byte swap is very easy using Altivec’s permute operations, as documented by Apple.

The part I’m worried about is that PowerPC allows either big or little endian operation, and so I don’t know if I need to byte swap on little endian loads/stores or big endian loads/stores. (Currently my code just always does it for little endian and never swaps for big endian memory ops, which works fine on the 970 I’m currently using since of course it’s running big-endian).

From what I can find, PPCs in little-endian mode are relatively rare, but they do exist, and ideally I’d like to have my code work correctly and quickly regardless of mode.

Is there a way of handling big and little endian loads to AltiVec registers regardless of CPU endianness? Are there other issues related to this I should know about? Wikipedia has the (uncited, naturally) statement:

“AltiVec operations, despite being 128-bit, are treated as if they were 64-bit. This allows for compatibility with little-endian motherboards that were designed prior to AltiVec.”

which makes me think there may be other nastiness specific to AltiVec in little-endian mode.

  • 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-21T02:48:09+00:00Added an answer on May 21, 2026 at 2:48 am

    Pretty much all PowerPC code out there will assume big-endian and all ARM code out there will assume little endian.

    There are a few specialized cases where endian-swapping is used — apparently VirtualPC relied on little endian mode and thus initially didn’t work on the G5 (which doesn’t include it) — but I wouldn’t worry about these.

    ARM has a similar problem in big-endian mode: doubles are mixed-endian. The “pseudo-endianness” is achieved by XORing the low-order address bits with 0x2 (for halfword accesses) and 0x3 (for byte accesses) so that the effective order within a 32-bit word is swapped, but this breaks for 64-bit accesses. I suspect the same trick is used on PowerPC except done 64 bits at a time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some javascript code that is used in a few different pages in
I have some automatic de-serialization code that will set an object's properties using KVC
Have some audio and video files that users are to download, however depending on
I have some objects which I draw onto a Canvas as part of a
I have some difficulties grasping some concepts. Grateful for help. Let's say you have
I have some trivial markup that looks like the following: <li class=someclass> <=% t'model.attr'
I have some asynchronous operations being performed on the main thread of my application.
I have some HTML like: <ul id='foo'> <span><a>hello 1</a></span> <span><a>hello 2</a></span> <span><a>hello 3</a></span> </ul>
I have some png's that are now resources in XCode. I would like to
(Sorry if this sounds like a rant, but it's a real question and I'd

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.