Commit b598c2b5 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

arm: Correct loading of floating constants when using fpa.

The node must use the mode of the floating point register class, irrespective of the mode of the loaded constant.
parent 3a0aa64c
......@@ -402,14 +402,15 @@ static void emit_arm_FrameAddr(const ir_node *irn)
*/
static void emit_arm_fConst(const ir_node *irn)
{
ent_or_tv_t key;
key.u.tv = get_fConst_value(irn);
key.is_entity = false;
key.label = 0;
ir_tarval *const tv = get_fConst_value(irn);
ent_or_tv_t key = {
.u.tv = tv,
.is_entity = false
};
ent_or_tv_t *entry = get_ent_or_tv_entry(&key);
/* load the tarval indirect */
ir_mode *mode = get_irn_mode(irn);
ir_mode *const mode = get_tarval_mode(tv);
arm_emitf(irn, "ldf%m %D0, %C", mode, entry);
}
......
......@@ -629,7 +629,7 @@ fConst => {
irn_flags => [ "rematerializable" ],
attr => "ir_tarval *tv",
init_attr => "attr->tv = tv;",
mode => "get_tarval_mode(tv)",
mode => $mode_fp,
out_reqs => [ "fpa" ],
attr_type => "arm_fConst_attr_t",
},
......
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