3 # This is a template specification for the Firm-Backend
5 # the cpu architecture (ia32, ia64, mips, sparc, ppc32, ...)
12 # 1 - caller save (register must be saved by the caller of a function)
13 # 2 - callee save (register must be saved by the called function)
14 # 4 - ignore (do not assign this register)
15 # NOTE: Last entry of each class is the largest Firm-Mode a register can hold
18 { "name" => "r0", "type" => 1 },
19 { "name" => "r2", "type" => 1 },
20 { "name" => "r3", "type" => 1 },
21 { "name" => "r4", "type" => 1 },
22 { "name" => "r5", "type" => 1 },
23 { "name" => "r6", "type" => 1 },
24 { "name" => "r7", "type" => 1 },
25 { "name" => "r8", "type" => 1 },
26 { "name" => "r9", "type" => 1 },
27 { "name" => "r10", "type" => 1 },
28 # { "name" => "r11", "type" => 1 },
29 # { "name" => "r12", "type" => 1 },
30 { "name" => "r13", "type" => 2 },
31 { "name" => "r14", "type" => 2 },
32 { "name" => "r15", "type" => 2 },
33 # { "name" => "r16", "type" => 2 },
34 # { "name" => "r17", "type" => 2 },
35 # { "name" => "r18", "type" => 2 },
36 # { "name" => "r19", "type" => 2 },
37 # { "name" => "r20", "type" => 2 },
38 # { "name" => "r21", "type" => 2 },
39 # { "name" => "r22", "type" => 2 },
40 # { "name" => "r23", "type" => 2 },
41 # { "name" => "r24", "type" => 2 },
42 # { "name" => "r25", "type" => 2 },
43 # { "name" => "r26", "type" => 2 },
44 # { "name" => "r27", "type" => 2 },
45 # { "name" => "r28", "type" => 2 },
46 # { "name" => "r29", "type" => 2 },
47 # { "name" => "r30", "type" => 2 },
48 { "name" => "r31", "type" => 2 },
49 { "name" => "r1", "type" => 6 }, # this is our stackpointer
50 { "mode" => "mode_P" }
53 # { "name" => "f0", "type" => 1 }, # => reserved for FP Perm
54 { "name" => "f1", "type" => 1 },
55 { "name" => "f2", "type" => 1 },
56 { "name" => "f3", "type" => 1 },
57 { "name" => "f4", "type" => 1 },
58 { "name" => "f5", "type" => 1 },
59 { "name" => "f6", "type" => 1 },
60 { "name" => "f7", "type" => 1 },
61 { "name" => "f8", "type" => 1 },
62 { "name" => "f9", "type" => 1 },
63 { "name" => "f10", "type" => 1 },
64 { "name" => "f11", "type" => 1 },
65 { "name" => "f12", "type" => 1 },
66 { "name" => "f13", "type" => 1 },
67 { "name" => "f14", "type" => 2 },
68 { "name" => "f15", "type" => 2 },
69 { "name" => "f16", "type" => 2 },
70 # { "name" => "f17", "type" => 2 },
71 # { "name" => "f18", "type" => 2 },
72 # { "name" => "f19", "type" => 2 },
73 # { "name" => "f20", "type" => 2 },
74 # { "name" => "f21", "type" => 2 },
75 # { "name" => "f22", "type" => 2 },
76 # { "name" => "f23", "type" => 2 },
77 # { "name" => "f24", "type" => 2 },
78 # { "name" => "f25", "type" => 2 },
79 # { "name" => "f26", "type" => 2 },
80 # { "name" => "f27", "type" => 2 },
81 # { "name" => "f28", "type" => 2 },
82 # { "name" => "f29", "type" => 2 },
83 # { "name" => "f30", "type" => 2 },
84 # { "name" => "f31", "type" => 2 },
85 { "mode" => "mode_D" }
88 { "name" => "cr0", "type" => 1 },
89 { "name" => "cr1", "type" => 1 },
90 { "name" => "cr2", "type" => 2 },
91 { "name" => "cr3", "type" => 2 },
92 { "name" => "cr4", "type" => 2 },
93 { "name" => "cr5", "type" => 1 },
94 { "name" => "cr6", "type" => 1 },
95 # { "name" => "cr7", "type" => 1 }, # => reserved for Condition Perm
96 { "mode" => "mode_P" } # real mode is 4 bit, but doesn't matter ...
99 { "name" => "lr", "type" => 4 }, # 3
100 { "mode" => "mode_P" }
103 { "name" => "ctr", "type" => 1 },
104 { "mode" => "mode_P" }
109 S0 => "${arch}_emit_source_register(node, 0);",
110 S1 => "${arch}_emit_source_register(node, 1);",
111 S2 => "${arch}_emit_source_register(node, 2);",
112 D0 => "${arch}_emit_dest_register(node, 0);",
113 D1 => "${arch}_emit_dest_register(node, 1);",
114 D2 => "${arch}_emit_dest_register(node, 2);",
115 O => "${arch}_emit_offset(node);",
116 C => "${arch}_emit_immediate(node);",
117 RLWIMI => "${arch}_emit_rlwimi_helper(node);",
120 $default_cmp_attr = "NULL";
122 #--------------------------------------------------#
125 # _ __ _____ __ _ _ __ ___ _ __ ___ #
126 # | '_ \ / _ \ \ /\ / / | | '__| / _ \| '_ \/ __| #
127 # | | | | __/\ V V / | | | | (_) | |_) \__ \ #
128 # |_| |_|\___| \_/\_/ |_|_| \___/| .__/|___/ #
131 #--------------------------------------------------#
135 #-----------------------------------------------------------------#
138 # _ _ __ | |_ ___ __ _ ___ _ __ _ __ ___ __| | ___ ___ #
139 # | | '_ \| __/ _ \/ _` |/ _ \ '__| | '_ \ / _ \ / _` |/ _ \/ __| #
140 # | | | | | || __/ (_| | __/ | | | | | (_) | (_| | __/\__ \ #
141 # |_|_| |_|\__\___|\__, |\___|_| |_| |_|\___/ \__,_|\___||___/ #
144 #-----------------------------------------------------------------#
146 # commutative operations
151 "comment" => "construct Add: Add(a, b) = Add(b, a) = a + b",
152 "reg_req" => { "in" => [ "gp", "gp" ], "out" => [ "gp" ] },
153 "emit" => '. add %D0, %S0, %S1',
158 "comment" => "construct Add: Addi(a, const) = Addi(const, a) = a + const",
159 "reg_req" => { "in" => [ "!r0" ], "out" => [ "gp" ] },
160 # "reg_req" => { "in" => [ "gp" ], "out" => [ "gp" ] },
161 "emit" => '. addi %D0, %S0, %C',
164 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
172 "comment" => "construct Mul: Mullw(a, b) = Mullw(b, a) = lo32(a * b)",
173 "reg_req" => { "in" => [ "gp", "gp" ], "out" => [ "gp" ] },
174 "emit" => '. mullw %D0, %S0, %S1',
180 "comment" => "construct Mul: Mulhw(a, b) = Mulhw(b, a) = hi32(a * b)",
181 "reg_req" => { "in" => [ "gp", "gp" ], "out" => [ "gp" ] },
182 "emit" => '. mulhw %D0, %S0, %S1',
188 "comment" => "construct Mul: Mulhwu(a, b) = Mulhwu(b, a) = hi32(a * b)",
189 "reg_req" => { "in" => [ "gp", "gp" ], "out" => [ "gp" ] },
190 "emit" => '. mulhwu %D0, %S0, %S1',
194 # "irn_flags" => "R",
195 # "comment" => "construct Mul: Mul(a, const) = Mul(const, a) = a * const",
196 # "reg_req" => { "in" => [ "gp" ], "out" => [ "gp" ] },
197 # "emit" => '. mul %S0, %C, %D0',
203 "comment" => "construct And: And(a, b) = And(b, a) = a AND b",
204 "reg_req" => { "in" => [ "gp", "gp" ], "out" => [ "gp" ] },
205 "emit" => '. and %D0, %S0, %S1',
209 # "irn_flags" => "R",
210 # "comment" => "construct And: And(a, const) = And(const, a) = a AND const",
211 # "reg_req" => { "in" => [ "gp" ], "out" => [ "gp" ] },
212 # "emit" => '. and %S0, %C, %D0',
218 "comment" => "construct Or: Or(a, b) = Or(b, a) = a OR b",
219 "reg_req" => { "in" => [ "gp", "gp" ], "out" => [ "gp" ] },
220 "emit" => '. or %D0, %S0, %S1',
225 # "irn_flags" => "R",
226 # "comment" => "construct Or: Or(a, const) = Or(const, a) = a OR const",
227 # "reg_req" => { "in" => [ "gp" ], "out" => [ "gp" ] },
228 # "emit" => '. or %S0, %C, %D0',
234 "comment" => "construct Xor: Xor(a, b) = Xor(b, a) = a XOR b",
235 "reg_req" => { "in" => [ "gp", "gp" ], "out" => [ "gp" ] },
236 "emit" => '. xor %D0, %S0, %S1',
240 # "irn_flags" => "R",
241 # "comment" => "construct Xor: Xor(a, const) = Xor(const, a) = a EOR const",
242 # "reg_req" => { "in" => [ "gp" ], "out" => [ "gp" ] },
243 # "emit" => '. xor %S0, %C, %D0',
246 # not commutative operations
250 "comment" => "construct Sub: Sub(a, b) = a - b",
251 "reg_req" => { "in" => [ "gp", "gp" ], "out" => [ "gp" ] },
252 "emit" => '. sub %D0, %S0, %S1',
256 # "irn_flags" => "R",
257 # "comment" => "construct Sub: Sub(a, const) = a - const",
258 # "reg_req" => { "in" => [ "gp" ], "out" => [ "gp" ] },
259 # "emit" => '. subl %S0, %C, %D0',
264 "comment" => "construct Shl: Shl(a, b) = a << b",
265 "reg_req" => { "in" => [ "gp", "gp" ], "out" => [ "gp" ] },
266 "emit" => '. slw %D0, %S0, %S1',
270 # "irn_flags" => "R",
271 # "comment" => "construct Shl: Shl(a, const) = a << const",
272 # "reg_req" => { "in" => [ "gp" ], "out" => [ "gp" ] },
273 # "emit" => '. shl %S0, %C, %D0',
278 "comment" => "construct Shr: Srw(a, b): c = a >> b",
279 "reg_req" => { "in" => [ "gp", "gp" ], "out" => [ "gp" ] },
280 "emit" => '. srw %D0, %S0, %S1',
284 # "irn_flags" => "R",
285 # "comment" => "construct Shr: Shr(a, const) = a >> const",
286 # "reg_req" => { "in" => [ "gp" ], "out" => [ "gp" ] },
287 # "emit" => '. shr %S0, %C, %D0',
292 "comment" => "construct Shrs: Sraw(a, b): c = a >> b",
293 "reg_req" => { "in" => [ "gp", "gp" ], "out" => [ "gp" ] },
294 "emit" => '. sraw %D0, %S0, %S1',
299 "comment" => "construct Shrs: Srawi(a, const): c = a >> const",
300 "reg_req" => { "in" => [ "gp" ], "out" => [ "gp" ] },
301 "emit" => '. sraw %D0, %S0, %C',
304 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
311 "comment" => "construct ???: Rlwnm(a, b): c = a ROTL b",
312 "reg_req" => { "in" => [ "gp", "gp" ], "out" => [ "gp" ] },
313 "emit" => '. rlwnm %D0, %S0, %S1',
318 "comment" => "construct ???: Rlwinm(a, b_const, c_const, d_const): (m = MASK(c, d)) e = (a ROTL b) & m",
319 "reg_req" => { "in" => [ "gp" ], "out" => [ "gp" ] },
320 "emit" => '. rlwinm %D0, %S0, %RLWIMI',
323 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
330 "comment" => "construct Minus: Neg(a) = -a",
331 "reg_req" => { "in" => [ "gp" ], "out" => [ "gp" ] },
332 "emit" => '. neg %D0, %S0',
337 "comment" => "construct Not: Not(a) = !a",
338 "reg_req" => { "in" => [ "gp" ], "out" => [ "gp" ] },
339 "emit" => '. nor %D0, %S0, %S0',
344 "comment" => "construct Sign extension of byte: Extsb(char a) = (int) a",
345 "reg_req" => { "in" => [ "gp" ], "out" => [ "gp" ] },
346 "emit" => '. extsb %D0, %S0',
351 "comment" => "construct Sign extension of halfword: Extsh(char a) = (short) a",
352 "reg_req" => { "in" => [ "gp" ], "out" => [ "gp" ] },
353 "emit" => '. extsh %D0, %S0',
358 "comment" => "construct Div (signed): Div(a, b) = a div b",
359 "reg_req" => { "in" => [ "gp", "gp" ], "out" => [ "gp" ] },
360 "emit" => '. divw %D0, %S0, %S1',
365 "comment" => "construct Div (unsigned): Div(a, b) = a div b",
366 "reg_req" => { "in" => [ "gp", "gp" ], "out" => [ "gp" ] },
367 "emit" => '. divwu %D0, %S0, %S1',
372 "comment" => "construct Mtctr: Ctr = a",
373 "reg_req" => { "in" => [ "gp" ], "out" => [ "count" ] },
374 "emit" => '. mtctr %S0',
383 "comment" => "Const (high-level node)",
384 "reg_req" => { "out" => [ "gp" ] },
387 return attr_a->data.constant_tarval != attr_b->data.constant_tarval;
394 "comment" => "float Const (high-level node)",
395 "reg_req" => { "out" => [ "fp" ] },
398 return attr_a->data.constant_tarval != attr_b->data.constant_tarval;
405 "comment" => "SymConst (high-level node)",
406 "reg_req" => { "out" => [ "gp" ] },
409 return attr_a->data.constant_tarval != attr_b->data.constant_tarval;
416 "comment" => "construct unknown register",
417 "reg_req" => { "out" => [ "gp" ] },
418 "emit" => '. \t\t /* use %D0 as uninitialized value */',
428 "comment" => "construct unknown float register",
429 "reg_req" => { "out" => [ "fp" ] },
430 "emit" => '. \t\t /* use %D0 as uninitialized value */',
440 "comment" => "construct unknown condition register",
441 "reg_req" => { "out" => [ "condition" ] },
442 "emit" => '. \t\t /* use %D0 as uninitialized value */',
452 "comment" => "load constant (16bit with sign extension)",
453 "reg_req" => { "out" => [ "gp" ] },
454 "emit" => '. addi %D0, 0, %C',
457 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
462 "op_flags" => "L|X|Y",
463 "comment" => "branch somewhere",
464 "reg_req" => { "in" => [ "condition" ], "out" => [ "none", "none" ] },
467 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
473 "comment" => "construct LoopCopy(src, dest, count, mem): Copy count words from src to dest",
474 "reg_req" => { "in" => [ "gp", "gp", "count", "none" ], "out" => [ "none", "in_r1", "in_r2", "in_r3", "gp" ] },
478 "op_flags" => "L|X|Y",
479 "comment" => "construct Switch(selector): Jump to whatever",
480 "reg_req" => { "in" => [ "gp", "gp", "condition" ], "out" => [ "none" ] },
483 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
490 "comment" => "load the constant to higher 16 bit of register",
491 "reg_req" => { "out" => [ "gp" ] },
492 "emit" => '. addis %D0, 0, %C',
493 "attr" => "ppc32_attr_offset_mode om, tarval *tv, ident *id",
496 attr->offset_mode = om;
498 attr->content_type = ppc32_ac_Const;
499 attr->data.constant_tarval = tv;
502 attr->content_type = ppc32_ac_SymConst;
503 attr->data.symconst_ident = id;
508 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
514 "comment" => "ors constant with register",
515 "reg_req" => { "in" => [ "gp"], "out" => [ "gp" ] },
516 "emit" => '. ori %D0, %S0, %C',
519 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
525 "comment" => "ands constant with register with cr0 update",
526 "reg_req" => { "in" => [ "gp"], "out" => [ "gp", "cr0" ] },
527 "emit" => '. andi. %D0, %S0,%C',
530 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
536 "comment" => "construct Cmp: Cmp(a, b) = Flags in crX",
537 "reg_req" => { "in" => [ "gp", "gp" ], "out" => [ "condition" ] },
538 "emit" => '. cmp %D0, 0, %S0, %S1',
543 "comment" => "construct Cmp immediate: Cmpi(a, const) = Flags in crX",
544 "reg_req" => { "in" => [ "gp" ], "out" => [ "condition" ] },
545 "emit" => '. cmpi %D0, 0, %S0, %C',
548 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
555 "comment" => "construct Cmp logical: Cmpl(a, b) = Flags in crX",
556 "reg_req" => { "in" => [ "gp", "gp" ], "out" => [ "condition" ] },
557 "emit" => '. cmpl %D0, 0, %S0, %S1',
562 "comment" => "construct Cmp logical immediate: Cmpli(a, const) = Flags in crX",
563 "reg_req" => { "in" => [ "gp" ], "out" => [ "condition" ] },
564 "emit" => '. cmpli %D0, 0, %S0, %C',
567 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
577 "state" => "exc_pinned",
578 "comment" => "construct Load (byte unsigned): Load(ptr, mem) = LD ptr -> reg",
579 "reg_req" => { "in" => [ "!r0", "none" ], "out" => [ "gp", "none" ] },
580 "emit" => '. lbz %D0, %O(%S0)',
583 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
585 "outs" => [ "res", "M" ],
591 "state" => "exc_pinned",
592 "comment" => "construct Load (halfword unsigned): Load(ptr, mem) = LD ptr -> reg",
593 "reg_req" => { "in" => [ "!r0", "none" ], "out" => [ "gp", "none" ] },
594 "emit" => '. lhz %D0, %O(%S0)',
597 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
599 "outs" => [ "res", "M" ],
605 "state" => "exc_pinned",
606 "comment" => "construct Load (halfword signed): Load(ptr, mem) = LD ptr -> reg",
607 "reg_req" => { "in" => [ "!r0", "none" ], "out" => [ "gp", "none" ] },
608 "emit" => '. lha %D0, %O(%S0)',
611 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
613 "outs" => [ "res", "M" ],
619 "state" => "exc_pinned",
620 "comment" => "construct Load (word): Load(ptr, mem) = LD ptr -> reg",
621 "reg_req" => { "in" => [ "!r0", "none" ], "out" => [ "gp", "none" ] },
622 "emit" => '. lwz %D0, %O(%S0)',
625 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
627 "outs" => [ "res", "M" ],
633 "state" => "exc_pinned",
634 "comment" => "construct Load with update (word): Load(ptr, mem) = LD ptr -> reg",
635 "reg_req" => { "in" => [ "!r0", "none" ], "out" => [ "gp", "in_r1", "none"] },
636 "emit" => '. lwzu %D0, %O(%S0)',
639 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
641 "outs" => [ "res", "ptr", "M" ],
646 "state" => "exc_pinned",
647 "comment" => "construct Store: Store (byte) (ptr, val, mem) = ST ptr,val",
648 "reg_req" => { "in" => [ "!r0", "gp", "none" ], "out" => [ "none" ] },
649 "emit" => '. stb %S1, %O(%S0)',
652 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
659 "state" => "exc_pinned",
660 "comment" => "construct Store: Store (halfword) (ptr, val, mem) = ST ptr,val",
661 "reg_req" => { "in" => [ "!r0", "gp", "none" ], "out" => [ "none" ] },
662 "emit" => '. sth %S1, %O(%S0)',
665 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
672 "state" => "exc_pinned",
673 "comment" => "construct Store: Store (word) (ptr, val, mem) = ST ptr,val",
674 "reg_req" => { "in" => [ "!r0", "gp", "none" ], "out" => [ "none" ] },
675 "emit" => '. stw %S1, %O(%S0)',
678 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
683 #--------------------------------------------------------#
686 # | |_| | ___ __ _| |_ _ __ ___ __| | ___ ___ #
687 # | _| |/ _ \ / _` | __| | '_ \ / _ \ / _` |/ _ \/ __| #
688 # | | | | (_) | (_| | |_ | | | | (_) | (_| | __/\__ \ #
689 # |_| |_|\___/ \__,_|\__| |_| |_|\___/ \__,_|\___||___/ #
690 #--------------------------------------------------------#
692 # commutative operations
697 "comment" => "construct FP Add: Add(a, b) = Add(b, a) = a + b",
698 "reg_req" => { "in" => [ "fp", "fp" ], "out" => [ "fp" ] },
699 "emit" => '. fadd %D0, %S0, %S1',
705 "comment" => "construct FP Add (single): Add(a, b) = Add(b, a) = a + b",
706 "reg_req" => { "in" => [ "fp", "fp" ], "out" => [ "fp" ] },
707 "emit" => '. fadds %D0, %S0, %S1',
712 "comment" => "construct FP Mul: Mul(a, b) = Mul(b, a) = a * b",
713 "reg_req" => { "in" => [ "fp", "fp" ], "out" => [ "fp" ] },
714 "emit" => '. fmul %D0, %S0, %S1',
719 "comment" => "construct FP Mul (single): Mul(a, b) = Mul(b, a) = a * b",
720 "reg_req" => { "in" => [ "fp", "fp" ], "out" => [ "fp" ] },
721 "emit" => '. fmuls %D0, %S0, %S1',
725 "comment" => "construct FP Negation: fNeg(a) = -a",
726 "reg_req" => { "in" => [ "fp" ], "out" => [ "fp" ] },
727 "emit" => '. fneg %D0, %S0',
734 "comment" => "construct FP Max: Max(a, b) = Max(b, a) = a > b ? a : b",
735 "reg_req" => { "in" => [ "fp", "fp" ], "out" => [ "fp" ] },
736 "emit" => '. fmax %S0, %S1, %D0',
742 "comment" => "construct FP Min: Min(a, b) = Min(b, a) = a < b ? a : b",
743 "reg_req" => { "in" => [ "fp", "fp" ], "out" => [ "fp" ] },
744 "emit" => '. fmin %S0, %S1, %D0',
747 # not commutative operations
751 "comment" => "construct FP Sub: Sub(a, b) = a - b",
752 "reg_req" => { "in" => [ "fp", "fp" ], "out" => [ "fp" ] },
753 "emit" => '. fsub %D0, %S0, %S1',
758 "comment" => "construct FP Sub (single): Sub(a, b) = a - b",
759 "reg_req" => { "in" => [ "fp", "fp" ], "out" => [ "fp" ] },
760 "emit" => '. fsubs %D0, %S0, %S1',
764 "comment" => "construct FP Div: Div(a, b) = a / b",
765 "reg_req" => { "in" => [ "fp", "fp" ], "out" => [ "fp" ] },
766 "emit" => '. fdiv %D0, %S0, %S1',
770 "comment" => "construct FP Div (single): Div(a, b) = a / b",
771 "reg_req" => { "in" => [ "fp", "fp" ], "out" => [ "fp" ] },
772 "emit" => '. fdivs %D0, %S0, %S1',
777 "comment" => "construct FP Minus: fMinus(a) = -a",
778 "reg_req" => { "in" => [ "fp" ], "out" => [ "fp" ] },
779 "emit" => '. fneg %D0, %S0',
784 "comment" => "construct FP Convert to integer word: fCtiw(a) = (int) a",
785 "reg_req" => { "in" => [ "fp" ], "out" => [ "fp" ] },
786 "emit" => '. fctiw %D0, %S0',
791 "comment" => "construct FP Round to single: fRsp(a) = (float) a",
792 "reg_req" => { "in" => [ "fp" ], "out" => [ "fp" ] },
793 "emit" => '. frsp %D0, %S0',
798 "comment" => "construct FP Abs: fAbs(a) = |a|",
799 "reg_req" => { "in" => [ "fp" ], "out" => [ "fp" ] },
800 "emit" => '. fabs %D0, %S0',
805 "comment" => "construct FP Cmp unordered: fCmpu(a, b) = a ? b",
806 "reg_req" => { "in" => [ "fp", "fp" ], "out" => [ "condition" ] },
807 "emit" => '. fcmpu %D0, %S0, %S1',
814 # "irn_flags" => "R",
815 # "comment" => "represents a FP constant",
816 # "reg_req" => { "out" => [ "fp" ] },
817 # "emit" => '. fmov %C, %D0',
820 # /* TODO: compare fConst attributes */
828 "comment" => "construct unknown floating point register",
829 "reg_req" => { "out" => [ "fp" ] },
830 "emit" => '. \t\t /* use %D0 as uninitialized value */',
842 "state" => "exc_pinned",
843 "comment" => "construct FP Load (double): Load(ptr, mem) = LD ptr",
844 "reg_req" => { "in" => [ "!r0", "none" ], "out" => [ "fp", "none" ] },
845 "emit" => '. lfd %D0, %O(%S0)',
848 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
850 "outs" => [ "res", "M" ],
856 "state" => "exc_pinned",
857 "comment" => "construct FP Load (single): Load(ptr, mem) = LD ptr",
858 "reg_req" => { "in" => [ "!r0", "none" ], "out" => [ "fp","none" ] },
859 "emit" => '. lfs %D0, %O(%S0)',
862 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
864 "outs" => [ "res", "M" ],
869 "state" => "exc_pinned",
870 "comment" => "construct Store (double): Store(ptr, val, mem) = ST ptr,val",
871 "reg_req" => { "in" => [ "!r0", "fp", "none" ], "out" => [ "none" ] },
872 "emit" => '. stfd %S1, %O(%S0)',
875 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);
882 "state" => "exc_pinned",
883 "comment" => "construct Store (single): Store(ptr, val, mem) = ST ptr,val",
884 "reg_req" => { "in" => [ "!r0", "fp", "none" ], "out" => [ "none" ] },
885 "emit" => '. stfs %S1, %O(%S0)',
888 return (attr_a->data.constant_tarval != attr_b->data.constant_tarval);