#--------------------------------------------------#
$default_attr_type = "arm_attr_t";
+$default_copy_attr = "arm_copy_attr";
%init_attr = (
arm_attr_t => "\tinit_arm_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res, latency);",
attr_type => "arm_SymConst_attr_t",
},
-CondJmp => {
+CmpBra => {
op_flags => "L|X|Y",
state => "pinned",
- comment => "construct conditional jump: CMP A, B && JMPxx LABEL",
+ comment => "construct conditional branch: CMP A, B && JMPxx LABEL",
mode => "mode_T",
attr => "int proj_num",
init_attr => "\tset_arm_CondJmp_proj_num(res, proj_num);",
# commutative operations
-fpaAdd => {
+fpaAdf => {
op_flags => "C",
irn_flags => "R",
comment => "construct FPA Add: Add(a, b) = Add(b, a) = a + b",
emit => '. adf%M %D0, %S0, %S1',
},
-fpaMul => {
+fpaAdf_i => {
op_flags => "C",
+ irn_flags => "R",
+ comment => "construct FPA Add: Add(a, b) = Add(b, a) = a + b",
+ attr => "tarval *tv",
+ init_attr => 'ARM_SET_FPA_IMM(attr); attr->value = tv;',
+ cmp_attr => 'return attr_a->value != attr_b->value;',
+ reg_req => { "in" => [ "fpa" ], "out" => [ "fpa" ] },
+ emit => '. adf%M %D0, %S0, %C',
+},
+
+fpaMuf => {
+ op_flags => "C",
+ irn_flags => "R",
comment => "construct FPA Mul: Mul(a, b) = Mul(b, a) = a * b",
reg_req => { "in" => [ "fpa", "fpa" ], "out" => [ "fpa" ] },
emit =>'. muf%M %D0, %S0, %S1',
},
-fpaFMul => {
+fpaMuf_i => {
op_flags => "C",
+ irn_flags => "R",
+ comment => "construct FPA Mul: Mul(a, b) = Mul(b, a) = a * b",
+ attr => "tarval *tv",
+ init_attr => 'ARM_SET_FPA_IMM(attr); attr->value = tv;',
+ cmp_attr => 'return attr_a->value != attr_b->value;',
+ reg_req => { "in" => [ "fpa" ], "out" => [ "fpa" ] },
+ emit => '. muf%M %D0, %S0, %C',
+},
+
+fpaFml => {
+ op_flags => "C",
+ irn_flags => "R",
comment => "construct FPA Fast Mul: Mul(a, b) = Mul(b, a) = a * b",
reg_req => { "in" => [ "fpa", "fpa" ], "out" => [ "fpa" ] },
emit =>'. fml%M %D0, %S0, %S1',
# not commutative operations
-fpaSub => {
+fpaSuf => {
irn_flags => "R",
comment => "construct FPA Sub: Sub(a, b) = a - b",
reg_req => { "in" => [ "fpa", "fpa" ], "out" => [ "fpa" ] },
emit => '. suf%M %D0, %S0, %S1'
},
-fpaRsb => {
+fpaSuf_i => {
+ irn_flags => "R",
+ comment => "construct FPA Sub: Sub(a, b) = a - b",
+ attr => "tarval *tv",
+ init_attr => 'ARM_SET_FPA_IMM(attr); attr->value = tv;',
+ cmp_attr => 'return attr_a->value != attr_b->value;',
+ reg_req => { "in" => [ "fpa" ], "out" => [ "fpa" ] },
+ emit => '. suf%M %D0, %S0, %C'
+},
+
+fpaRsf => {
irn_flags => "R",
comment => "construct FPA reverse Sub: Sub(a, b) = b - a",
reg_req => { "in" => [ "fpa", "fpa" ], "out" => [ "fpa" ] },
emit => '. rsf%M %D0, %S0, %S1'
},
-fpaDiv => {
+fpaRsf_i => {
+ irn_flags => "R",
+ comment => "construct FPA reverse Sub: Sub(a, b) = b - a",
+ attr => "tarval *tv",
+ init_attr => 'ARM_SET_FPA_IMM(attr); attr->value = tv;',
+ cmp_attr => 'return attr_a->value != attr_b->value;',
+ reg_req => { "in" => [ "fpa" ], "out" => [ "fpa" ] },
+ emit => '. rsf%M %D0, %S0, %C'
+},
+
+fpaDvf => {
comment => "construct FPA Div: Div(a, b) = a / b",
attr => "ir_mode *op_mode",
init_attr => "attr->op_mode = op_mode;",
outs => [ "res", "M" ],
},
-fpaRdv => {
+fpaDvf_i => {
+ comment => "construct FPA Div: Div(a, b) = a / b",
+ attr => "ir_mode *op_mode, tarval *tv",
+ init_attr => 'attr->op_mode = op_mode; ARM_SET_FPA_IMM(attr); attr->value = tv;',
+ cmp_attr => 'return attr_a->value != attr_b->value;',
+ reg_req => { "in" => [ "fpa" ], "out" => [ "fpa", "none" ] },
+ emit =>'. dvf%M %D0, %S0, %C',
+ outs => [ "res", "M" ],
+},
+
+fpaRdf => {
comment => "construct FPA reverse Div: Div(a, b) = b / a",
attr => "ir_mode *op_mode",
init_attr => "attr->op_mode = op_mode;",
outs => [ "res", "M" ],
},
-fpaFDiv => {
+fpaRdf_i => {
+ comment => "construct FPA reverse Div: Div(a, b) = b / a",
+ attr => "ir_mode *op_mode, tarval *tv",
+ init_attr => 'attr->op_mode = op_mode; ARM_SET_FPA_IMM(attr); attr->value = tv;',
+ cmp_attr => 'return attr_a->value != attr_b->value;',
+ reg_req => { "in" => [ "fpa" ], "out" => [ "fpa", "none" ] },
+ emit =>'. rdf%M %D0, %S0, %S1',
+ outs => [ "res", "M" ],
+},
+
+fpaFdv => {
comment => "construct FPA Fast Div: Div(a, b) = a / b",
attr => "ir_mode *op_mode",
init_attr => "attr->op_mode = op_mode;",
outs => [ "res", "M" ],
},
-fpaFRdv => {
+fpaFdv_i => {
+ comment => "construct FPA Fast Div: Div(a, b) = a / b",
+ attr => "ir_mode *op_mode, tarval *tv",
+ init_attr => 'attr->op_mode = op_mode; ARM_SET_FPA_IMM(attr); attr->value = tv;',
+ cmp_attr => 'return attr_a->value != attr_b->value;',
+ reg_req => { "in" => [ "fpa" ], "out" => [ "fpa", "none" ] },
+ emit =>'. fdv%M %D0, %S0, %C',
+ outs => [ "res", "M" ],
+},
+
+fpaFrd => {
comment => "construct FPA Fast reverse Div: Div(a, b) = b / a",
attr => "ir_mode *op_mode",
init_attr => "attr->op_mode = op_mode;",
outs => [ "res", "M" ],
},
-fpaMov => {
+fpaFrd_i => {
+ comment => "construct FPA Fast reverse Div: Div(a, b) = b / a",
+ attr => "ir_mode *op_mode, tarval *tv",
+ init_attr => 'attr->op_mode = op_mode; ARM_SET_FPA_IMM(attr); attr->value = tv;',
+ cmp_attr => 'return attr_a->value != attr_b->value;',
+ reg_req => { "in" => [ "fpa" ], "out" => [ "fpa", "none" ] },
+ emit =>'. frd%M %D0, %S0, %C',
+ outs => [ "res", "M" ],
+},
+
+fpaMvf => {
irn_flags => "R",
comment => "construct FPA Move: b = a",
reg_req => { "in" => [ "fpa" ], "out" => [ "fpa" ] },
emit => '. mvf%M %S0, %D0',
},
-fpaMnv => {
+fpaMvf_i => {
+ irn_flags => "R",
+ comment => "represents a float constant",
+ attr => "tarval *tv",
+ init_attr => 'ARM_SET_FPA_IMM(attr); attr->value = tv;',
+ reg_req => { "out" => [ "fpa" ] },
+ mode => "get_tarval_mode(tv)",
+ emit => '. mvf %D0, %C',
+ cmp_attr => 'return attr_a->value != attr_b->value;'
+},
+
+fpaMnf => {
irn_flags => "R",
comment => "construct FPA Move Negated: b = -a",
reg_req => { "in" => [ "fpa" ], "out" => [ "fpa" ] },
emit => '. mnf%M %S0, %D0',
},
+fpaMnf_i => {
+ irn_flags => "R",
+ comment => "represents a float constant",
+ attr => "tarval *tv",
+ init_attr => 'ARM_SET_FPA_IMM(attr); attr->value = tv;',
+ reg_req => { "out" => [ "fpa" ] },
+ mode => "get_tarval_mode(tv)",
+ emit => '. mnf %D0, %C',
+ cmp_attr => 'return attr_a->value != attr_b->value;'
+},
+
fpaAbs => {
irn_flags => "R",
comment => "construct FPA Absolute value: fAbsd(a) = |a|",
emit => '. fix %D0, %S0',
},
+fpaCmfBra => {
+ op_flags => "L|X|Y",
+ state => "pinned",
+ comment => "construct floating point Compare and Branch: CMF A, B && JMPxx LABEL",
+ mode => "mode_T",
+ attr => "int proj_num",
+ init_attr => "\tset_arm_CondJmp_proj_num(res, proj_num);",
+ reg_req => { "in" => [ "fpa", "fpa" ], "out" => [ "none", "none"] },
+ attr_type => "arm_CondJmp_attr_t",
+},
+
+fpaCnfBra => {
+ op_flags => "L|X|Y",
+ state => "pinned",
+ comment => "construct floating point Compare negative and Branch: CMF A, -B && JMPxx LABEL",
+ mode => "mode_T",
+ attr => "int proj_num",
+ init_attr => "\tset_arm_CondJmp_proj_num(res, proj_num);",
+ reg_req => { "in" => [ "fpa", "fpa" ], "out" => [ "none", "none"] },
+ attr_type => "arm_CondJmp_attr_t",
+},
+
+fpaCmfeBra => {
+ op_flags => "L|X|Y",
+ state => "pinned",
+ comment => "construct floating point Compare and Branch: CMF A, -B && JMPxx LABEL",
+ mode => "mode_T",
+ attr => "int proj_num",
+ init_attr => "\tset_arm_CondJmp_proj_num(res, proj_num);",
+ reg_req => { "in" => [ "fpa", "fpa" ], "out" => [ "none", "none"] },
+ attr_type => "arm_CondJmp_attr_t",
+},
+
+fpaCnfeBra => {
+ op_flags => "L|X|Y",
+ state => "pinned",
+ comment => "construct floating point Compare and Branch: CMF A, -B && JMPxx LABEL",
+ mode => "mode_T",
+ attr => "int proj_num",
+ init_attr => "\tset_arm_CondJmp_proj_num(res, proj_num);",
+ reg_req => { "in" => [ "fpa", "fpa" ], "out" => [ "none", "none"] },
+ attr_type => "arm_CondJmp_attr_t",
+},
+
# Load / Store
fpaLdf => {