I'm writing a program in gcc that has asm language for performance-critical sections, and I want to ensure at run-time the program is running on the correct architecture. In particular, I need to differentiate ia64 (Itanium) and x86_64 on Linux.
Do I just read /proc/cpuinfo? Seems clunky, but I can't find an appropriate kernel call.