ARM: Don't rely on undefined behavior to get arithmetic right shift.
authorGabe Black <gblack@eecs.umich.edu>
Wed, 2 Jun 2010 17:58:04 +0000 (12:58 -0500)
committerGabe Black <gblack@eecs.umich.edu>
Wed, 2 Jun 2010 17:58:04 +0000 (12:58 -0500)
commit14d25fbad09b3272e1d094adb1c6a298ab7b5ecd
tree022d3b076f15182eb41d93d9527e5ee54db53562
parent05d880f7a1326f83076614442bc38c5332624dd4
ARM: Don't rely on undefined behavior to get arithmetic right shift.
Shifting to the right of a signed value when the MSB is one is technically
undefined behavior, even though in my experience it's done the "right thing"
and sign extended the value. This replaces the arithmetic right shift code in
ARM that uses that coincidence with some code that relies on bit math.
src/arch/arm/insts/static_inst.cc