2013-10-30 00:38:59 +08:00
|
|
|
# RUN: llvm-mc %s -triple=mipsel -show-encoding -mattr=micromips \
|
|
|
|
# RUN: | FileCheck %s -check-prefix=CHECK-EL
|
|
|
|
# RUN: llvm-mc %s -triple=mips -show-encoding -mattr=micromips \
|
|
|
|
# RUN: | FileCheck %s -check-prefix=CHECK-EB
|
|
|
|
# Check that the assembler can handle the documented syntax
|
|
|
|
# for jump and branch instructions.
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Jump instructions
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Little endian
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# CHECK-EL: j 1328 # encoding: [0x00,0xd4,0x98,0x02]
|
2019-01-09 23:58:02 +08:00
|
|
|
# CHECK-EL: nop # encoding: [0x00,0x0c]
|
2013-10-30 00:38:59 +08:00
|
|
|
# CHECK-EL: jal 1328 # encoding: [0x00,0xf4,0x98,0x02]
|
|
|
|
# CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00]
|
2014-03-20 18:18:24 +08:00
|
|
|
# CHECK-EL: jalr $ra, $6 # encoding: [0xe6,0x03,0x3c,0x0f]
|
2013-10-30 00:38:59 +08:00
|
|
|
# CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00]
|
|
|
|
# CHECK-EL: jr $7 # encoding: [0x07,0x00,0x3c,0x0f]
|
|
|
|
# CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00]
|
|
|
|
# CHECK-EL: jr $7 # encoding: [0x07,0x00,0x3c,0x0f]
|
|
|
|
# CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00]
|
2015-02-19 01:15:48 +08:00
|
|
|
# CHECK-EL: jalx 1328 # encoding: [0x00,0xf0,0x4c,0x01]
|
|
|
|
# CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00]
|
2014-09-12 21:43:41 +08:00
|
|
|
# CHECK-EL: jals 1328 # encoding: [0x00,0x74,0x98,0x02]
|
2014-11-29 21:29:24 +08:00
|
|
|
# CHECK-EL: nop # encoding: [0x00,0x0c]
|
2014-09-12 21:43:41 +08:00
|
|
|
# CHECK-EL: jalrs $ra, $6 # encoding: [0xe6,0x03,0x3c,0x4f]
|
2014-11-29 21:29:24 +08:00
|
|
|
# CHECK-EL: nop # encoding: [0x00,0x0c]
|
2015-01-30 19:18:50 +08:00
|
|
|
# CHECK-EL: jalr $25 # encoding: [0xd9,0x45]
|
|
|
|
# CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00]
|
|
|
|
# CHECK-EL: jalr $4, $25 # encoding: [0x99,0x00,0x3c,0x0f]
|
|
|
|
# CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00]
|
2013-10-30 00:38:59 +08:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Big endian
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# CHECK-EB: j 1328 # encoding: [0xd4,0x00,0x02,0x98]
|
2019-01-09 23:58:02 +08:00
|
|
|
# CHECK-EB: nop # encoding: [0x0c,0x00]
|
2013-10-30 00:38:59 +08:00
|
|
|
# CHECK-EB: jal 1328 # encoding: [0xf4,0x00,0x02,0x98]
|
|
|
|
# CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00]
|
2014-03-20 18:18:24 +08:00
|
|
|
# CHECK-EB: jalr $ra, $6 # encoding: [0x03,0xe6,0x0f,0x3c]
|
2013-10-30 00:38:59 +08:00
|
|
|
# CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00]
|
|
|
|
# CHECK-EB: jr $7 # encoding: [0x00,0x07,0x0f,0x3c]
|
|
|
|
# CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00]
|
|
|
|
# CHECK-EB: jr $7 # encoding: [0x00,0x07,0x0f,0x3c]
|
|
|
|
# CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00]
|
2015-02-19 01:15:48 +08:00
|
|
|
# CHECK-EB: jalx 1328 # encoding: [0xf0,0x00,0x01,0x4c]
|
|
|
|
# CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00]
|
2014-09-12 21:43:41 +08:00
|
|
|
# CHECK-EB: jals 1328 # encoding: [0x74,0x00,0x02,0x98]
|
2014-11-29 21:29:24 +08:00
|
|
|
# CHECK-EB: nop # encoding: [0x0c,0x00]
|
2014-09-12 21:43:41 +08:00
|
|
|
# CHECK-EB: jalrs $ra, $6 # encoding: [0x03,0xe6,0x4f,0x3c]
|
2014-11-29 21:29:24 +08:00
|
|
|
# CHECK-EB: nop # encoding: [0x0c,0x00]
|
2015-01-30 19:18:50 +08:00
|
|
|
# CHECK-EB: jalr $25 # encoding: [0x45,0xd9]
|
|
|
|
# CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00]
|
|
|
|
# CHECK-EB: jalr $4, $25 # encoding: [0x00,0x99,0x0f,0x3c]
|
|
|
|
# CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00]
|
2013-10-30 00:38:59 +08:00
|
|
|
|
|
|
|
j 1328
|
|
|
|
jal 1328
|
2014-03-20 18:18:24 +08:00
|
|
|
jalr $ra, $6
|
2013-10-30 00:38:59 +08:00
|
|
|
jr $7
|
|
|
|
j $7
|
2015-02-19 01:15:48 +08:00
|
|
|
jalx 1328
|
2014-09-12 21:43:41 +08:00
|
|
|
jals 1328
|
|
|
|
jalrs $ra, $6
|
2015-01-30 19:18:50 +08:00
|
|
|
jal $25
|
|
|
|
jal $4, $25
|