how could I use shell script to determine which CPU structure

how could I use shell script to determine which CPU structure
because I found that I compile my program under Itanium base that cannot run on the PA-RISC base
but PA-RISC program can run on Itanium base

i would like to use shell script to know which CPU structure it is,how could i do
thanks

PA-RISC (Example, may differ):

$ uname -m
9000/800

Itanium:

$ uname -m
ia64

Your IA64 code works on PA-RISC because the kernel automagically loads the Aries compatibility library for it.