shithub: mc

Download patch

ref: 7efe6165e6c644a51b50e91c897a9f19256db92d
parent: 39b3bd2971c8f1dff592b84ab0e95e4bc3c0b624
author: Ori Bernstein <[email protected]>
date: Sun Jun 17 20:09:48 EDT 2012

Check float modes in the instruction selector.

--- a/8/isel.c
+++ b/8/isel.c
@@ -85,10 +85,16 @@
 
 static Mode mode(Node *n)
 {
-    switch (size(n)) {
-        case 1: return ModeB; break;
-        case 2: return ModeS; break;
-        case 4: return ModeL; break;
+    switch (exprtype(n)->type) {
+        case Tyfloat32: return ModeF; break;
+        case Tyfloat64: return ModeD; break;
+        default:
+            switch (size(n)) {
+                case 1: return ModeB; break;
+                case 2: return ModeS; break;
+                case 4: return ModeL; break;
+            }
+            break;
     }
     dump(n, stdout);
     die("No mode for node");