Page MenuHomePhabricator

Add the __qdbl intrinsic to the arm_acle.h header
ClosedPublic

Authored by mroth on Jul 2 2014, 5:50 AM.

Details

Reviewers
rengolin
compnerd
Summary

Hi all,

ACLE section 9.4.2 defines the __qdbl intrinsic:

int32_t qdbl(int32_t);
Doubles a signed 32-bit number, with saturation.
qdbl(x) is equal to __qadd(x,x) except that the argument x is evaluated only once.
Sets the Q flag if the addition saturates.

Since we already have an arm_acle.h header file with qadd implemented, it's trivial to implement this. I've also added a test that should make sure the argument is only evaluated once - this would catch e.g. if someone decided to do #define qdbl(X) __qadd(X,X) instead, which evaluates X twice. Does this look reasonable?

Cheers
Moritz

Diff Detail

Event Timeline

mroth updated this revision to Diff 11025.Jul 2 2014, 5:50 AM
mroth retitled this revision from to Add the __qdbl intrinsic to the arm_acle.h header.
mroth updated this object.
mroth edited the test plan for this revision. (Show Details)
mroth added reviewers: rengolin, compnerd.
mroth added subscribers: Unknown Object (MLST), kongyi.

Hi Moritz,

LGTM! Thanks for extending the ACLE support.

Cheers.

Tim.

rengolin accepted this revision.Jul 2 2014, 6:04 AM
rengolin edited edge metadata.

LGTM too.

--renato

This revision is now accepted and ready to land.Jul 2 2014, 6:04 AM
compnerd accepted this revision.Jul 2 2014, 10:22 AM
compnerd edited edge metadata.

+1

rengolin closed this revision.Jul 3 2014, 3:23 AM

r212264