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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:16:13+00:00 2026-06-14T22:16:13+00:00

Considering this question : how to write inline assembly codes about LOOP in Xcode

  • 0

Considering this question : how to write inline assembly codes about LOOP in Xcode LLVM?

Which is answered with the following inline assembly code :

void brighten_neon(unsigned char* src, unsigned char* dst, int numPixels, int intensity) {
asm volatile (
              "\t mov r4, #0\n"
              "\t vdup.8 d1, %3\n"
              "Lloop2:\n"
              "\t cmp r4, %2\n"
              "\t bge Lend2\n"
              "\t vld1.8 d0, [%0]!\n"
              "\t vqadd.s8 d0, d0, d1\n"
              "\t vst1.8 d0, [%1]!\n"
              "\t add r4, r4, #8\n"
              "\t b Lloop2\n"
              "Lend2:\n"
              : "=r"(src), "=r"(dst), "=r"(numPixels), "=r"(intensity)
              : "0"(src), "1"(dst), "2"(numPixels), "3"(intensity)
              : "cc", "r4", "d1", "d0");
}

I was wondering what the three last line in the asembly code means ? It seems like the parameters are defined here with the register names etc that are used inline.
Can someone elaborate on this ? Does anyone know any good resources explaining this ?

  • 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-06-14T22:16:15+00:00Added an answer on June 14, 2026 at 10:16 pm

    I don’t know much about ARM assembly specifically, but in GCC’s inline assembly syntax, the three sections are output registers, input registers, and clobbered registers, respectively. The registers are numbered in the order that they appear, and in this case the input registers refer to the same variables as the output registers in the same order. =r is architecture-specific, but probably means something like “any general-purpose register”.

    So you can expect the compiler to pick four convenient registers to put the four variables into (most likely the ones the ARM calling convention puts them in?), and to make sure that cc, r4, d1, d0 are saved if necessary. You can refer to the four registers using %0, %1, %2, %3 in your assembly. In turn, the compiler can expect that when you’ve finished, you won’t have clobbered any other registers, and the new values of the variables will be in the new registers (which happen to be the same as the old registers in this case).

    See also GCC-Inline-Assembly-HOWTO — it’s a bit old, but you should be able to get the general idea from it.

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

Sidebar

Related Questions

Considering this article Developing a MVC component for Joomla , following is the code
Considering this question of SO, where whole C# in-memory compiler is being called. When
This is probably more a design or style question: I have just been considering
Considering this code with 3 differents function call semantics: void f(void){ puts(OK); } int
This question is mystifying me for years and considering this site's name, this is
While considering another problem one question appeared. I do not know how to write
Considering the following PHP class: class someObject { public function broken(){ return isset($this->something()) ?
I've seen the question almost answered on a number of threads, but not considering
I suppose this is a long shot considering how few Wonderware questions I've seen
Considering this part of a Java class, private List<Object> components = new ArrayList<Object>(); private

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.