typedef struct backend_params {
/** If set, the backend supports inline assembly. */
unsigned support_inline_asm:1;
+ /** If set, the backend supports Rotl nodes */
+ unsigned support_rotl:1;
/** callback that performs lowerings required for target architecture */
lower_for_target_func lower_for_target;
struct ir_settings_arch_dep_t {
/* Mul optimization */
unsigned also_use_subs : 1; /**< Use also Subs when resolving Muls to shifts */
- unsigned maximum_shifts; /**< The maximum number of shifts that shall be inserted for a mul. */
+ unsigned maximum_shifts; /**< The maximum number of shifts that shall be inserted for a mul. */
unsigned highest_shift_amount; /**< The highest shift amount you want to
tolerate. Muls which would require a higher
shift constant are left. */
/* Div/Mod optimization */
unsigned allow_mulhs : 1; /**< Use the Mulhs operation for division by constant */
unsigned allow_mulhu : 1; /**< Use the Mulhu operation for division by constant */
- unsigned max_bits_for_mulh; /**< Maximum number of bits the Mulh operation can take.
+ unsigned max_bits_for_mulh; /**< Maximum number of bits the Mulh operation can take.
Modes with higher amount of bits will use Mulh */
};
{
static backend_params p = {
0, /* no inline assembly */
+ 0, /* no support for Rotl nodes */
TEMPLATE_lower_for_target, /* lowering for target */
NULL, /* architecture dependent settings, will be set later */
NULL, /* parameter for if conversion */
static const backend_params *amd64_get_backend_params(void) {
static backend_params p = {
0, /* no inline assembly */
+ 1, /* support Rotl nodes */
amd64_lower_for_target, /* lowering callback */
NULL, /* will be set later */
NULL, /* parameter for if conversion */
};
static backend_params p = {
0, /* don't support inline assembler yet */
+ 1, /* support Rotl nodes */
NULL, /* lowering function */
&ad, /* will be set later */
arm_is_mux_allowed, /* allow_ifconv function */
/** The be parameters returned by default, all off. */
static const backend_params be_params = {
0, /* don't support inline assembler yet */
+ 0, /* don't support rotl */
NULL, /* no lowering required */
NULL, /* will be set later */
NULL, /* no if conversion settings */
};
static backend_params p = {
1, /* support inline assembly */
+ 1, /* support Rotl nodes */
ia32_lower_for_target,
NULL, /* will be set later */
ia32_is_mux_allowed,
{
static backend_params p = {
0, /* no inline assembly */
+ 0, /* no support for RotL nodes */
sparc_lower_for_target, /* lowering callback */
NULL, /* will be set later */
NULL, /* parameter for if conversion */
#include "array_t.h"
#include "vrp.h"
#include "firm_types.h"
+#include "be.h"
/* Make types visible to allow most efficient access */
#include "entity_t.h"
!= (int) get_mode_size_bits(mode))
return or;
+ /* some backends can't handle rotl */
+ if (!be_get_backend_param()->support_rotl)
+ return or;
+
/* yet, condition met */
block = get_nodes_block(or);
rotval = sub; /* a Rot right is not supported, so use a rot left */
} else if (is_Sub(c2)) {
v = c1;
- sub = c2;
+ sub = c2;
rotval = v;
- } else return or;
+ } else {
+ return or;
+ }
if (get_Sub_right(sub) != v)
return or;
if (get_tarval_long(tv1) != (int) get_mode_size_bits(mode))
return or;
+ /* some backends can't handle rotl */
+ if (!be_get_backend_param()->support_rotl)
+ return or;
+
/* yet, condition met */
block = get_nodes_block(or);