From e6d64bab9dc7c71c80e82b7c41555a413f502399 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 4 Oct 2015 20:06:59 +0200 Subject: [PATCH] 8c: handle 64 bit mixedmode asop and type vlong <-> float/double type conversions --- sys/src/cmd/8c/machcap.c | 4 +++- sys/src/cmd/8c/txt.c | 8 +++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/src/cmd/8c/machcap.c b/sys/src/cmd/8c/machcap.c index 1734e9c32..db1cdcba6 100644 --- a/sys/src/cmd/8c/machcap.c +++ b/sys/src/cmd/8c/machcap.c @@ -18,7 +18,7 @@ machcap(Node *n) if(typev[n->type->etype]) { // if(typev[n->type->etype] && n->right->op == OCONST) { // if(hi64v(n->right) == 0) - return 1; + return !mixedasop(n->left->type, n->right->type); } break; @@ -58,6 +58,8 @@ machcap(Node *n) case OASADD: case OASSUB: + return !mixedasop(n->left->type, n->right->type); + case OASAND: case OASOR: case OASXOR: diff --git a/sys/src/cmd/8c/txt.c b/sys/src/cmd/8c/txt.c index 13f62539f..258d90f8e 100644 --- a/sys/src/cmd/8c/txt.c +++ b/sys/src/cmd/8c/txt.c @@ -621,20 +621,18 @@ gmove(Node *f, Node *t) a = AMOVWLZX; goto ld; case TINT: - case TUINT: case TLONG: - case TULONG: - case TIND: if(typefd[tt]) { gins(AFMOVL, f, &fregnode0); gmove(&fregnode0, t); return; } + case TUINT: + case TULONG: + case TIND: a = AMOVL; - ld: regalloc(&nod, f, t); - nod.type = types[TLONG]; gins(a, f, &nod); gmove(&nod, t); regfree(&nod);