Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-09-2003, 12:39 AM   #1
LQ Newbie
Registered: Jan 2003
Location: SoCal
Distribution: SlackWare 10
Posts: 17

Rep: Reputation: 0
Want P4, SSE2 output from 386 GCC

I need to run some fairly intense floating point code in c++. I have Slack 8.1, where everything has been compiled to run on a 386 (I think). But I have a shiny new Pentium 4, and think I might get 10 gflops if GNU GCC will output pentium4 instructions, including the -msse2 parallel floating point instructions. But all my efforts to request pentium4 and SSE2 don't seem to do anything that -O3 doesn't already do, and I suspect that GCC thinks it's producing an executable for a 386.

Does anyone know what I should do to get GCC to output P4 and SSE2 instructions? I would guess it's some combination of reinstalling GCC for P4, and compile options like "GCC -march=pentium4 -mcpu=pentium4 -msse2 -O3 foo.c".

Is there a way to tell what my GCC is capable of producing (processor wise), or what instruction set is in a newly compiled executable?

Old 01-09-2003, 09:16 AM   #2
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
try -mfpmath=sse too.

sse2 is fast but only if you do it right, you cant just take a normal floating point program and expect it to go faster, but it may if you're lucky.
Old 01-09-2003, 11:03 AM   #3
LQ Newbie
Registered: Jan 2003
Location: SoCal
Distribution: SlackWare 10
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks! I'll try that next. But I won't have much time till next week. BTW, I'm trying to give it something it can do fast: inner product on two very long vectors. Know of any easier problems for sse2 to really shine on? I think it 's supposed to be even faster on single precision (current GCC output is much slower on single than double.)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel compiling: gcc-3.3 is 586, should be gcc-3.3 386 Erik Plaggenmar Linux - Software 0 10-01-2004 11:38 AM
Saving gcc output files to new directory Fe98 Programming 3 12-08-2003 07:18 AM
Checking for SSE / SSE2 support drivingon9 Programming 7 11-14-2003 05:42 AM
output in graphic mode with gcc Rex_chaos Programming 9 05-13-2002 09:56 AM
output in graphic mode with gcc Rex_chaos Linux - General 6 05-12-2002 03:53 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:51 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration