Arm Community
Site
Search
User
Site
Search
User
Groups
Research Collaboration and Enablement
DesignStart
Education Hub
Innovation
Open Source Software and Platforms
Forums
AI and ML forum
Architectures and Processors forum
Arm Development Platforms forum
Arm Development Studio forum
Arm Virtual Hardware forum
Automotive forum
Compilers and Libraries forum
Graphics, Gaming, and VR forum
High Performance Computing (HPC) forum
Infrastructure Solutions forum
Internet of Things (IoT) forum
Keil forum
Morello Forum
Operating Systems forum
SoC Design and Simulation forum
中文社区论区
Blogs
AI and ML blog
Announcements
Architectures and Processors blog
Automotive blog
Graphics, Gaming, and VR blog
High Performance Computing (HPC) blog
Infrastructure Solutions blog
Innovation blog
Internet of Things (IoT) blog
Operating Systems blog
Research Articles
SoC Design and Simulation blog
Tools, Software and IDEs blog
中文社区博客
Support
Arm Support Services
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Support forums
Arm Development Studio forum
ARM Intrinsics Syntax
Jump...
Cancel
Locked
Locked
Replies
3 replies
Subscribers
121 subscribers
Views
2542 views
Users
0 members are here
Options
Share
More actions
Cancel
Related
How was your experience today?
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
ARM Intrinsics Syntax
Offline
Sajid Rabbani Avagundam
over 9 years ago
Offline
Sajid Rabbani Avagundam
over 9 years ago
Note: This was originally posted on 13th July 2011 at
http://forums.arm.com
Presently we are using few intrinsics as below: (thou they are in macro form!)
#define CP15_CONTROL_READ(x) asm("mrc p15, 0, %0, c1, c0, 0":"=r"(x))
#define CP15_CONTROL_WRITE(x) asm("mcr p15, 0, %0, c1, c0, 0"::"r"(x))
we do not know how to use 'x' type of variables in case of
multiple operands
in intructions like add as mentioned above.
with some exploration in generic linux source code for arm, we derived below macro translation for ADD:
#define ADD2(sum, input1, input2) asm("ADD %2, %0, %1" :"=r"(input1),"=r"(input2) : "r"(sum) : "cc");
however, this does not translate to an 'add' instruction when objdump is generated. help!
Cancel
Up
0
Down
Cancel
Offline
Sajid Rabbani Avagundam
over 9 years ago
Note: This was originally posted on 14th July 2011 at
http://forums.arm.com
we have able to identify the general form of an inline assembler statement:
asm(code : output operand list : input operand list : clobber list);with this, we derived as below for our above example:
#define ADD(sum, input1, input2) asm("add %0, %1, %2" : "=r"(sum) : "r"(input1),"r"(input2))
with this, three operand inline assembly is working fine
.
Cancel
Up
0
Down
Cancel
Offline
Martin Weidmann
over 9 years ago
Note: This was originally posted on 13th July 2011 at
http://forums.arm.com
AFAIK there are usually only intrinsics for instructions that it would be difficult or impossible for a compiler to generate from C code. Such as the accessing control registers, or NEON ops.
The intrinsics which do exist can be found here:
http://infocenter.arm.com/help/topic/com.arm.doc.dui0472c/CHDFGFAB.html
Otherwise you could look at inline or embedded assembler. But you should really think about what you are doing if you need an ADD instruction.
Cancel
Up
0
Down
Cancel