Lines Matching defs:nbits
858 static bool is_in_wdisp_range(address a, address b, int nbits) {
860 return is_simm(d, nbits + 2);
895 // x is supposed to fit in a field "nbits" wide
898 static void assert_signed_range(intptr_t x, int nbits) {
899 assert(nbits == 32 || (-(1 << nbits-1) <= x && x < ( 1 << nbits-1)),
900 err_msg("value out of range: x=" INTPTR_FORMAT ", nbits=%d", x, nbits));
903 static void assert_signed_word_disp_range(intptr_t x, int nbits) {
905 assert_signed_range(x, nbits + 2);
908 static void assert_unsigned_const(int x, int nbits) {
909 assert( juint(x) < juint(1 << nbits), "unsigned constant out of range");
1021 static int inv_simm(int x, int nbits) {
1022 return (int)(x << (32 - nbits)) >> (32 - nbits);
1027 // signed immediate, in low bits, nbits long
1028 static int simm(int x, int nbits) {
1029 assert_signed_range(x, nbits);
1030 return x & (( 1 << nbits ) - 1);
1072 // word displacement in low-order nbits bits
1074 static intptr_t inv_wdisp( int x, intptr_t pos, int nbits ) {
1075 int pre_sign_extend = x & (( 1 << nbits ) - 1);
1076 int r = pre_sign_extend >= ( 1 << (nbits-1) )
1077 ? pre_sign_extend | ~(( 1 << nbits ) - 1)
1082 static int wdisp( intptr_t x, intptr_t off, int nbits ) {
1084 assert_signed_word_disp_range(xx, nbits);
1085 int r = (xx >> 2) & (( 1 << nbits ) - 1);
1086 assert( inv_wdisp( r, off, nbits ) == x, "inverse not inverse");