On 6l and 8l, this is a real instruction, guaranteed to
cause an 'undefined instruction' exception.
On 5l, we simulate it as BL to address 0.
The plan is to use it as a signal to the linker that this
point in the instruction stream cannot be reached
(hence the changes to nofollow). This will help the
compiler explain that panicindex and friends do not
return without having to put a list of these functions
in the linker.
R=ken2
CC=golang-dev
https://golang.org/cl/
6255064
"MRC", LTYPEJ, 1,
"PLD", LTYPEPLD, APLD,
+ "UNDEF", LTYPEE, AUNDEF,
0
};
ASTREXD,
APLD,
+
+ AUNDEF,
ALAST,
};
o1 |= (-p->from.offset) & 0xfff;
} else
o1 |= p->from.offset & 0xfff;
+ case 96: /* UNDEF */
+ // This is supposed to be something that stops execution.
+ // It's not supposed to be reached, ever, but if it is, we'd
+ // like to be able to tell how we got there. Assemble as
+ // BL $0
+ v = (0 - pc) - 8;
+ o1 = opbra(ABL, C_SCOND_NONE);
+ o1 |= (v >> 2) & 0xffffff;
+ break;
}
out[0] = o1;
{ ASTREXD, C_SOREG,C_REG, C_REG, 92, 4, 0 },
{ APLD, C_SOREG,C_NONE, C_NONE, 95, 4, 0 },
+
+ { AUNDEF, C_NONE, C_NONE, C_NONE, 96, 4, 0 },
{ AXXX, C_NONE, C_NONE, C_NONE, 0, 4, 0 },
};
i--;
continue;
}
- if(a == AB || (a == ARET && q->scond == 14) || a == ARFE)
+ if(a == AB || (a == ARET && q->scond == 14) || a == ARFE || a == AUNDEF)
goto copy;
if(q->cond == P || (q->cond->mark&FOLL))
continue;
}
(*last)->link = r;
*last = r;
- if(a == AB || (a == ARET && q->scond == 14) || a == ARFE)
+ if(a == AB || (a == ARET && q->scond == 14) || a == ARFE || a == AUNDEF)
return;
r->as = ABNE;
if(a == ABNE)
p->mark |= FOLL;
(*last)->link = p;
*last = p;
- if(a == AB || (a == ARET && p->scond == 14) || a == ARFE){
+ if(a == AB || (a == ARET && p->scond == 14) || a == ARFE || a == AUNDEF){
return;
}
if(p->cond != P)
case ASTREXD:
case ATST:
case APLD:
+ case AUNDEF:
break;
}
}
"PREFETCHT1", LTYPE2, APREFETCHT1,
"PREFETCHT2", LTYPE2, APREFETCHT2,
"PREFETCHNTA", LTYPE2, APREFETCHNTA,
+ "UNDEF", LTYPE0, AUNDEF,
0
};
AMOVQL,
ABSWAPL,
ABSWAPQ,
+
+ AUNDEF,
ALAST
};
{ AMOVQL, yrl_ml, Px, 0x89 },
+ { AUNDEF, ynone, Px, 0x0f, 0x0b },
+
{ AEND },
0
};
case ARETFL:
case ARETFQ:
case ARETFW:
+ case AUNDEF:
return 1;
}
return 0;
"PREFETCHT1", LTYPE2, APREFETCHT1,
"PREFETCHT2", LTYPE2, APREFETCHT2,
"PREFETCHNTA", LTYPE2, APREFETCHNTA,
+ "UNDEF", LTYPE0, AUNDEF,
0
};
APREFETCHNTA,
ABSWAPL,
+
+ AUNDEF,
ALAST
};
{ APREFETCHNTA, yprefetch, Pm, 0x18,(00) },
{ ABSWAPL, ybswap, Pm, 0xc8 },
+
+ { AUNDEF, ynone, Px, 0x0f, 0x0b },
0
};
case ARET:
case AIRETL:
case AIRETW:
+ case AUNDEF:
return 1;
}
return 0;