* [wwwdocs,4.7,AVR,committed]: Mention the new %i asm print modifier
@ 2012-06-01 9:28 Georg-Johann Lay
0 siblings, 0 replies; only message in thread
From: Georg-Johann Lay @ 2012-06-01 9:28 UTC (permalink / raw)
To: gcc-patches
Yet another new feature in 4.7, committed
Johann
Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.7/changes.html,v
retrieving revision 1.108
diff -u -p -r1.108 changes.html
--- changes.html 21 Apr 2012 00:00:20 -0000 1.108
+++ changes.html 1 Jun 2012 09:15:18 -0000
@@ -676,6 +676,21 @@ int add_values (const __flash int *p, in
<li>New command-line options <code>-maccumulate-args</code>,
<code>-mbranch-cost=<i>cost</i></code> and <code>-mstrict-X</code>
were added to allow better fine-tuning of code optimization.</li>
+ <li>A new inline assembler print modifier <code>%i</code> to print a RAM
address as I/O
+ address has been added:
+
+ <blockquote><pre>
+#include <avr/io.h> /* Port Definitions from AVR-LibC */
+
+void set_portb (uint8_t value)
+{
+ asm volatile ("out %0, %i1" :: "r" (value), "n" (&PORTB) : "memory");
+}</pre></blockquote>
+ The offset between an I/O address and a RAM address for that I/O
+ location is device-specific. This offset is taken into account when
+ printing a RAM address with the <code>%i</code> modifier so that the
+ address is suitable to be used as operand in an I/O command.
+ The address must be a constant integer known at compile time.</li>
<li>Many optimizations to:
<ul>
<li>64-bit integer arithmetic</li>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-06-01 9:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-01 9:28 [wwwdocs,4.7,AVR,committed]: Mention the new %i asm print modifier Georg-Johann Lay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).