Lines Matching refs:value

148 emit_record_int(struct dxil_module *m, unsigned code, int value)
150 uint64_t data = value;
247 uint64_t value;
269 assert(data[curr_data] == a->operands[i].value);
271 /* literals are no-ops, because their value is defined in the
410 dxil_value_type_equal_to(const struct dxil_value *value,
413 return types_equal(value->type, rhs);
431 dxil_value_type_bitsize_equal_to(const struct dxil_value *value, unsigned bitsize)
433 switch (value->type->type) {
435 return value->type->int_bits == bitsize;
437 return value->type->float_bits == bitsize;
444 dxil_value_get_type(const struct dxil_value *value)
446 return value->type;
1151 if (!dxil_buffer_emit_vbr_bits(&m->buf, a->operands[i].value, 8))
1532 ret->value.id = -1;
1533 ret->value.type = type;
1542 intmax_t value)
1548 if (c->value.type != type || c->undef)
1551 if (c->int_value == value)
1552 return &c->value;
1559 c->int_value = value;
1560 return &c->value;
1564 dxil_module_get_int1_const(struct dxil_module *m, bool value)
1570 return get_int_const(m, type, value);
1574 dxil_module_get_int8_const(struct dxil_module *m, int8_t value)
1580 return get_int_const(m, type, value);
1584 dxil_module_get_int16_const(struct dxil_module *m, int16_t value)
1590 return get_int_const(m, type, value);
1594 dxil_module_get_int32_const(struct dxil_module *m, int32_t value)
1600 return get_int_const(m, type, value);
1604 dxil_module_get_int64_const(struct dxil_module *m, int64_t value)
1610 return get_int_const(m, type, value);
1614 dxil_module_get_int_const(struct dxil_module *m, intmax_t value,
1619 assert(value == 0 || value == 1);
1620 return dxil_module_get_int1_const(m, value);
1623 assert(INT8_MIN <= value && value <= INT8_MAX);
1624 return dxil_module_get_int8_const(m, value);
1627 assert(INT16_MIN <= value && value <= INT16_MAX);
1628 return dxil_module_get_int16_const(m, value);
1631 assert(INT32_MIN <= value && value <= INT32_MAX);
1632 return dxil_module_get_int32_const(m, value);
1635 assert(INT64_MIN <= value && value <= INT64_MAX);
1636 return dxil_module_get_int64_const(m, value);
1644 dxil_module_get_float16_const(struct dxil_module *m, uint16_t value)
1652 if (c->value.type != type || c->undef)
1655 if (c->int_value == (uintmax_t)value)
1656 return &c->value;
1663 c->int_value = (uintmax_t)value;
1664 return &c->value;
1668 dxil_module_get_float_const(struct dxil_module *m, float value)
1676 if (c->value.type != type || c->undef)
1679 if (c->float_value == value)
1680 return &c->value;
1687 c->float_value = value;
1688 return &c->value;
1692 dxil_module_get_double_const(struct dxil_module *m, double value)
1700 if (c->value.type != type || c->undef)
1703 if (c->float_value == value)
1704 return &c->value;
1711 c->float_value = value;
1712 return &c->value;
1724 if (c->value.type != type || c->undef)
1728 return &c->value;
1739 return &c->value;
1749 if (c->value.type != type)
1753 return &c->value;
1757 return c ? &c->value : NULL;
1803 enum dxil_address_space as, int align, const struct dxil_value *value)
1814 gvar->constant = !!value;
1815 gvar->initializer = value;
1817 gvar->value.id = -1;
1818 gvar->value.type = value_type;
1821 return &gvar->value;
1828 const struct dxil_value *value)
1830 return add_gvar(m, name, type, type, as, align, value);
1837 const struct dxil_value *value)
1840 as, align, value);
1865 func->value.id = -1;
1866 func->value.type = type->function_def.ret_type;
2074 encode_signed(int64_t value)
2076 return value >= 0 ?
2077 (value << 1) :
2078 ((-value << 1) | 1);
2082 emit_int_value(struct dxil_module *m, int64_t value)
2084 if (!value)
2087 uint64_t data[] = { CST_CODE_INTEGER, encode_signed(value) };
2093 emit_float16_value(struct dxil_module *m, uint16_t value)
2095 if (!value)
2097 uint64_t data = value;
2102 emit_float_value(struct dxil_module *m, float value)
2104 uint64_t data = fui(value);
2111 emit_double_value(struct dxil_module *m, double value)
2114 u.d = value;
2140 assert(c->value.id >= 0);
2141 assert(c->value.type != NULL);
2142 if (curr_type != c->value.type) {
2143 assert(c->value.type->id >= 0);
2144 if (!emit_set_type(m, c->value.type->id))
2146 curr_type = c->value.type;
2182 c->value.type->array_or_vector_def.num_elems))
2214 emit_symtab_entry(struct dxil_module *m, unsigned value, const char *name)
2220 temp[1] = value;
2241 if (!emit_symtab_entry(m, func->value.id, func->name))
2246 if (!emit_symtab_entry(m, gvar->value.id, gvar->name))
2321 const struct dxil_value *value)
2326 n->value.type == type &&
2327 n->value.value == value)
2333 n->value.type = type;
2334 n->value.value = value;
2344 return dxil_get_metadata_value(m, ptr_type, &func->value);
2375 dxil_get_metadata_int1(struct dxil_module *m, bool value)
2381 const struct dxil_value *const_value = get_int_const(m, type, value);
2389 dxil_get_metadata_int8(struct dxil_module *m, int8_t value)
2395 const struct dxil_value *const_value = get_int_const(m, type, value);
2403 dxil_get_metadata_int32(struct dxil_module *m, int32_t value)
2409 const struct dxil_value *const_value = get_int_const(m, type, value);
2417 dxil_get_metadata_int64(struct dxil_module *m, int64_t value)
2423 const struct dxil_value *const_value = get_int_const(m, type, value);
2431 dxil_get_metadata_float32(struct dxil_module *m, float value)
2437 const struct dxil_value *const_value = dxil_module_get_float_const(m, value);
2472 const struct dxil_value *value)
2474 assert(type->id >= 0 && value->id >= 0);
2475 uint64_t data[2] = { type->id, value->id };
2523 return emit_metadata_value(m, n->value.type, n->value.value);
2602 ret->value.id = -1;
2603 ret->value.type = ret_type;
2646 return &instr->value;
2663 return &instr->value;
2684 return &instr->value;
2690 const struct dxil_value *value)
2692 assert(legal_arith_type(value->type));
2701 instr->cast.value = value;
2703 return &instr->value;
2727 return instr->has_value ? &instr->value : NULL;
2766 instr->phi.incoming[dst].value = incoming_values[i];
2807 return &instr->value;
2832 instr->ret.value = NULL;
2855 return &instr->value;
2883 return &instr->value;
2931 return &instr->value;
2955 return &instr->value;
2959 dxil_emit_store(struct dxil_module *m, const struct dxil_value *value,
2963 assert(legal_arith_type(value->type));
2970 instr->store.value = value;
2999 return &instr->value;
3003 dxil_emit_atomicrmw(struct dxil_module *m, const struct dxil_value *value,
3015 instr->atomicrmw.value = value;
3023 return &instr->value;
3030 assert(instr->value.id > instr->binop.operands[0]->id);
3031 assert(instr->value.id > instr->binop.operands[1]->id);
3036 instr->value.id - instr->binop.operands[0]->id,
3037 instr->value.id - instr->binop.operands[1]->id,
3046 instr->value.id - instr->binop.operands[0]->id,
3047 instr->value.id - instr->binop.operands[1]->id,
3058 assert(instr->value.id > instr->cmp.operands[0]->id);
3059 assert(instr->value.id > instr->cmp.operands[1]->id);
3061 instr->value.id - instr->cmp.operands[0]->id,
3062 instr->value.id - instr->cmp.operands[1]->id,
3073 assert(instr->value.id > instr->select.operands[0]->id);
3074 assert(instr->value.id > instr->select.operands[1]->id);
3075 assert(instr->value.id > instr->select.operands[2]->id);
3077 instr->value.id - instr->select.operands[1]->id,
3078 instr->value.id - instr->select.operands[2]->id,
3079 instr->value.id - instr->select.operands[0]->id
3089 assert(instr->value.id > instr->cast.value->id);
3092 instr->value.id - instr->cast.value->id,
3113 assert(instr->value.id > instr->br.cond->id);
3120 instr->value.id - instr->br.cond->id
3134 int64_t value_delta = instr->value.id - instr->phi.incoming[i].value->id;
3148 assert(instr->value.id > instr->extractval.src->id);
3149 assert(instr->value.id > instr->extractval.type->id);
3151 /* relative value ID, followed by absolute type ID (only if
3154 instr->value.id - instr->extractval.src->id,
3165 assert(instr->call.func->value.id >= 0 && instr->value.id >= 0);
3167 assert(instr->call.func->value.id <= instr->value.id);
3168 int value_id_delta = instr->value.id - instr->call.func->value.id;
3179 data[4 + i] = instr->value.id - instr->call.args[i]->id;
3191 if (instr->ret.value) {
3192 assert(instr->ret.value->id >= 0);
3193 uint64_t data[] = { FUNC_CODE_INST_RET, instr->ret.value->id };
3234 assert(instr->value.id > instr->gep.operands[i]->id);
3235 data[3 + i] = instr->value.id - instr->gep.operands[i]->id;
3245 assert(instr->value.id > instr->load.ptr->id);
3249 instr->value.id - instr->load.ptr->id,
3261 assert(instr->value.id > instr->store.value->id);
3262 assert(instr->value.id > instr->store.ptr->id);
3265 instr->value.id - instr->store.ptr->id,
3266 instr->value.id - instr->store.value->id,
3278 assert(instr->value.id > instr->cmpxchg.cmpval->id);
3279 assert(instr->value.id > instr->cmpxchg.newval->id);
3280 assert(instr->value.id > instr->cmpxchg.ptr->id);
3282 instr->value.id - instr->cmpxchg.ptr->id,
3283 instr->value.id - instr->cmpxchg.cmpval->id,
3284 instr->value.id - instr->cmpxchg.newval->id,
3297 assert(instr->value.id > instr->atomicrmw.value->id);
3298 assert(instr->value.id > instr->atomicrmw.ptr->id);
3300 instr->value.id - instr->atomicrmw.ptr->id,
3301 instr->value.id - instr->atomicrmw.value->id,
3387 gvar->value.id = next_value_id++;
3392 func->value.id = next_value_id++;
3397 c->value.id = next_value_id++;
3408 instr->value.id = next_value_id;