Lines Matching defs:mz
233 parse_var(struct _citrus_mapper_zone *mz, struct _memstream *ms)
241 if (parse_zone(ms, &ps, &mz->mz_col))
248 mz->mz_row = mz->mz_col;
250 if (parse_zone(ms, &ps, &mz->mz_col))
256 mz->mz_col_bits = ps.ps_u_imm;
257 if (mz->mz_col_bits < 0 || mz->mz_col_bits > 32)
263 mz->mz_col_bits = 32;
264 mz->mz_row.z_begin = mz->mz_row.z_end = 0;
271 mz->mz_col_offset = ps.ps_s_imm;
274 mz->mz_row_offset = mz->mz_col_offset;
279 mz->mz_col_offset = ps.ps_s_imm;
281 mz->mz_row_offset = 0;
288 colmax = (mz->mz_col_bits == 32) ? 0 : 1 << mz->mz_col_bits;
289 rowmax = (mz->mz_col_bits == 0) ? 0 : 1 << (32-mz->mz_col_bits);
290 if (check_rowcol(&mz->mz_col, mz->mz_col_offset, colmax))
292 if (check_rowcol(&mz->mz_row, mz->mz_row_offset, rowmax))
305 struct _citrus_mapper_zone *mz;
312 mz = malloc(sizeof(*mz));
313 if (mz == NULL)
316 mz->mz_col.z_begin = mz->mz_col.z_end = 0;
317 mz->mz_row.z_begin = mz->mz_row.z_end = 0;
318 mz->mz_col_bits = 0;
319 mz->mz_row_offset = 0;
320 mz->mz_col_offset = 0;
324 if (parse_var(mz, &ms)) {
325 free(mz);
328 cm->cm_closure = mz;
348 struct _citrus_mapper_zone *mz = cm->cm_closure;
351 if (mz->mz_col_bits == 32) {
354 if (col < mz->mz_col.z_begin || col > mz->mz_col.z_end)
356 if (mz->mz_col_offset > 0)
357 col += (uint32_t)mz->mz_col_offset;
359 col -= (uint32_t)-mz->mz_col_offset;
362 col = src & (((uint32_t)1 << mz->mz_col_bits) - 1);
363 row = src >> mz->mz_col_bits;
364 if (row < mz->mz_row.z_begin || row > mz->mz_row.z_end ||
365 col < mz->mz_col.z_begin || col > mz->mz_col.z_end)
367 if (mz->mz_col_offset > 0)
368 col += (uint32_t)mz->mz_col_offset;
370 col -= (uint32_t)-mz->mz_col_offset;
371 if (mz->mz_row_offset > 0)
372 row += (uint32_t)mz->mz_row_offset;
374 row -= (uint32_t)-mz->mz_row_offset;
375 *dst = col | (row << mz->mz_col_bits);