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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:56:30+00:00 2026-05-15T18:56:30+00:00

how to use the Multiply-Accumulate intrinsics provided by GCC? float32x4_t vmlaq_f32 (float32x4_t , float32x4_t

  • 0

how to use the Multiply-Accumulate intrinsics provided by GCC?

float32x4_t vmlaq_f32 (float32x4_t , float32x4_t , float32x4_t);

Can anyone explain what three parameters I have to pass to this function. I mean the Source and destination registers and what the function returns?

Help!!!

  • 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-15T18:56:30+00:00Added an answer on May 15, 2026 at 6:56 pm

    Simply said the vmla instruction does the following:

    struct 
    {
      float val[4];
    } float32x4_t
    
    
    float32x4_t vmla (float32x4_t a, float32x4_t b, float32x4_t c)
    {
      float32x4 result;
    
      for (int i=0; i<4; i++)
      {
        result.val[i] =  b.val[i]*c.val[i]+a.val[i];
      }
    
      return result;
    }
    

    And all this compiles into a singe assembler instruction 🙂

    You can use this NEON-assembler intrinsic among other things in typical 4×4 matrix multiplications for 3D-graphics like this:

    float32x4_t transform (float32x4_t * matrix, float32x4_t vector)
    {
      /* in a perfect world this code would compile into just four instructions */
      float32x4_t result;
    
      result = vml (matrix[0], vector);
      result = vmla (result, matrix[1], vector);
      result = vmla (result, matrix[2], vector);
      result = vmla (result, matrix[3], vector);
    
      return result;
    }
    

    This saves a couple of cycles because you don’t have to add the results after multiplication. The addition is so often used that multiply-accumulates hsa become mainstream these days (even x86 has added them in some recent SSE instruction set).

    Also worth mentioning: Multiply-accumulate operations like this are very common in linear algebra and DSP (digital signal processing) applications. ARM was very smart and implemented a fast-path inside the Cortex-A8 NEON-Core. This fast-path kicks in if the first argument (the accumulator) of a VMLA instruction is the result of a preceding VML or VMLA instruction. I could go into detail but in a nutshell such an instruction series runs four times faster than a VML / VADD / VML / VADD series.

    Take a look at my simple matrix-multiply: I did exactly that. Due to this fast-path it will run roughly four times faster than implementation written using VML and ADD instead of VMLA.

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

Sidebar

Related Questions

How can I use the counter value to multiply the frogs in the array?
How can I use the Galois Field Multiply (GMPY) instruction featured in TI C64x+
can someone please provide an example of how to use uBLAS product to multiply
can cassandra use multiple native secondary indexes when querying on mutiple indexed columns? using
Implement Biginteger Multiply use integer array to store a biginteger like 297897654 will be
The classical Multiply-Accumulate operation is a = a + b*c . But I currently
I have the following question: If asked whether to use a shift vs a
All QTKit examples use seconds for making ranges. I, unfortunately, have frame numbers and
i have following problem To decode the Biquinary code use the number 5043210. At
say I want to multiply two matrices together, 50 by 50. I have 2

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.