SLLI $64, X5, X6 // ERROR "immediate out of range 0 to 63"
SRLI $64, X5, X6 // ERROR "immediate out of range 0 to 63"
SRAI $64, X5, X6 // ERROR "immediate out of range 0 to 63"
+ BEQ X5, X6, $1 // ERROR "instruction with branch-like opcode lacks destination"
+ BEQ X5, X6, 31(X10) // ERROR "instruction with branch-like opcode lacks destination"
RORI $-1, X5, X6 // ERROR "immediate out of range 0 to 63"
SLLI $-1, X5, X6 // ERROR "immediate out of range 0 to 63"
SRLI $-1, X5, X6 // ERROR "immediate out of range 0 to 63"
switch p.As {
case ABEQ, ABEQZ, ABGE, ABGEU, ABGEZ, ABGT, ABGTU, ABGTZ, ABLE, ABLEU, ABLEZ, ABLT, ABLTU, ABLTZ, ABNE, ABNEZ:
if p.To.Type != obj.TYPE_BRANCH {
- panic("assemble: instruction with branch-like opcode lacks destination")
+ ctxt.Diag("%v: instruction with branch-like opcode lacks destination", p)
+ break
}
offset := p.To.Target().Pc - p.Pc
if offset < -4096 || 4096 <= offset {
case obj.TYPE_BRANCH:
p.To.Type, p.To.Offset = obj.TYPE_CONST, p.To.Target().Pc-p.Pc
case obj.TYPE_MEM:
- panic("unhandled type")
+ if ctxt.Errors == 0 {
+ // An error should have already been reported for this instruction
+ panic("unhandled type")
+ }
}
case AJAL: