This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

intrinsic function for 32bit multiplication

hello,
are there intrinsic functions available for the XC164 to use the multiply unit of the ALU?
For example for calculations like:
16bit x 16bit = 32bit (MUL-instruction)or
32bit / 16bit = 16bit (DIVL-instruction)?

regards!
Andreas

Parents
  • As far as I know, there are no such intrinsic functions. Besides, why would you need them when the compiler emits the appropriae instructions well enough? Just compile the following piece of code and see the compiler output:

    int a, b;
    long c;
    
    void main(void)
    {
    	c = a * (long)b;
    	b = c / a;
    }
    
    Regards,
    - mike

Reply
  • As far as I know, there are no such intrinsic functions. Besides, why would you need them when the compiler emits the appropriae instructions well enough? Just compile the following piece of code and see the compiler output:

    int a, b;
    long c;
    
    void main(void)
    {
    	c = a * (long)b;
    	b = c / a;
    }
    
    Regards,
    - mike

Children