Commit 2e97a73d authored by Matthias Braun's avatar Matthias Braun
Browse files

softfloat: start getting independent of hardcoded modes

parent a6fdfa22
...@@ -139,46 +139,48 @@ static ir_type *get_softfloat_type(const ir_node *n) ...@@ -139,46 +139,48 @@ static ir_type *get_softfloat_type(const ir_node *n)
if (operand_mode == mode_D) { if (operand_mode == mode_D) {
if (mode == mode_F) if (mode == mode_F)
return unop_tp_d_f; return unop_tp_d_f;
else if (mode == mode_Is || mode == mode_Hs || mode == mode_Bs) else if (get_mode_arithmetic(mode) == irma_twos_complement) {
return unop_tp_d_is; if (get_mode_size_bits(mode) <= 32)
else if (mode == mode_Iu || mode == mode_Hu || mode == mode_Bu) return mode_is_signed(mode) ? unop_tp_d_is : unop_tp_d_iu;
return unop_tp_d_iu; else if (get_mode_size_bits(mode) == 64)
else if (mode == mode_Ls) return mode_is_signed(mode) ? unop_tp_d_ls : unop_tp_d_lu;
return unop_tp_d_ls; }
else if (mode == mode_Lu)
return unop_tp_d_lu;
} else if (operand_mode == mode_F) { } else if (operand_mode == mode_F) {
if (mode == mode_D) if (mode == mode_D)
return unop_tp_f_d; return unop_tp_f_d;
else if (mode == mode_Is || mode == mode_Hs || mode == mode_Bs) else if (get_mode_arithmetic(mode) == irma_twos_complement) {
return unop_tp_f_is; if (get_mode_size_bits(mode) <= 32)
else if (mode == mode_Iu || mode == mode_Hu || mode == mode_Bu) return mode_is_signed(mode) ? unop_tp_f_is : unop_tp_f_iu;
return unop_tp_f_iu; else if (get_mode_size_bits(mode) == 64)
else if (mode == mode_Ls) return mode_is_signed(mode) ? unop_tp_f_ls : unop_tp_f_lu;
return unop_tp_f_ls; }
else if (mode == mode_Lu) } else if (get_mode_arithmetic(operand_mode) == irma_twos_complement) {
return unop_tp_f_lu; if (mode_is_signed(operand_mode)) {
} else if (operand_mode == mode_Is || operand_mode == mode_Hs || operand_mode == mode_Bs) { if (get_mode_size_bits(operand_mode) <= 32) {
if (mode == mode_D) if (mode == mode_D)
return unop_tp_is_d; return unop_tp_is_d;
else if (mode == mode_F) else if (mode == mode_F)
return unop_tp_is_f; return unop_tp_is_f;
} else if (operand_mode == mode_Iu || operand_mode == mode_Hu || operand_mode == mode_Bu) { } else if (get_mode_size_bits(operand_mode) == 64) {
if (mode == mode_D)
return unop_tp_iu_d;
else if (mode == mode_F)
return unop_tp_iu_f;
} else if (operand_mode == mode_Ls) {
if (mode == mode_D) if (mode == mode_D)
return unop_tp_ls_d; return unop_tp_ls_d;
else if (mode == mode_F) else if (mode == mode_F)
return unop_tp_ls_f; return unop_tp_ls_f;
} else if (operand_mode == mode_Lu) { }
} else {
if (get_mode_size_bits(operand_mode) <= 32) {
if (mode == mode_D)
return unop_tp_iu_d;
else if (mode == mode_F)
return unop_tp_iu_f;
} else if (get_mode_size_bits(operand_mode) == 64) {
if (mode == mode_D) if (mode == mode_D)
return unop_tp_lu_d; return unop_tp_lu_d;
else if (mode == mode_F) else if (mode == mode_F)
return unop_tp_lu_f; return unop_tp_lu_f;
} }
}
}
break; break;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment