PERFORCE change 72652 for review
John Baldwin
jhb at FreeBSD.org
Mon Mar 7 12:12:39 PST 2005
http://perforce.freebsd.org/chv.cgi?CH=72652
Change 72652 by jhb at jhb_slimer on 2005/03/07 20:11:53
- Use + constraints for registers where possible.
- sfence doesn't need to clobber memory.
Affected files ...
.. //depot/projects/smpng/sys/amd64/include/bus_amd64.h#6 edit
Differences ...
==== //depot/projects/smpng/sys/amd64/include/bus_amd64.h#6 (text+ko) ====
@@ -290,8 +290,8 @@
1: movb (%2),%%al \n\
stosb \n\
loop 1b" :
- "=D" (addr), "=c" (count) :
- "r" (bsh + offset), "0" (addr), "1" (count) :
+ "+D" (addr), "+c" (count) :
+ "r" (bsh + offset) :
"%eax", "memory");
#endif
}
@@ -319,8 +319,8 @@
1: movw (%2),%%ax \n\
stosw \n\
loop 1b" :
- "=D" (addr), "=c" (count) :
- "r" (bsh + offset), "0" (addr), "1" (count) :
+ "+D" (addr), "+c" (count) :
+ "r" (bsh + offset) :
"%eax", "memory");
#endif
}
@@ -348,8 +348,8 @@
1: movl (%2),%%eax \n\
stosl \n\
loop 1b" :
- "=D" (addr), "=c" (count) :
- "r" (bsh + offset), "0" (addr), "1" (count) :
+ "+D" (addr), "+c" (count) :
+ "r" (bsh + offset) :
"%eax", "memory");
#endif
}
@@ -398,8 +398,7 @@
stosb \n\
incl %2 \n\
loop 1b" :
- "=D" (addr), "=c" (count), "=d" (_port_) :
- "0" (addr), "1" (count), "2" (_port_) :
+ "+D" (addr), "+c" (count), "+d" (_port_) ::
"%eax", "memory", "cc");
#endif
}
@@ -415,8 +414,7 @@
cld \n\
repne \n\
movsb" :
- "=D" (addr), "=c" (count), "=S" (_port_) :
- "0" (addr), "1" (count), "2" (_port_) :
+ "+D" (addr), "+c" (count), "+S" (_port_) ::
"memory", "cc");
#endif
}
@@ -440,8 +438,7 @@
stosw \n\
addl $2,%2 \n\
loop 1b" :
- "=D" (addr), "=c" (count), "=d" (_port_) :
- "0" (addr), "1" (count), "2" (_port_) :
+ "+D" (addr), "+c" (count), "+d" (_port_) ::
"%eax", "memory", "cc");
#endif
}
@@ -457,8 +454,7 @@
cld \n\
repne \n\
movsw" :
- "=D" (addr), "=c" (count), "=S" (_port_) :
- "0" (addr), "1" (count), "2" (_port_) :
+ "+D" (addr), "+c" (count), "+S" (_port_) ::
"memory", "cc");
#endif
}
@@ -482,8 +478,7 @@
stosl \n\
addl $4,%2 \n\
loop 1b" :
- "=D" (addr), "=c" (count), "=d" (_port_) :
- "0" (addr), "1" (count), "2" (_port_) :
+ "+D" (addr), "+c" (count), "+d" (_port_) ::
"%eax", "memory", "cc");
#endif
}
@@ -499,8 +494,7 @@
cld \n\
repne \n\
movsl" :
- "=D" (addr), "=c" (count), "=S" (_port_) :
- "0" (addr), "1" (count), "2" (_port_) :
+ "+D" (addr), "+c" (count), "+S" (_port_) ::
"memory", "cc");
#endif
}
@@ -629,8 +623,8 @@
1: lodsb \n\
movb %%al,(%2) \n\
loop 1b" :
- "=S" (addr), "=c" (count) :
- "r" (bsh + offset), "0" (addr), "1" (count) :
+ "+S" (addr), "+c" (count) :
+ "r" (bsh + offset) :
"%eax", "memory", "cc");
#endif
}
@@ -658,8 +652,8 @@
1: lodsw \n\
movw %%ax,(%2) \n\
loop 1b" :
- "=S" (addr), "=c" (count) :
- "r" (bsh + offset), "0" (addr), "1" (count) :
+ "+S" (addr), "+c" (count) :
+ "r" (bsh + offset) :
"%eax", "memory", "cc");
#endif
}
@@ -687,8 +681,8 @@
1: lodsl \n\
movl %%eax,(%2) \n\
loop 1b" :
- "=S" (addr), "=c" (count) :
- "r" (bsh + offset), "0" (addr), "1" (count) :
+ "+S" (addr), "+c" (count) :
+ "r" (bsh + offset) :
"%eax", "memory", "cc");
#endif
}
@@ -738,8 +732,7 @@
outb %%al,%w0 \n\
incl %0 \n\
loop 1b" :
- "=d" (_port_), "=S" (addr), "=c" (count) :
- "0" (_port_), "1" (addr), "2" (count) :
+ "+d" (_port_), "+S" (addr), "+c" (count) ::
"%eax", "memory", "cc");
#endif
}
@@ -755,8 +748,7 @@
cld \n\
repne \n\
movsb" :
- "=D" (_port_), "=S" (addr), "=c" (count) :
- "0" (_port_), "1" (addr), "2" (count) :
+ "+D" (_port_), "+S" (addr), "+c" (count) ::
"memory", "cc");
#endif
}
@@ -780,8 +772,7 @@
outw %%ax,%w0 \n\
addl $2,%0 \n\
loop 1b" :
- "=d" (_port_), "=S" (addr), "=c" (count) :
- "0" (_port_), "1" (addr), "2" (count) :
+ "+d" (_port_), "+S" (addr), "+c" (count) ::
"%eax", "memory", "cc");
#endif
}
@@ -797,8 +788,7 @@
cld \n\
repne \n\
movsw" :
- "=D" (_port_), "=S" (addr), "=c" (count) :
- "0" (_port_), "1" (addr), "2" (count) :
+ "+D" (_port_), "+S" (addr), "+c" (count) ::
"memory", "cc");
#endif
}
@@ -822,8 +812,7 @@
outl %%eax,%w0 \n\
addl $4,%0 \n\
loop 1b" :
- "=d" (_port_), "=S" (addr), "=c" (count) :
- "0" (_port_), "1" (addr), "2" (count) :
+ "+d" (_port_), "+S" (addr), "+c" (count) ::
"%eax", "memory", "cc");
#endif
}
@@ -839,8 +828,7 @@
cld \n\
repne \n\
movsl" :
- "=D" (_port_), "=S" (addr), "=c" (count) :
- "0" (_port_), "1" (addr), "2" (count) :
+ "+D" (_port_), "+S" (addr), "+c" (count) ::
"memory", "cc");
#endif
}
@@ -1217,7 +1205,7 @@
if (flags & BUS_SPACE_BARRIER_READ)
__asm __volatile("lfence" : : : "memory");
else
- __asm __volatile("sfence" : : : "memory");
+ __asm __volatile("sfence");
#endif
}
More information about the p4-projects
mailing list