Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 80416 - media-libs/libsdl-1.2.8 assembly patch for amd64
Summary: media-libs/libsdl-1.2.8 assembly patch for amd64
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: High enhancement (vote)
Assignee: AMD64 Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-01 21:29 UTC by Tyler Montbriand
Modified: 2005-08-29 15:00 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to enable assembly optimizations for AMD64 (sdl-1.2.8-opteron-mmx.diff,13.63 KB, patch)
2005-02-01 21:30 UTC, Tyler Montbriand
Details | Diff
patch log (1.2.8-amd64-asm.patch-29972.out,19.72 KB, text/plain)
2005-03-25 15:15 UTC, Simon Stelling (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Montbriand 2005-02-01 21:29:35 UTC
By default these assembly optimizations are left out, though amd64's support all the same MMX, SSE etc. instructions as their 32-bit progenitors.  Some minor modification was needed in some places, and a few bits require a NASM binary which of course isn't going to work, and one is blocked by an apparent gcc bug, but I have been able to enable most optimizations.  It appears to work with gcc 3.3 and 3.4.  Sadly this means 3.3. and 3.4 share the same /flaws/ that prevent one optimization.  The resulting binaries work very well.

To use these optimizations, patch to SDL-1.2.8 with the attached diff, and add -DUSE_ASMBLIT in the CFLAGS.

Reproducible: Always
Steps to Reproduce:
1. patch -p1 < sdl-1.2.8-opteron-mmx.diff
2. CFLAGS="-DUSE_ASMBLIT -O2" export CFLAGS ; ./configure
3. make, etc

Actual Results:  
SDL compiled with assembly optimizations under amd64.


Portage 2.0.51-r15 (default-linux/amd64/2004.3, gcc-3.4.3,
glibc-2.3.4.20041102-r0, 2.6.5 x86_64)
=================================================================
System uname: 2.6.5 x86_64 AMD Opteron(tm) Processor 242
Gentoo Base System version 1.6.8
Python:              dev-lang/python-2.2.3-r5,dev-lang/python-2.3.4 [2.3.4
(#1,Jun 29 2004, 09:40:45)]
dev-lang/python:     2.2.3-r5, 2.3.4
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r2
sys-devel/libtool:   1.5.10-r4
virtual/os-headers:  2.6.8.1-r3
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CFLAGS="-march=x86-64 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.1/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config
/usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS=""
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox"
GENTOO_MIRRORS="http://mirrors.tds.net/gentoo ftp://mirrors.tds.net/gentoo
ftp://ftp.ndlug.nd.edu/pub/gentoo/"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X aalib acpi alsa arts berkdb bitmap-fonts cdr crypt cups dvd esd f77
fam flac font-server foomaticdb fortran gdbm ggi gif gpm gtk guile
imagemagickimlib innodb ipv6 ithreads java jp2 jpeg kde libwww lzw lzw-tiff mad
mikmod motif multilib mysql ncurses nls nptl oggvorbis opengl oss pam pdflib
perl png postgres ppds python qt readline scanner slang speex ssl tcltk tcpd
tiff truetype truetype-fonts type1-fonts usb userlocales xml xml2 xmms xpm
xrandr xv zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS
Comment 1 Tyler Montbriand 2005-02-01 21:30:27 UTC
Created attachment 50192 [details, diff]
Patch to enable assembly optimizations for AMD64
Comment 2 Simon Stelling (RETIRED) gentoo-dev 2005-03-25 15:15:07 UTC
Created attachment 54479 [details]
patch log

thanks for this great work, but i'm sorry, applying this patch fails for me. i
attached the patch output
Comment 3 Tyler Montbriand 2005-04-02 19:09:59 UTC
You need to fiddle with -p<n> to get things to patch sometimes because of the way recursive diff's work.  Here's the way I get this patch to apply:

# tar -zxf SDL-1.2.8.tar.gz
# cd SDL-1.2.8
# patch -p1 < amd64mmx.patch
Comment 4 SpanKY gentoo-dev 2005-04-19 07:46:28 UTC
this patch really should be cleaned up and e-mailed to the libsdl mailing list
Comment 5 Simon Stelling (RETIRED) gentoo-dev 2005-07-04 04:22:20 UTC
could somebody from the games herd please review the patch?
Comment 6 SpanKY gentoo-dev 2005-07-04 14:32:23 UTC
sorry, but as i said already, i dont think this is appropriate for inclusion

it should be taken to the libsdl mailing list
Comment 7 Simon Stelling (RETIRED) gentoo-dev 2005-07-25 07:53:44 UTC
Comment on attachment 50192 [details, diff]
Patch to enable assembly optimizations for AMD64

marking obsolete due to comment 6
Comment 8 SpanKY gentoo-dev 2005-08-28 14:18:28 UTC
so do it !
Comment 9 Tyler Montbriand 2005-08-29 15:00:28 UTC
I *have* posted it to the list, though I think they missed it...  Now that
they've released 1.2.9 I'll need to make a new patch.