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
e5ad7ad7
Commit
e5ad7ad7
authored
Jul 30, 2015
by
Christoph Mallon
Browse files
arm: Make printing shifter operands a bit simpler.
parent
5ddb39db
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/arm/arm_emitter.c
View file @
e5ad7ad7
...
...
@@ -139,25 +139,17 @@ static void arm_emit_store_mode(const ir_node *node)
}
}
static
void
emi
t_shf_mod_name
(
arm_shift_modifier_t
mod
)
static
char
const
*
ge
t_shf_mod_name
(
arm_shift_modifier_t
mod
)
{
switch
(
mod
)
{
case
ARM_SHF_ASR_REG
:
case
ARM_SHF_ASR_IMM
:
be_emit_cstring
(
"asr"
);
return
;
case
ARM_SHF_ASR_IMM
:
return
"asr"
;
case
ARM_SHF_LSL_REG
:
case
ARM_SHF_LSL_IMM
:
be_emit_cstring
(
"lsl"
);
return
;
case
ARM_SHF_LSL_IMM
:
return
"lsl"
;
case
ARM_SHF_LSR_REG
:
case
ARM_SHF_LSR_IMM
:
be_emit_cstring
(
"lsr"
);
return
;
case
ARM_SHF_LSR_IMM
:
return
"lsr"
;
case
ARM_SHF_ROR_REG
:
case
ARM_SHF_ROR_IMM
:
be_emit_cstring
(
"ror"
);
return
;
case
ARM_SHF_ROR_IMM
:
return
"ror"
;
default:
break
;
}
...
...
@@ -183,23 +175,23 @@ static void arm_emit_shifter_operand(const ir_node *node)
case
ARM_SHF_ASR_IMM
:
case
ARM_SHF_LSL_IMM
:
case
ARM_SHF_LSR_IMM
:
case
ARM_SHF_ROR_IMM
:
case
ARM_SHF_ROR_IMM
:
{
arm_emit_source_register
(
node
,
attr
->
shifter_op_input
);
be_emit_cstring
(
", "
);
emit_shf_mod_name
(
attr
->
shift_modifier
);
be_emit_irprintf
(
" #0x%X"
,
attr
->
shift_immediate
);
char
const
*
const
mod
=
get_shf_mod_name
(
attr
->
shift_modifier
);
be_emit_irprintf
(
", %s #0x%X"
,
mod
,
attr
->
shift_immediate
);
return
;
}
case
ARM_SHF_ASR_REG
:
case
ARM_SHF_LSL_REG
:
case
ARM_SHF_LSR_REG
:
case
ARM_SHF_ROR_REG
:
case
ARM_SHF_ROR_REG
:
{
arm_emit_source_register
(
node
,
attr
->
shifter_op_input
);
be_emit_cstring
(
", "
);
emit_shf_mod_name
(
attr
->
shift_modifier
);
be_emit_cstring
(
" "
);
char
const
*
const
mod
=
get_shf_mod_name
(
attr
->
shift_modifier
);
be_emit_irprintf
(
", %s "
,
mod
);
arm_emit_source_register
(
node
,
attr
->
shifter_op_input
+
1
);
return
;
}
case
ARM_SHF_RRX
:
arm_emit_source_register
(
node
,
attr
->
shifter_op_input
);
...
...
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