~ubuntu-branches/ubuntu/trusty/golang/trusty

« back to all changes in this revision

Viewing changes to src/cmd/5c/reg.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
void
67
67
regopt(Prog *p)
68
68
{
69
 
        USED(p);
70
 
        // TODO(kaib): optimizer disabled because it smashes R8 when running out of registers
71
 
        // the disable is unconventionally here because the call is in common code shared by 5c/6c/8c
72
 
        return;
73
 
 
74
 
#ifdef  NOTDEF
75
69
        Reg *r, *r1, *r2;
76
70
        Prog *p1;
77
71
        int i, z;
191
185
                        break;
192
186
 
193
187
                /*
 
188
                 * right side read
 
189
                 */
 
190
                case APLD:
 
191
                        for(z=0; z<BITS; z++)
 
192
                                r->use2.b[z] |= bit.b[z];
 
193
                        break;
 
194
 
 
195
                /*
194
196
                 * funny
195
197
                 */
196
198
                case ABL:
492
494
                r1->link = freer;
493
495
                freer = firstr;
494
496
        }
495
 
#endif
496
497
}
497
498
 
498
499
void
1149
1150
 *      1       R1
1150
1151
 *      ...     ...
1151
1152
 *      10      R10
 
1153
 *      12  R12
1152
1154
 */
1153
1155
int32
1154
1156
RtoB(int r)
1155
1157
{
1156
1158
 
1157
 
        if(r < 2 || r >= REGTMP-2)      // excluded R9 and R10 for m and g
 
1159
        if(r < 2 || (r >= REGTMP-2 && r != 12)) // excluded R9 and R10 for m and g, but not R12
1158
1160
                return 0;
1159
1161
        return 1L << r;
1160
1162
}
1162
1164
int
1163
1165
BtoR(int32 b)
1164
1166
{
1165
 
        b &= 0x01fcL;   // excluded R9 and R10 for m and g
 
1167
        b &= 0x11fcL;   // excluded R9 and R10 for m and g, but not R12
1166
1168
        if(b == 0)
1167
1169
                return 0;
1168
1170
        return bitno(b);
1173
1175
 *      18      F2
1174
1176
 *      19      F3
1175
1177
 *      ...     ...
1176
 
 *      23      F7
 
1178
 *      31      F15
1177
1179
 */
1178
1180
int32
1179
1181
FtoB(int f)
1188
1190
BtoF(int32 b)
1189
1191
{
1190
1192
 
1191
 
        b &= 0xfc0000L;
 
1193
        b &= 0xfffc0000L;
1192
1194
        if(b == 0)
1193
1195
                return 0;
1194
1196
        return bitno(b) - 16;