Lines Matching refs:n
170 static int dasm_imm12(unsigned int n) in dasm_imm12() argument
172 if ((n >> 12) == 0) in dasm_imm12()
173 return n; in dasm_imm12()
174 else if ((n & 0xff000fff) == 0) in dasm_imm12()
175 return (n >> 12) | 0x1000; in dasm_imm12()
182 int n = -1; in dasm_ffs() local
183 while (x) { x >>= 1; n++; } in dasm_ffs()
184 return n; in dasm_ffs()
190 unsigned long long n = (((unsigned long long)hi) << 32) | (unsigned int)lo; in dasm_imm13() local
192 if (n & 1) { n = ~n; inv = 1; } in dasm_imm13()
193 a = n & -n; b = (n+a)&-(n+a); c = (n+a-b)&-(n+a-b); in dasm_imm13()
209 if ((b-a) * m != n) return -1; in dasm_imm13()
245 int *pl, n = action >= DASM_REL_PC ? va_arg(ap, int) : 0; in dasm_put() local
249 n = (ins & 255); CK(n < D->maxsection, RANGE_SEC); in dasm_put()
250 D->section = &D->sections[n]; goto stop; in dasm_put()
255 n = (ins & 2047) - 10; pl = D->lglabels + n; in dasm_put()
257 if (n >= 0) { CK(n>=10||*pl<0, RANGE_LG); CKPL(lg, LG); goto putrel; } in dasm_put()
258 pl += 10; n = *pl; in dasm_put()
259 if (n < 0) n = 0; /* Start new chain for fwd rel if label exists. */ in dasm_put()
262 pl = D->pclabels + n; CKPL(pc, PC); in dasm_put()
264 n = *pl; in dasm_put()
265 if (n < 0) { /* Label exists. Get label pos and store it. */ in dasm_put()
266 b[pos] = -n; in dasm_put()
269 b[pos] = n; /* Else link to rel chain, anchored at label. */ in dasm_put()
276 b[pos++] = n; in dasm_put()
282 pl = D->pclabels + n; CKPL(pc, PC); in dasm_put()
284 n = *pl; /* n > 0: Collapse rel chain and replace with label pos. */ in dasm_put()
285 while (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = pos; in dasm_put()
291 CK((n & ((1<<((ins>>10)&31))-1)) == 0, RANGE_I); in dasm_put()
292 n >>= ((ins>>10)&31); in dasm_put()
295 CK(((n + (1<<(((ins>>5)&31)-1)))>>((ins>>5)&31)) == 0, RANGE_I); in dasm_put()
297 CK((n>>((ins>>5)&31)) == 0, RANGE_I); in dasm_put()
299 b[pos++] = n; in dasm_put()
302 CK((n >> 6) == 0, RANGE_I); in dasm_put()
303 b[pos++] = n; in dasm_put()
306 CK(dasm_imm12((unsigned int)n) != -1, RANGE_I); in dasm_put()
307 b[pos++] = n; in dasm_put()
310 CK(dasm_imm13(n, n) != -1, RANGE_I); in dasm_put()
311 b[pos++] = n; in dasm_put()
315 CK(dasm_imm13(n, m) != -1, RANGE_I); in dasm_put()
316 b[pos++] = n; in dasm_put()
323 CK((!(n & ((1<<scale)-1)) && (unsigned int)(n>>scale) < 4096) || in dasm_put()
324 (unsigned int)(n+256) < 512, RANGE_I); in dasm_put()
326 b[pos++] = n; in dasm_put()
331 b[pos++] = n; in dasm_put()
334 CK(n < 32, RANGE_VREG); in dasm_put()
335 b[pos++] = n; in dasm_put()
367 int n = D->lglabels[idx]; in dasm_link() local
369 while (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = -idx; } in dasm_link()
409 do { if (!(x) && !(n = DASM_ADD_VENEER(D, buffer, ins, b, cp, o))) \
442 int n = (action >= DASM_ALIGN && action < DASM__MAX) ? *b++ : 0; in dasm_encode() local
447 n = DASM_EXTERN(Dst, (unsigned char *)cp, (ins&2047), !(ins&2048)); in dasm_encode()
453 if (n < 0) { in dasm_encode()
454 ptrdiff_t na = (ptrdiff_t)D->globals[-n] - (ptrdiff_t)cp + 4; in dasm_encode()
455 n = (int)na; in dasm_encode()
456 CK_REL((ptrdiff_t)n == na, na); in dasm_encode()
461 CK(n >= 0, UNDEF_PC); in dasm_encode()
462 n = *DASM_POS2PTR(D, n) - (int)((char *)cp - base) + 4; in dasm_encode()
465 CK_REL((n & 3) == 0 && ((n+0x08000000) >> 28) == 0, n); in dasm_encode()
466 cp[-1] |= ((n >> 2) & 0x03ffffff); in dasm_encode()
468 CK_REL((n & 3) == 0 && ((n+0x00100000) >> 21) == 0, n); in dasm_encode()
469 cp[-1] |= ((n << 3) & 0x00ffffe0); in dasm_encode()
471 CK_REL(((n+0x00100000) >> 21) == 0, n); in dasm_encode()
472 cp[-1] |= ((n << 3) & 0x00ffffe0) | ((n & 3) << 29); in dasm_encode()
474 cp[-1] |= ((n >> 9) & 0x00ffffe0) | (((n >> 12) & 3) << 29); in dasm_encode()
476 CK_REL((n & 3) == 0 && ((n+0x00008000) >> 16) == 0, n); in dasm_encode()
477 cp[-1] |= ((n << 3) & 0x0007ffe0); in dasm_encode()
479 cp[0] = (unsigned int)((ptrdiff_t)cp - 4 + n); in dasm_encode()
480 cp[1] = (unsigned int)(((ptrdiff_t)cp - 4 + n) >> 32); in dasm_encode()
485 ptrdiff_t na = (((ptrdiff_t)(*b++) << 32) | (unsigned int)n); in dasm_encode()
492 n = (int)na; in dasm_encode()
493 CK_REL((ptrdiff_t)n == na, na); in dasm_encode()
497 ins &= 2047; if (ins >= 20) D->globals[ins-10] = (void *)(base + n); in dasm_encode()
501 cp[-1] |= (n & ((1<<((ins>>5)&31))-1)) << (ins&31); in dasm_encode()
504 cp[-1] |= ((n&31) << 19) | ((n&32) << 26); in dasm_encode()
507 cp[-1] |= (dasm_imm12((unsigned int)n) << 10); in dasm_encode()
510 cp[-1] |= (dasm_imm13(n, n) << 10); in dasm_encode()
513 cp[-1] |= (dasm_imm13(n, *b++) << 10); in dasm_encode()
517 cp[-1] |= (!(n & ((1<<scale)-1)) && (unsigned int)(n>>scale) < 4096) ? in dasm_encode()
518 ((n << (10-scale)) | 0x01000000) : ((n & 511) << 12); in dasm_encode()
522 *cp++ = n; in dasm_encode()
525 cp[-1] |= (n & 0x1f) << (ins & 0x1f); in dasm_encode()