SSE on AMD processors in Pale Moon?

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
Hannibal living

SSE on AMD processors in Pale Moon?

Unread post by Hannibal living » 2013-08-07, 10:01

Hello everyone!
In a news on the technics site "computerbase.de" (also known as nvidiabase and intelbase because of few non-commited news, tests, and so on - but OK for news about new technologies) about the new Firefox version 23 I read a interesting German comment:
[Cyberfox] Ist schon ein paar Monate mein Standardbrowser. 8Pecxstudios denkt dabei sogar an eine AMD-Version, bei der nicht die Standardeinstellungen des Intelcompilers verwendet werden,die verhindern würden, dass auf einem AMD-Rechner SSE genutzt wird. Aber es ist doch traurig, dass man auf sowas angewiesen ist, während das beliebteste Browser-Plugin, der Adobe Flash Player, Prozessoren mit SSE2 vorraussetzt und ausnahmslos alle jemals hergestellten AMD-Prozessoren, die SSE2 unterstützen, 64b-Prozessoren sind. Die Mozilla Foundation verhält sich mit ihrer fortwährenden Optimierung des Javascript-JIT-Compilers auf x86-32 wie Adobe, die zehn Jahre, nachdem Apple Coacoa eingeführt hatte, überrascht waren, dass die Carbon-API für Kompatibilität zu Mac-OS-9-Anwendungen abgeschafft wurde.
Wir leben seit zehn Jahren mit 64b-Hardware als Standard, nicht als Nischenprodukt, irgendwann können wir die Abwärtskompatibilität
mal einstellen.
In English, it means something like:
"Cyberfox has been my main browser for some months. One of the developer, 8Pecxstudios, thinks about an AMD version, which will not have the standard configuration of the Intel compiler, that would prevent the usage of SSE on an AMD processor. It is very sad that you have to use something like this, while the most popular browser plugin - the Adobe Flash Player - presumes a CPU with SSE2. And EVERY processor from AMD supporting SSE2 that has EVER been produced IS A 64 bit processor without exception.
The Mozilla Foundation behaves itself with the continuing optimization of the Javascript JIT compiler on x86-32 like the people from Adobe, who were suprised, when the Carbon API was abolished for MAC OS 9 software compability reasons.
We have lived with 64 bit hardware as the standard - not as a niche product! - FOR TEN YEARS. We have to shut down downward compatibility someday."

Is this plan for Cyberfox already realized in Pale Moon? I do not want to change from PM, especially not to Cyberfox.
I prefer AMD processors because these do not run out of steam if some more programs are started (see reallife tests from PCGamesHardware).
Also I want to use APUs in my family's future laptops. The old, weak laptop of my sister has an AMD processor, too, with PM installed as the main browser.

Sincerely
Hannibal living

megaman

Re: SSE on AMD processors in Pale Moon?

Unread post by megaman » 2013-08-07, 14:11

Palemoon has a general optimization not just favoring one processor.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35653
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: SSE on AMD processors in Pale Moon?

Unread post by Moonchild » 2013-08-07, 15:18

Unlike Cyberfox, I refuse to use the Intel compiler which will only use SSE and SSE2 (and later) on "GenuineIntel" processors. This restriction that Cyberfox and anyone else using the Intel compiler runs into is a big, fat N/A for Pale Moon ;)
Both the x86 and x64 versions of Pale Moon make extensive use of SSE and SSE2 SIMD instructions (and some libraries extend this to later standards as well). This is the reason why it will not run on Athlon XP processors, for example.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Hannibal living

Re: SSE on AMD processors in Pale Moon?

Unread post by Hannibal living » 2013-08-07, 16:19

megaman wrote:Palemoon has a general optimization not just favoring one processor.
This is rubbish, if you mean that realizing such a plan would favor AMD. Instead, without this, Intel would have another advantage over the concurrence, if the Intel compiler is used without re-activating the usage of SSE on AMD products as well.
If you meant it otherwise, behave like I have not said anything.
Moonchild wrote:Unlike Cyberfox, I refuse to use the Intel compiler which will only use SSE and SSE2 (and later) on "GenuineIntel" processors. This restriction that Cyberfox and anyone else using the Intel compiler runs into is a big, fat N/A for Pale Moon ;)
Thanks a lot! I forgot that, sorry.
It is great that you are non-committed in such issues.


Just for interest reasons:
Could you take one of these pictures and change it by ticking the features which can be used by Pale Moon?
http://s7.directupload.net/file/d/3340/2unpd9rp_jpg.htm
http://s14.directupload.net/file/d/3340 ... qx_jpg.htm

New Tobin Paradigm

Re: SSE on AMD processors in Pale Moon?

Unread post by New Tobin Paradigm » 2013-08-07, 21:42

Beyond the fact the Intel compiler is utter crap. Mozilla them selves don't use it.. why should pale moon do it just to be restrictive? No that goes ageist goals that I have seen for Pale Moon which the future will see much more from Pale Moon as a separate program from Firefox. Why make such a misstep with this compiler?

Thunderstruck

Re: SSE on AMD processors in Pale Moon?

Unread post by Thunderstruck » 2013-08-08, 01:50

Hi Guys,

I am a new signup to this forum but have been a palemoon user for many years and follow postings here.

I just wanted to add some info to this post that seems to have caused some confusion, I myself use both palemoon and cyberfox each for a different purpose as I enjoy what both browsers offer but I see a little confusion in understanding what cyberfox offers and being as much into tech and application testing as I am I thought to add a little insight to clear this up.

Cyberfox offers 2 flavors of their browser not just one they have one version for Intel users that is done with the intel c++ compiler and a second version for AMD users tweaked for AMD machines that does not use the Intel compiler.

This does make a difference on the machines your running the version on as I run both Intel and AMD computers but am a much bigger AMD fan then I am Intel quite simply AMD offers more bang for the buck. One post above said the Intel c++ compiler is crap this is very untrue if your running an Intel machine you will notice quite a bit of improvement with an application that has been compiled using the Intel compiler on Intel machines of course. This can have the adverse effect on AMD computers though if using an application that has been built with the Intel C++ compiler on an AMD computer, but not always the newer AMD architecture after the FX chip does not seem to have those downside effects that the older AMD cpu's had when it comes to the intel c++ compiler.

I just thought adding this tibit of information would clear up the confusion :)

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35653
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: SSE on AMD processors in Pale Moon?

Unread post by Moonchild » 2013-08-08, 09:07

It took me a while poking around the website to find the link to the AMD version of Cyberfox; it's obviously added as an afterthought and all obvious download links point to the Intel version :P I guess it must have been a recent-ish addition to their line-up.
Thunderstruck wrote:This does make a difference on the machines your running the version on as I run both Intel and AMD computers but am a much bigger AMD fan then I am Intel quite simply AMD offers more bang for the buck. One post above said the Intel c++ compiler is crap this is very untrue if your running an Intel machine you will notice quite a bit of improvement with an application that has been compiled using the Intel compiler on Intel machines of course. This can have the adverse effect on AMD computers though if using an application that has been built with the Intel C++ compiler on an AMD computer, but not always the newer AMD architecture after the FX chip does not seem to have those downside effects that the older AMD cpu's had when it comes to the intel c++ compiler.

I just thought adding this tibit of information would clear up the confusion :)
I'm sorry but I beg to differ on the Intel compiler and how it biases binary code towards Genuine Intel processors only. AMD FX processors probably have enough "oomph" to not care much about the slow path and the user barely noticing it (meaning it'll perform as good on "bare bones" non-optimized code as the Intel one does on Intel-optimized code). In fact, Intel has had a big court case about this very thing and was forced to include a statement with their compiler that their generated code may not be optimal on non-Intel processors. See http://forum.palemoon.org/viewtopic.php ... t=20#p6968
Intel wrote:Intel® compilers, associated libraries and associated development tools may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include Intel® Streaming SIMD Extensions 2 (Intel® SSE2), Intel® Streaming SIMD Extensions 3 (Intel® SSE3), and Supplemental Streaming SIMD Extensions 3 (Intel® SSSE3) instruction sets and other optimizations.
ICC compiled programs will in many cases not use anything beyond "i386" code when not running on a "GenuineIntel" processor. If you want to call that "crap", then I have to say I can't strictly disagree; despite that it may possibly spit out faster code when you meet the requirements, not using available instruction sets and not having a choice as a developer to enable them (force-enabling will crash the program on non-Intel hardware because the dispatcher throws an error, even if the instructions are supported by the processor), can be considered "severely broken" for a modern, commercial compiler.
Pale Moon on the other hand will use available SIMD instructions regardless of the hardware it runs on, and uses a balanced optimization for different known CPU architectures. I could also make an AMD-optimized and Intel-optimized version, but the differences when using commonly available instruction sets in that respect will be minimal. I'd rather keep things simple and have all users benefit from a larger common denominator in a single version.

It also causes issues for the users: They need to know what CPU they are running - something a lot of users won't know, especially if they have bought an A-branded PC (also meaning a portable version will be inefficient half the time, depending on what you plug the browser into).

For Pale Moon this is a matter of principle: I will not use a compiler that is hardware-vendor biased and actively cripples binaries and doesn't use available features of the hardware when the vendor check is not satisfied. I consider it really bad practice - and will not support a company that upholds such practices by buying their compiler (which is, by the way, more expensive than MS's).

EDIT:
http://software.intel.com/en-us/article ... ice#opt-en
opt-notice-en_080411.gif
You do not have the required permissions to view the files attached to this post.
Last edited by Moonchild on 2013-08-14, 11:16, edited 1 time in total.
Reason: Added official notice as posted on Intel's website. This is still valid today.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35653
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: SSE on AMD processors in Pale Moon?

Unread post by Moonchild » 2013-08-08, 09:22

Hannibal living wrote:Just for interest reasons:
Could you take one of these pictures and change it by ticking the features which can be used by Pale Moon?
Pale Moon uses MMX, SSE and SSE2 in every part of its program. A few manually-optimized libraries use more advanced instruction sets when available in the processor, like image decoders.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Thunderstruck

Re: SSE on AMD processors in Pale Moon?

Unread post by Thunderstruck » 2013-08-08, 11:49

Hi moonchild

Just after reading your replies there I should have explained a bit more in my post I was pretty tired it was a long day yesterday lol

By no means was I trying to say that you should add the Intel c++ compiler method to your builds at all remember from my first post I am an AMD man all the way when it comes down to the choice between the 2 systems.

Your completely right about the Intel compiler having adverse effects on non intel systems not always as I said, I have noticed a bit that the newer AMD chips don't seem to have big issues with it anymore but by no means would I say just because of that people that make applications should start using the intel compiler when making builds that would be used for AMD machines as well. I would rather it not be used when making an app that is to be used on an AMD processor. I do myself have a couple of AMD systems plus the one Intel machine the newer AMD computer is the A-series cpu but my main machine basically the one I do almost anything on is still my beloved 965 BE and the 965 BE does not respond well to the intel compiler.

Also you have the issue of the Dev as well the Dev that makes the application has to have an idea of what he is doing also as you pointed out and this I should have added to my first post as well but forgot, if the Dev is just using the force method for tweaking with the compiler then there will most likely be app crashing on non intel computers the Dev needs to have a good idea of what they are doing and can't just compile blind per say.

I just wanted to point out more to the guy who had posted above me that on intel computers the intel compiler can't be considered crap cause it does improve some aspects of the app on intel machines, when of course the app is designed by a Dev that knows what he is doing and not throwing out blind force tweaks. As per your seeing the AMD version for cyberfox yes their build for AMD is quite new the last 3 or so versions of firefox they brought it out so it is still pretty new.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35653
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: SSE on AMD processors in Pale Moon?

Unread post by Moonchild » 2013-08-08, 12:29

The Intel compiler can be considered crap, and it has nothing to do with the dev knowing which flags to use or not.
The compiler doesn't produce proper binary code for non-Intel processors. Plain and simple.
It has nothing to do with stability of the code, and everything to do with an arbitrary vendor check.

Source code -> Intel compiler with default settings -> binary that runs well on Intel CPUs and slow (not using SIMD instructions) on non-Intel CPUs
Every instruction is still passed through the dispatcher to check vendor/capabilities, which slows execution down globally - as well as producing multiple code paths for every function compiled, bloating the program.

Source code -> Intel compiler with force use of SSE/2/3/* -> binary that runs well on Intel CPUs and crashes on non-Intel CPUs, regardless if they support the SIMD instruction set enforced
Not because the code generated won't work on the CPU, but because the dispatcher throws an error on the vendor check: Dispatcher finds code enforcing enhanced SIMD instructions, checks for GenuineIntel vendor string, doesn't find it and as a result refuses to use the SIMD code path; with forced SIMD there is now slow "fallback" code path and the application halts...

Source code -> MSVC/GCC/etc. -> binary that runs well on both Intel and AMD, and doesn't have overhead from a dispatcher/vendor check

Source code -> MSVC/GCC/etc. with force use of SSE2/3/* -> binary that runs well on both Intel and AMD, as long as the hardware supports the SIMD instruction set enforced.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Thunderstruck

Re: SSE on AMD processors in Pale Moon?

Unread post by Thunderstruck » 2013-08-09, 00:06

I understand your point Moonchild, right from the very first post you made, but your also missing what I am saying.

The Intel C++ compiler as you say can be considered crap on non Intel machines as you have pointed out, but it is not crap for Intel computers it does make a difference on Intel machines adding benefits to the compiling of the apps.

So where yourself or others can say it's crap on non Intel computers it's quite the reverse for cpu's it was designed to work with and cannot in fact be considered crap as it does make a difference when it comes to Intel machines. Would I use the Intel c++ compiler on an application I am building to be used on my AMD computers definitely not, as even if it did not have the adverse effects for the newer AMD cpu's it would also not add any benefits. Would I use the Intel c++ compiler for an app I intend to use on my Intel machine, most definitely because it does have benefits for Intel cpu's.

So the fact of the compiler being crap or not is a difference between what cpu your machine uses AMD no benefits, Intel many benefits so the Intel compiler cannot be considered crap if you are using an Intel cpu.

Thunderstruck

Re: SSE on AMD processors in Pale Moon?

Unread post by Thunderstruck » 2013-08-09, 01:30

With your SSE/SSE2 optimizations while looking over your source code you have made public also looking over your mozconfig

palemoon config
--target=x86_64-pc-mingw32
--host=x86_64-pc-mingw32
--with-distribution-id=Palemoon
--enable-update-packaging
--enable-official-branding
--enable-application=browser
--enable-optimize=-O2 -GFLs -GS- -fp:precise -Qfast_transcendentals -Qpar -openmp
--enable-jemalloc
--disable-debug
--enable-shared-js
--enable-chrome-format=jar
--disable-tests
--disable-mochitests
--enable-strip
--enable-strip-libs
--enable-install-strip
--disable-crashreporter
--disable-accessibility
--disable-parental-controls
--disable-maintenance-service
--disable-webrtc
--disable-windows-mobile-components
--disable-activex
--disable-activex-scripting
--disable-logging
--disable-necko-wifi


I can't see were you have optimized with SSE/SSE2 unless there default settings shipped with the source.
If the SSE/SSE2 optimizations are default why is the regular firefox or other 3rd party firefox compiles running faster on both my amd or intel pcs. The Cyberfox AMD version on my AMD cpu's and the intel version on intel cpu both considerably perform better on my systems then palemoon witch is optimized with SSE/SSE2 and should perform better on the older cpus especially my 965 BE and just as good if not better on newer cpus.

This shows some flaws in your logic.

dudewithit

Re: SSE on AMD processors in Pale Moon?

Unread post by dudewithit » 2013-08-09, 04:23

Moonchild wrote: Source code -> MSVC/GCC/etc. with force use of SSE2/3/* -> binary that runs well on both Intel and AMD, as long as the hardware supports the SIMD instruction set enforced.
I dont think you can force SSE2/3/4/4.1 on MSVC ?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35653
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: SSE on AMD processors in Pale Moon?

Unread post by Moonchild » 2013-08-09, 06:51

@Thunder: We do not live in a world where Intel PCs are the standard norm to measure against. this "holier than thou" attitude can be toned down a notch.
EDIT: Compare it with a BluRay player that would give you DVD quality for any disks not supplied by the manufacturer of the player, even if those disks contain full HD quality. Would you buy something like that if the "intended" disks provide you a slightly crisper image than other BluRay players?

Also, MSVC x64 compilers don't need an architecture flag, any x64 processor has SSE2 capabilities and the compiler automatically uses it, in addition this is MSVC11, even the x86 compiler will use SSE2 architecture as a minimum unless you enforce not using it through /arch -- don't call my logic flawed unless you know what you're talking about or at least take 5 minutes to look up how the compiler works that you are talking about.

Thirdly, the .mozconfig parameters are not the end-all of optimizations present in the source. It contains a lot of hand-crafted assembler code, for example, to create fast code paths in critical libraries.

Fourth: if you are comparing Pale Moon against v23 of other browsers, be aware that Pale Moon has not yet adopted performance improvements present in the later code base (to be remedied in the next major release)

Fifth: speed and stability is a trade-off. How many crashes have you had so far in Pale Moon?

Also, I don't know what you use to decide that "other browsers perform better" but if it's synthetic benchmarks, then you should read a few other posts on this very forum in which I explain how those benchmarks are not representative in a lot of cases of real-world use.

@dude: you can't force SSE3/4/4.1 on MSVC, you can force SSE2 -- but forcing later SSE revisions for a general use browser is pointless, since you're just limiting the range of systems it can be used on without much gain. See also other posts about this subject on this forum.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35653
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: SSE on AMD processors in Pale Moon?

Unread post by Moonchild » 2013-08-09, 06:57

Also, if you enjoy other browsers better, you are free to switch to them.

The original question was answered, that yes, SSE and SSE2 are used on AMD processors, unlike Intel-compiler builds by others.
Additional answer: No I'm not going to make double work for myself by compiling it specifically favoring either architecture. If you think the Pale Moon community needs this, build it yourself from source and submit it as a contributed build - I'll be more than happy to add it as an official contributed build once I've tested it (so yes, in that case, you can also use official branding). See: http://www.palemoon.org/contributed-builds.shtml

Closing this thread.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite