• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llvm-mc %s -triple=mipsel -show-encoding -mcpu=mips32r2 -mattr=micromips | FileCheck -check-prefix=CHECK-EL %s
2# RUN: llvm-mc %s -triple=mips -show-encoding -mcpu=mips32r2 -mattr=micromips | FileCheck -check-prefix=CHECK-EB %s
3# Check that the assembler can handle the documented syntax
4# for shift instructions.
5#------------------------------------------------------------------------------
6# Shift Instructions
7#------------------------------------------------------------------------------
8# Little endian
9#------------------------------------------------------------------------------
10# CHECK-EL: sll    $4, $3, 7      # encoding: [0x83,0x00,0x00,0x38]
11# CHECK-EL: sllv   $2, $3, $5     # encoding: [0x65,0x00,0x10,0x10]
12# CHECK-EL: sra    $4, $3, 7      # encoding: [0x83,0x00,0x80,0x38]
13# CHECK-EL: srav   $2, $3, $5     # encoding: [0x65,0x00,0x90,0x10]
14# CHECK-EL: srl    $4, $3, 7      # encoding: [0x83,0x00,0x40,0x38]
15# CHECK-EL: srlv   $2, $3, $5     # encoding: [0x65,0x00,0x50,0x10]
16# CHECK-EL: rotr   $9, $6, 7      # encoding: [0x26,0x01,0xc0,0x38]
17# CHECK-EL: rotrv  $9, $6, $7     # encoding: [0xc7,0x00,0xd0,0x48]
18#------------------------------------------------------------------------------
19# Big endian
20#------------------------------------------------------------------------------
21# CHECK-EB: sll $4, $3, 7         # encoding: [0x00,0x83,0x38,0x00]
22# CHECK-EB: sllv  $2, $3, $5      # encoding: [0x00,0x65,0x10,0x10]
23# CHECK-EB: sra $4, $3, 7         # encoding: [0x00,0x83,0x38,0x80]
24# CHECK-EB: srav  $2, $3, $5      # encoding: [0x00,0x65,0x10,0x90]
25# CHECK-EB: srl $4, $3, 7         # encoding: [0x00,0x83,0x38,0x40]
26# CHECK-EB: srlv  $2, $3, $5      # encoding: [0x00,0x65,0x10,0x50]
27# CHECK-EB: rotr  $9, $6, 7       # encoding: [0x01,0x26,0x38,0xc0]
28# CHECK-EB: rotrv $9, $6, $7      # encoding: [0x00,0xc7,0x48,0xd0]
29     sll    $4, $3, 7
30     sllv   $2, $3, $5
31     sra    $4, $3, 7
32     srav   $2, $3, $5
33     srl    $4, $3, 7
34     srlv   $2, $3, $5
35     rotr   $9, $6, 7
36     rotrv  $9, $6, $7
37