On Friday 23 April 2010, Avi Kivity wrote: > Ah so the 31st bit is optional as far as userspace is concerned? What > does it mean? (just curious) On data pointers it's ignored. When you branch to a function, this bit determines whether the target function is run in 24 or 31 bit mode. This allows linking to legacy code on older operating systems that also support 24 bit libraries. > What happens on the opposite conversion? is it restored? > > What about > > int compare_pointer(void *a, void *b) > { > unsigned long ai = (unsigned long)a; > void *aia = (void *)ai; > > return a == b; /* true if a and b point to the same object */ > } Some instructions set the bit, others clear it, so aia and a may not be bitwise identical. > Does gcc mask the big in pointer comparisons as well? Yes. To stay in the above example: a == aia; /* true */ (unsigned long)a == (unsigned long)aia; /* true */ *(unsigned long *)&a == *(unsigned long *)&aia; /* undefined on s390 */ Arnd -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html