diff options
author | Stefan Kempf <stefan@cvs.openbsd.org> | 2007-11-24 13:38:07 +0000 |
---|---|---|
committer | Stefan Kempf <stefan@cvs.openbsd.org> | 2007-11-24 13:38:07 +0000 |
commit | 551eb58c749644a49e3496a392a53eff24ddb89d (patch) | |
tree | 1a9447202ddde7c687072a45611efd4c97102be2 /usr.bin | |
parent | 06a21e7447ce95e70751bcdd157937828f1f86aa (diff) |
Pull from master repo:
No need to sign-extend unsigned shorts loaded from memory.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/pcc/powerpc/table.c | 58 |
1 files changed, 47 insertions, 11 deletions
diff --git a/usr.bin/pcc/powerpc/table.c b/usr.bin/pcc/powerpc/table.c index 23e6fa1b488..37e0870db98 100644 --- a/usr.bin/pcc/powerpc/table.c +++ b/usr.bin/pcc/powerpc/table.c @@ -1,5 +1,5 @@ /*- - * $OpenBSD: table.c,v 1.7 2007/11/24 09:27:02 stefan Exp $ + * $OpenBSD: table.c,v 1.8 2007/11/24 13:38:06 stefan Exp $ * * Copyright (c) 2007 Gregory McGarry <g.mcgarry@ieee.org> * @@ -594,18 +594,33 @@ struct optab table[] = { /* assign memory to register */ { ASSIGN, FOREFF|INAREG, SAREG, TWORD|TPOINT, - SOREG, TSHORT|TUSHORT, + SOREG, TSHORT, NSPECIAL, RDEST, " lha AL,AR\n", }, /* assign memory to register */ { ASSIGN, FOREFF|INAREG, SAREG, TWORD|TPOINT, - SNAME, TSHORT|TUSHORT, + SOREG, TUSHORT, + NSPECIAL, RDEST, + " lhz AL,AR\n", }, + +/* assign memory to register */ +{ ASSIGN, FOREFF|INAREG, + SAREG, TWORD, + SNAME, TSHORT, NSPECIAL, RDEST, " lis AL," HA16(AR) "\n" " lha AL," LO16(AR) "(AL)\n", }, +/* assign memory to register */ +{ ASSIGN, FOREFF|INAREG, + SAREG, TWORD, + SNAME, TUSHORT, + NSPECIAL, RDEST, + " lis AL," HA16(AR) "\n" + " lhz AL," LO16(AR) "(AL)\n", }, + /* assign register to memory */ { ASSIGN, FOREFF|INAREG, SOREG, TWORD|TPOINT, @@ -804,9 +819,15 @@ struct optab table[] = { { UMUL, INAREG, SANY, TANY, - SOREG, TSHORT|TUSHORT, + SOREG, TSHORT, NAREG|NSPECIAL, RESC1, - " lha A1,AL" COM "(u)short load\n", }, + " lha A1,AL" COM "short load\n", }, + +{ UMUL, INAREG, + SANY, TANY, + SOREG, TUSHORT, + NAREG|NSPECIAL, RESC1, + " lhz A1,AL" COM "ushort load\n", }, { UMUL, INBREG, SANY, TANY, @@ -1065,21 +1086,36 @@ struct optab table[] = { " lis A1," HA16(AL) COM "load uchar from sname\n" " lbz A1," LO16(AL) "(A1)\n", }, -/* load (u)short from memory */ +/* load short from memory */ { OPLTYPE, INAREG, SANY, TANY, - SOREG, TSHORT|TUSHORT, + SOREG, TSHORT, NAREG, RESC1, - " lha A1,AL" COM "load (u)short from memory\n", }, + " lha A1,AL" COM "load short from memory\n", }, -/* load (u)short from memory */ +/* load ushort from memory */ { OPLTYPE, INAREG, SANY, TANY, - SNAME, TSHORT|TUSHORT, + SOREG, TUSHORT, + NAREG, RESC1, + " lhz A1,AL" COM "load ushort from memory\n", }, + +/* load short from memory */ +{ OPLTYPE, INAREG, + SANY, TANY, + SNAME, TSHORT, NAREG|NSPECIAL, RESC1, - " lis A1," HA16(AL) COM "load (u)short from sname\n" + " lis A1," HA16(AL) COM "load short from sname\n" " lha A1," LO16(AL) "(A1)\n", }, +/* load ushort from memory */ +{ OPLTYPE, INAREG, + SANY, TANY, + SNAME, TUSHORT, + NAREG|NSPECIAL, RESC1, + " lis A1," HA16(AL) COM "load ushort from sname\n" + " lhz A1," LO16(AL) "(A1)\n", }, + /* load from 16-bit constant */ { OPLTYPE, INAREG, SANY, TANY, |