[PATCH] mi: Mark the span blit routines as _X_COLD

Adam Jackson ajax at redhat.com
Thu Oct 9 00:58:06 PDT 2014


On gcc, __attribute__((cold)) means:

- consider calls to the function to be unlikely for branch prediction
- optimize the function for size
- emit the function in a dedicated cold text section

It's not worth deleting these routines even though there are no longer
in-tree consumers, but we can at least keep them out of i$ at runtime.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 mi/mibitblt.c  | 13 ++++++-------
 mi/mifillrct.c |  2 +-
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index 3ed4ed1..c2516b0 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -72,7 +72,7 @@ extern int ffs(int);
  *     set them in the destination with SetSpans
  * We let SetSpans worry about clipping to the destination.
  */
-RegionPtr
+_X_COLD RegionPtr
 miCopyArea(DrawablePtr pSrcDrawable,
            DrawablePtr pDstDrawable,
            GCPtr pGC,
@@ -262,8 +262,7 @@ miCopyArea(DrawablePtr pSrcDrawable,
  * This should be replaced with something more general.  mi shouldn't have to
  * care about such things as scanline padding et alia.
  */
-static
-MiBits *
+_X_COLD static MiBits *
 miGetPlane(DrawablePtr pDraw, int planeNum,     /* number of the bitPlane */
            int sx, int sy, int w, int h, MiBits * result)
 {
@@ -369,7 +368,7 @@ miGetPlane(DrawablePtr pDraw, int planeNum,     /* number of the bitPlane */
  * Note how the clipped out bits of the bitmap are always the background
  * color so that the stipple never causes FillRect to draw them.
  */
-static void
+_X_COLD static void
 miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
                   MiBits * pbits, int srcx, int w, int h, int dstx, int dsty)
 {
@@ -511,7 +510,7 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
  * build a source clip
  * Use the bitmap we've built up as a Stipple for the destination 
  */
-RegionPtr
+_X_COLD RegionPtr
 miCopyPlane(DrawablePtr pSrcDrawable,
             DrawablePtr pDstDrawable,
             GCPtr pGC,
@@ -600,7 +599,7 @@ miCopyPlane(DrawablePtr pSrcDrawable,
  * XY format:
  * get the single plane specified in planemask
  */
-void
+_X_COLD void
 miGetImage(DrawablePtr pDraw, int sx, int sy, int w, int h,
            unsigned int format, unsigned long planeMask, char *pDst)
 {
@@ -690,7 +689,7 @@ miGetImage(DrawablePtr pDraw, int sx, int sy, int w, int h,
  * ZPixmap format:
  *	This part is simple, just call SetSpans
  */
-void
+_X_COLD void
 miPutImage(DrawablePtr pDraw, GCPtr pGC, int depth,
            int x, int y, int w, int h, int leftPad, int format, char *pImage)
 {
diff --git a/mi/mifillrct.c b/mi/mifillrct.c
index 79c4057..faf6049 100644
--- a/mi/mifillrct.c
+++ b/mi/mifillrct.c
@@ -65,7 +65,7 @@ SOFTWARE.
  * then call FillSpans to fill each rectangle.  We let FillSpans worry about
  * clipping to the destination
  */
-void
+_X_COLD void
 miPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, /* number of rectangles to fill */
                xRectangle *prectInit    /* Pointer to first rectangle to fill */
     )
-- 
1.9.3



More information about the xorg-devel mailing list