How do I target the LDIV instruction?

If you have a simple question and just want an answer.
Malcolm
Junior Member
Posts: 7
Joined: Wed Dec 11, 2013 1:53 pm

How do I target the LDIV instruction?

Post by Malcolm »

I'd like to access the LDIV instruction from C++ and I am currently attempting to do so by:

    static uint32_t divu_fract (uint32_t dividend, uint32_t divisor)
    {
        return (uint32_t)((((uint64_t)dividend) << 32) / divisor);
    }
 

Unfortunately this compiles to a library call to __udivdi3 rather than LDIV.

I've found https://www.xmos.com/node/16493 which tells me of intrinsics to get maccs/maccu but searching xs1.h I can't find a corresponding intrinsic for LDIV.

 



User avatar
sethu_jangala
XCore Expert
Posts: 589
Joined: Wed Feb 29, 2012 10:03 am

Post by sethu_jangala »

Assembler syntax should be in the lower case. Look into the Assembly programming manual for more details.