• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llvm-mc %s -triple=mips64-unknown-freebsd -show-encoding 2>%t0 \
2# RUN:     | FileCheck %s
3# RUN: FileCheck -check-prefix=WARNING %s < %t0
4#
5# RUN: llvm-mc %s -triple=mips64-unknown-freebsd -show-encoding \
6# RUN:     -target-abi n32 2>%t1 | FileCheck %s
7# RUN: FileCheck -check-prefix=WARNING %s < %t1
8#
9# Check that the register names are mapped to their correct numbers for n32/n64
10# Second byte of addiu with $zero at rt contains the number of the source
11# register.
12
13.set noat
14daddiu	$zero, $zero, 0     # CHECK: encoding: [0x64,0x00,0x00,0x00]
15daddiu	$at, $zero, 0       # CHECK: encoding: [0x64,0x01,0x00,0x00]
16daddiu	$AT, $zero, 0       # CHECK: encoding: [0x64,0x01,0x00,0x00]
17daddiu	$v0, $zero, 0       # CHECK: encoding: [0x64,0x02,0x00,0x00]
18daddiu	$v1, $zero, 0       # CHECK: encoding: [0x64,0x03,0x00,0x00]
19daddiu	$a0, $zero, 0       # CHECK: encoding: [0x64,0x04,0x00,0x00]
20daddiu	$a1, $zero, 0       # CHECK: encoding: [0x64,0x05,0x00,0x00]
21daddiu	$a2, $zero, 0       # CHECK: encoding: [0x64,0x06,0x00,0x00]
22daddiu	$a3, $zero, 0       # CHECK: encoding: [0x64,0x07,0x00,0x00]
23daddiu	$a4, $zero, 0       # CHECK: encoding: [0x64,0x08,0x00,0x00]
24daddiu	$a5, $zero, 0       # CHECK: encoding: [0x64,0x09,0x00,0x00]
25daddiu	$a6, $zero, 0       # CHECK: encoding: [0x64,0x0a,0x00,0x00]
26daddiu	$a7, $zero, 0       # CHECK: encoding: [0x64,0x0b,0x00,0x00]
27daddiu	$t0, $zero, 0 # [*] # CHECK: encoding: [0x64,0x0c,0x00,0x00]
28daddiu	$t1, $zero, 0 # [*] # CHECK: encoding: [0x64,0x0d,0x00,0x00]
29daddiu	$t2, $zero, 0 # [*] # CHECK: encoding: [0x64,0x0e,0x00,0x00]
30daddiu	$t3, $zero, 0 # [*] # CHECK: encoding: [0x64,0x0f,0x00,0x00]
31# WARNING: mips64-register-names-n32-n64.s:[[@LINE+4]]:9: warning: register names $t4-$t7 are only available in O32.
32# WARNING-NEXT: daddiu  $t4, $zero, 0       # {{CHECK}}: encoding: [0x64,0x0c,0x00,0x00]
33# WARNING-NEXT:          ^~
34# WARNING-NEXT:          Did you mean $t0?
35daddiu	$t4, $zero, 0       # CHECK: encoding: [0x64,0x0c,0x00,0x00]
36# WARNING: mips64-register-names-n32-n64.s:[[@LINE+4]]:9: warning: register names $t4-$t7 are only available in O32.
37# WARNING-NEXT: daddiu  $t5, $zero, 0       # {{CHECK}}: encoding: [0x64,0x0d,0x00,0x00]
38# WARNING-NEXT:          ^~
39# WARNING-NEXT:          Did you mean $t1?
40daddiu	$t5, $zero, 0       # CHECK: encoding: [0x64,0x0d,0x00,0x00]
41# WARNING: mips64-register-names-n32-n64.s:[[@LINE+4]]:9: warning: register names $t4-$t7 are only available in O32.
42# WARNING-NEXT: daddiu  $t6, $zero, 0       # {{CHECK}}: encoding: [0x64,0x0e,0x00,0x00]
43# WARNING-NEXT:          ^~
44# WARNING-NEXT:          Did you mean $t2?
45daddiu	$t6, $zero, 0       # CHECK: encoding: [0x64,0x0e,0x00,0x00]
46# WARNING: mips64-register-names-n32-n64.s:[[@LINE+4]]:9: warning: register names $t4-$t7 are only available in O32.
47# WARNING-NEXT: daddiu  $t7, $zero, 0       # {{CHECK}}: encoding: [0x64,0x0f,0x00,0x00]
48# WARNING-NEXT:          ^~
49# WARNING-NEXT:          Did you mean $t3?
50daddiu	$t7, $zero, 0       # CHECK: encoding: [0x64,0x0f,0x00,0x00]
51daddiu	$s0, $zero, 0       # CHECK: encoding: [0x64,0x10,0x00,0x00]
52daddiu	$s1, $zero, 0       # CHECK: encoding: [0x64,0x11,0x00,0x00]
53daddiu	$s2, $zero, 0       # CHECK: encoding: [0x64,0x12,0x00,0x00]
54daddiu	$s3, $zero, 0       # CHECK: encoding: [0x64,0x13,0x00,0x00]
55daddiu	$s4, $zero, 0       # CHECK: encoding: [0x64,0x14,0x00,0x00]
56daddiu	$s5, $zero, 0       # CHECK: encoding: [0x64,0x15,0x00,0x00]
57daddiu	$s6, $zero, 0       # CHECK: encoding: [0x64,0x16,0x00,0x00]
58daddiu	$s7, $zero, 0       # CHECK: encoding: [0x64,0x17,0x00,0x00]
59daddiu	$t8, $zero, 0       # CHECK: encoding: [0x64,0x18,0x00,0x00]
60daddiu	$t9, $zero, 0       # CHECK: encoding: [0x64,0x19,0x00,0x00]
61daddiu	$kt0, $zero, 0      # CHECK: encoding: [0x64,0x1a,0x00,0x00]
62daddiu	$kt1, $zero, 0      # CHECK: encoding: [0x64,0x1b,0x00,0x00]
63daddiu	$gp, $zero, 0       # CHECK: encoding: [0x64,0x1c,0x00,0x00]
64daddiu	$sp, $zero, 0       # CHECK: encoding: [0x64,0x1d,0x00,0x00]
65daddiu	$s8, $zero, 0       # CHECK: encoding: [0x64,0x1e,0x00,0x00]
66daddiu	$fp, $zero, 0       # CHECK: encoding: [0x64,0x1e,0x00,0x00]
67daddiu	$ra, $zero, 0       # CHECK: encoding: [0x64,0x1f,0x00,0x00]
68
69# [*] - t0-t3 are aliases of t4-t7 for compatibility with both the original
70#       ABI documentation (using t4-t7) and GNU As (using t0-t3)
71