How do I know the compiler auto-generates thess instruction where appropriate?
You’ll need to keep and inspect the assembly files. Adding the flags “-Mkeepasm -Manno” will tell the compiler to keep your assembly file and annotate them with your source’s text.
I checked the output of make, it auto-generated the “-fastsse -Mvect=noaltcode” options, but didn’t generate the “-tp” options. Which sort of -tp options I should use for my case, amd64, amd64e, k8-64e, shanghai-64 or x64?
An Opteron 8378 has a “Shanghai” micro-architecture so by default the compiler uses “-tp shanghai-64”. You should only need to set the target processor (-tp) if you will be running your application on a different system having a different architecture.
And how about the ACML, how do I know it already used the ACML or not?
I would check with AMD. However, given that AMD doesn’t support SSE4.1 instructions, I highly doubt their math library would use these instructions. I could be wrong though!