Commit 435610aa authored by Christoph Mallon's avatar Christoph Mallon
Browse files

ir: Replace get_mode_sign() by mode_is_signed().

Both functions do the same and the former is used way less.
parent 94a9f13d
......@@ -126,11 +126,6 @@ FIRM_API unsigned get_mode_size_bits(const ir_mode *mode);
* If the size is not dividable by 8 returns -1. */
FIRM_API unsigned get_mode_size_bytes(const ir_mode *mode);
/** Returns the signedness of a mode.
*
* Returns the signedness of a mode: 1 if mode is signed. */
FIRM_API int get_mode_sign(const ir_mode *mode);
/** Returns the arithmetic of a mode */
FIRM_API ir_mode_arithmetic get_mode_arithmetic(const ir_mode *mode);
......
......@@ -972,11 +972,11 @@ static void optimize_load_conv(ir_node *node)
if (get_mode_size_bits(conv_mode) < get_mode_size_bits(load_mode))
return;
if (get_mode_sign(conv_mode) != get_mode_sign(load_mode)) {
if (mode_is_signed(conv_mode) != mode_is_signed(load_mode)) {
/* change the load if it has only 1 user */
if (get_irn_n_edges(pred) == 1) {
ir_mode *newmode;
if (get_mode_sign(conv_mode)) {
if (mode_is_signed(conv_mode)) {
newmode = find_signed_mode(load_mode);
} else {
newmode = find_unsigned_mode(load_mode);
......@@ -1018,7 +1018,7 @@ static void optimize_conv_conv(ir_node *node)
int pred_mode_bits = get_mode_size_bits(pred_mode);
if (conv_mode_bits == pred_mode_bits
&& get_mode_sign(conv_mode) == get_mode_sign(pred_mode)) {
&& mode_is_signed(conv_mode) == mode_is_signed(pred_mode)) {
result_conv = pred_proj;
} else if (conv_mode_bits <= pred_mode_bits) {
/* if 2nd conv is smaller then first conv, then we can always take the
......@@ -1049,7 +1049,7 @@ static void optimize_conv_conv(ir_node *node)
}
} else {
/* if both convs have the same sign, then we can take the smaller one */
if (get_mode_sign(conv_mode) == get_mode_sign(pred_mode)) {
if (mode_is_signed(conv_mode) == mode_is_signed(pred_mode)) {
result_conv = pred_proj;
} else {
/* no optimization possible if smaller conv is sign-extend */
......
......@@ -970,7 +970,7 @@ static void write_mode(write_env_t *env, ir_mode *mode)
write_string(env, get_mode_name(mode));
write_mode_arithmetic(env, get_mode_arithmetic(mode));
write_unsigned(env, get_mode_size_bits(mode));
write_int(env, get_mode_sign(mode));
write_int(env, mode_is_signed(mode));
write_unsigned(env, get_mode_modulo_shift(mode));
} else if (mode_is_reference(mode)) {
write_symbol(env, "reference_mode");
......
......@@ -232,11 +232,6 @@ unsigned (get_mode_size_bytes)(const ir_mode *mode)
return get_mode_size_bytes_(mode);
}
int (get_mode_sign)(const ir_mode *mode)
{
return get_mode_sign_(mode);
}
ir_mode_arithmetic (get_mode_arithmetic)(const ir_mode *mode)
{
return get_mode_arithmetic_(mode);
......
......@@ -19,7 +19,6 @@
#define get_mode_sort(mode) get_mode_sort_(mode)
#define get_mode_size_bits(mode) get_mode_size_bits_(mode)
#define get_mode_size_bytes(mode) get_mode_size_bytes_(mode)
#define get_mode_sign(mode) get_mode_sign_(mode)
#define get_mode_arithmetic(mode) get_mode_arithmetic_(mode)
#define get_mode_modulo_shift(mode) get_mode_modulo_shift_(mode)
#define mode_is_signed(mode) mode_is_signed_(mode)
......@@ -54,11 +53,6 @@ static inline unsigned get_mode_size_bytes_(const ir_mode *mode)
return size >> 3;
}
static inline int get_mode_sign_(const ir_mode *mode)
{
return mode->sign;
}
static inline ir_mode_arithmetic get_mode_arithmetic_(const ir_mode *mode)
{
return mode->arithmetic;
......
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