float la = immvalue_float(a);
float lb = immvalue_float(b);
check_inexact_float(a, b);
- return (ast_expression*)m_imm_float[!(ne ? la == lb : la != lb)];
- } if (isvector(a) && isvector(b)) {
+ return (ast_expression*)m_imm_float[ne ? la != lb : la == lb];
+ } else if (isvector(a) && isvector(b)) {
vec3_t la = immvalue_vector(a);
vec3_t lb = immvalue_vector(b);
- return (ast_expression*)m_imm_float[!(ne ? vec3_cmp(la, lb) : !vec3_cmp(la, lb))];
+ bool compare = vec3_cmp(la, lb);
+ return (ast_expression*)m_imm_float[ne ? !compare : compare];
+ } else if (isstring(a) && isstring(b)) {
+ bool compare = !strcmp(immvalue_string(a), immvalue_string(b));
+ return (ast_expression*)m_imm_float[ne ? !compare : compare];
}
}
return nullptr;
{
ir_value_code_setaddr(global, self->m_code->globals.size());
if (global->m_hasvalue) {
+ if (global->m_cvq == CV_CONST && global->m_reads.empty())
+ return true;
iptr = (int32_t*)&global->m_constval.ivec[0];
self->m_code->globals.push_back(*iptr);
} else {
{
ir_value_code_setaddr(global, self->m_code->globals.size());
if (global->m_hasvalue) {
+ if (global->m_cvq == CV_CONST && global->m_reads.empty())
+ return true;
uint32_t load = code_genstring(self->m_code.get(), global->m_constval.vstring);
self->m_code->globals.push_back(load);
} else {