Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
289b4c48
Commit
289b4c48
authored
Aug 02, 2010
by
Matthias Braun
Browse files
simplify doubleword lowering: we have a type for each mode by default nowadays
[r27861]
parent
a7b0fcb5
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/lower/lower_dw.c
View file @
289b4c48
...
...
@@ -54,9 +54,6 @@
#include "array_t.h"
#include "irpass_t.h"
/** A map from mode to a primitive type. */
static
pmap
*
prim_types
;
/** A map from (op, imode, omode) to Intrinsic functions entities. */
static
set
*
intrinsic_fkt
;
...
...
@@ -124,25 +121,6 @@ typedef struct _lower_env_t {
ir_type
*
value_param_tp
;
/**< the old value param type */
}
lower_env_t
;
/**
* Get a primitive mode for a mode.
*/
static
ir_type
*
get_primitive_type
(
ir_mode
*
mode
)
{
pmap_entry
*
entry
=
pmap_find
(
prim_types
,
mode
);
ir_type
*
tp
;
char
buf
[
64
];
if
(
entry
)
return
entry
->
value
;
snprintf
(
buf
,
sizeof
(
buf
),
"_prim_%s"
,
get_mode_name
(
mode
));
tp
=
new_type_primitive
(
mode
);
pmap_insert
(
prim_types
,
mode
,
tp
);
return
tp
;
}
/* get_primitive_type */
/**
* Create a method type for a Conv emulation from imode to omode.
*/
...
...
@@ -176,7 +154,7 @@ static ir_type *get_conv_type(ir_mode *imode, ir_mode *omode, lower_env_t *env)
set_method_param_type
(
mtd
,
n_param
++
,
tp_u
);
set_method_param_type
(
mtd
,
n_param
++
,
tp_u
);
}
else
{
ir_type
*
tp
=
get_
primitive_typ
e
(
imode
);
ir_type
*
tp
=
get_
type_for_mod
e
(
imode
);
set_method_param_type
(
mtd
,
n_param
++
,
tp
);
}
/* if */
...
...
@@ -188,7 +166,7 @@ static ir_type *get_conv_type(ir_mode *imode, ir_mode *omode, lower_env_t *env)
set_method_res_type
(
mtd
,
n_res
++
,
tp_u
);
set_method_res_type
(
mtd
,
n_res
++
,
tp_u
);
}
else
{
ir_type
*
tp
=
get_
primitive_typ
e
(
omode
);
ir_type
*
tp
=
get_
type_for_mod
e
(
omode
);
set_method_res_type
(
mtd
,
n_res
++
,
tp
);
}
/* if */
entry
->
mtd
=
mtd
;
...
...
@@ -2463,8 +2441,6 @@ void lower_dw_ops(const lwrdw_param_t *param)
assert
(
get_mode_size_bits
(
param
->
low_signed
)
==
get_mode_size_bits
(
param
->
low_unsigned
));
/* create the necessary maps */
if
(
!
prim_types
)
prim_types
=
pmap_create
();
if
(
!
intrinsic_fkt
)
intrinsic_fkt
=
new_set
(
cmp_op_mode
,
iro_Last
+
1
);
if
(
!
conv_types
)
...
...
@@ -2474,9 +2450,9 @@ void lower_dw_ops(const lwrdw_param_t *param)
/* create a primitive unsigned and signed type */
if
(
!
tp_u
)
tp_u
=
get_
primitive_typ
e
(
param
->
low_unsigned
);
tp_u
=
get_
type_for_mod
e
(
param
->
low_unsigned
);
if
(
!
tp_s
)
tp_s
=
get_
primitive_typ
e
(
param
->
low_signed
);
tp_s
=
get_
type_for_mod
e
(
param
->
low_signed
);
/* create method types for the created binop calls */
if
(
!
binop_tp_u
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment