Commit 362addbc authored by Matthias Braun's avatar Matthias Braun
Browse files

TEMPLATE: Change assebler to a friendlier form

parent 3ab17631
...@@ -104,63 +104,63 @@ $default_copy_attr = "TEMPLATE_copy_attr"; ...@@ -104,63 +104,63 @@ $default_copy_attr = "TEMPLATE_copy_attr";
Add => { Add => {
irn_flags => [ "rematerializable" ], irn_flags => [ "rematerializable" ],
reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] }, reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] },
emit => 'add %S0, %S1, %D0', emit => '%D0 = add %S0, %S1',
mode => $mode_gp, mode => $mode_gp,
}, },
Mul => { Mul => {
irn_flags => [ "rematerializable" ], irn_flags => [ "rematerializable" ],
reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] }, reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] },
emit =>'mul %S0, %S1, %D0', emit => '%D0 = mul %S0, %S1',
mode => $mode_gp, mode => $mode_gp,
}, },
And => { And => {
irn_flags => [ "rematerializable" ], irn_flags => [ "rematerializable" ],
reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] }, reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] },
emit => 'and %S0, %S1, %D0', emit => '%D0 = and %S0, %S1',
mode => $mode_gp, mode => $mode_gp,
}, },
Or => { Or => {
irn_flags => [ "rematerializable" ], irn_flags => [ "rematerializable" ],
reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] }, reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] },
emit => 'or %S0, %S1, %D0', emit => '%D0 = or %S0, %S1',
mode => $mode_gp, mode => $mode_gp,
}, },
Xor => { Xor => {
irn_flags => [ "rematerializable" ], irn_flags => [ "rematerializable" ],
reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] }, reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] },
emit => 'xor %S0, %S1, %D0', emit => '%D0 = xor %S0, %S1',
mode => $mode_gp, mode => $mode_gp,
}, },
Sub => { Sub => {
irn_flags => [ "rematerializable" ], irn_flags => [ "rematerializable" ],
reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] }, reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] },
emit => 'sub %S0, %S1, %D0', emit => '%D0 = sub %S0, %S1',
mode => $mode_gp, mode => $mode_gp,
}, },
Shl => { Shl => {
irn_flags => [ "rematerializable" ], irn_flags => [ "rematerializable" ],
reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] }, reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] },
emit => 'shl %S0, %S1, %D0', emit => '%D0 = shl %S0, %S1',
mode => $mode_gp, mode => $mode_gp,
}, },
Shr => { Shr => {
irn_flags => [ "rematerializable" ], irn_flags => [ "rematerializable" ],
reg_req => { in => [ "gp", "gp" ], out => [ "in_r1" ] }, reg_req => { in => [ "gp", "gp" ], out => [ "in_r1" ] },
emit => 'shr %S1, %D0', emit => '%D0 = shr %S1',
mode => $mode_gp, mode => $mode_gp,
}, },
Minus => { Minus => {
irn_flags => [ "rematerializable" ], irn_flags => [ "rematerializable" ],
reg_req => { in => [ "gp" ], out => [ "gp" ] }, reg_req => { in => [ "gp" ], out => [ "gp" ] },
emit => 'neg %S0, %D0', emit => '%D0 = neg %S0',
mode => $mode_gp, mode => $mode_gp,
}, },
...@@ -168,7 +168,7 @@ Not => { ...@@ -168,7 +168,7 @@ Not => {
arity => 1, arity => 1,
remat => 1, remat => 1,
reg_req => { in => [ "gp" ], out => [ "gp" ] }, reg_req => { in => [ "gp" ], out => [ "gp" ] },
emit => 'not %S0, %D0', emit => '%D0 = not %S0',
mode => $mode_gp, mode => $mode_gp,
}, },
...@@ -178,7 +178,7 @@ Const => { ...@@ -178,7 +178,7 @@ Const => {
attr => "ir_tarval *value", attr => "ir_tarval *value",
custominit => "set_TEMPLATE_value(res, value);", custominit => "set_TEMPLATE_value(res, value);",
reg_req => { out => [ "gp" ] }, reg_req => { out => [ "gp" ] },
emit => 'mov %I, %D0', emit => '%D0 = const %I',
mode => $mode_gp, mode => $mode_gp,
}, },
...@@ -217,7 +217,7 @@ Load => { ...@@ -217,7 +217,7 @@ Load => {
irn_flags => [ "rematerializable" ], irn_flags => [ "rematerializable" ],
state => "exc_pinned", state => "exc_pinned",
reg_req => { in => [ "gp", "none" ], out => [ "gp" ] }, reg_req => { in => [ "gp", "none" ], out => [ "gp" ] },
emit => 'mov (%S0), %D0', emit => '%D0 = load (%S0)',
}, },
Store => { Store => {
...@@ -225,7 +225,7 @@ Store => { ...@@ -225,7 +225,7 @@ Store => {
irn_flags => [ "rematerializable" ], irn_flags => [ "rematerializable" ],
state => "exc_pinned", state => "exc_pinned",
reg_req => { in => [ "gp", "gp", "none" ] }, reg_req => { in => [ "gp", "gp", "none" ] },
emit => 'movl %S1, (%S0)', emit => 'store %S0 -> (%S1)',
}, },
# Floating Point operations # Floating Point operations
...@@ -233,33 +233,33 @@ Store => { ...@@ -233,33 +233,33 @@ Store => {
fAdd => { fAdd => {
irn_flags => [ "rematerializable" ], irn_flags => [ "rematerializable" ],
reg_req => { in => [ "fp", "fp" ], out => [ "fp" ] }, reg_req => { in => [ "fp", "fp" ], out => [ "fp" ] },
emit => 'fadd %S0, %S1, %D0', emit => '%D0 = fadd %S0, %S1',
mode => $mode_fp, mode => $mode_fp,
}, },
fMul => { fMul => {
reg_req => { in => [ "fp", "fp" ], out => [ "fp" ] }, reg_req => { in => [ "fp", "fp" ], out => [ "fp" ] },
emit =>'fmul %S0, %S1, %D0', emit => '%D0 = fmul %S0, %S1',
mode => $mode_fp, mode => $mode_fp,
}, },
fSub => { fSub => {
irn_flags => [ "rematerializable" ], irn_flags => [ "rematerializable" ],
reg_req => { in => [ "fp", "fp" ], out => [ "fp" ] }, reg_req => { in => [ "fp", "fp" ], out => [ "fp" ] },
emit => 'fsub %S0, %S1, %D0', emit => '%D0 = fsub %S0, %S1',
mode => $mode_fp, mode => $mode_fp,
}, },
fDiv => { fDiv => {
reg_req => { in => [ "fp", "fp" ], out => [ "fp" ] }, reg_req => { in => [ "fp", "fp" ], out => [ "fp" ] },
emit => 'fdiv %S0, %S1, %D0', emit => '%D0 = fdiv %S0, %S1',
mode => $mode_fp, mode => $mode_fp,
}, },
fMinus => { fMinus => {
irn_flags => [ "rematerializable" ], irn_flags => [ "rematerializable" ],
reg_req => { in => [ "fp" ], out => [ "fp" ] }, reg_req => { in => [ "fp" ], out => [ "fp" ] },
emit => 'fneg %S0, %D0', emit => '%D0 = fneg %S0',
mode => $mode_fp, mode => $mode_fp,
}, },
...@@ -267,7 +267,7 @@ fConst => { ...@@ -267,7 +267,7 @@ fConst => {
op_flags => [ "constlike" ], op_flags => [ "constlike" ],
irn_flags => [ "rematerializable" ], irn_flags => [ "rematerializable" ],
reg_req => { out => [ "fp" ] }, reg_req => { out => [ "fp" ] },
emit => 'fmov %I, %D0', emit => '%D0 = fconst %I',
mode => $mode_fp, mode => $mode_fp,
}, },
...@@ -278,7 +278,7 @@ fLoad => { ...@@ -278,7 +278,7 @@ fLoad => {
irn_flags => [ "rematerializable" ], irn_flags => [ "rematerializable" ],
state => "exc_pinned", state => "exc_pinned",
reg_req => { in => [ "gp", "none" ], out => [ "fp" ] }, reg_req => { in => [ "gp", "none" ], out => [ "fp" ] },
emit => 'fmov (%S0), %D0', emit => '%D0 = fload (%S0)',
}, },
fStore => { fStore => {
...@@ -286,7 +286,7 @@ fStore => { ...@@ -286,7 +286,7 @@ fStore => {
irn_flags => [ "rematerializable" ], irn_flags => [ "rematerializable" ],
state => "exc_pinned", state => "exc_pinned",
reg_req => { in => [ "gp", "fp", "none" ] }, reg_req => { in => [ "gp", "fp", "none" ] },
emit => 'fmov %S1, (%S0)', emit => 'fstore %S0 -> (%S1)',
}, },
); );
Supports Markdown
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