File: micromips-branch-fixup.s

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (85 lines) | stat: -rw-r--r-- 4,645 bytes parent folder | download | duplicates (21)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding \
# RUN: -mattr=micromips | FileCheck %s -check-prefix=CHECK-FIXUP
# RUN: llvm-mc %s -filetype=obj -triple=mipsel-unknown-linux \
# RUN: -mattr=micromips | llvm-readobj -r - \
# RUN: | FileCheck %s -check-prefix=CHECK-ELF
#------------------------------------------------------------------------------
# Check that the assembler can handle the documented syntax
# for relocations.
#------------------------------------------------------------------------------
# CHECK-FIXUP: beqz16 $6, bar  # encoding: [0b0AAAAAAA,0x8f]
# CHECK-FIXUP:                 #   fixup A - offset: 0,
# CHECK-FIXUP:                     value: bar, kind: fixup_MICROMIPS_PC7_S1
# CHECK-FIXUP: nop             # encoding: [0x00,0x00,0x00,0x00]
# CHECK-FIXUP: bnez16 $6, bar  # encoding: [0b0AAAAAAA,0xaf]
# CHECK-FIXUP:                 #   fixup A - offset: 0,
# CHECK-FIXUP:                     value: bar, kind: fixup_MICROMIPS_PC7_S1
# CHECK-FIXUP: nop             # encoding: [0x00,0x00,0x00,0x00]
# CHECK-FIXUP: b16         bar # encoding: [A,0b110011AA]
# CHECK-FIXUP:                 #   fixup A - offset: 0,
# CHECK-FIXUP:                     value: bar, kind: fixup_MICROMIPS_PC10_S1
# CHECK-FIXUP: nop             # encoding: [0x00,0x00,0x00,0x00]
# CHECK-FIXUP: b   bar         # encoding: [A,0x94'A',0x00,0x00]
# CHECK-FIXUP:                 #   fixup A - offset: 0,
# CHECK-FIXUP:                     value: bar, kind: fixup_MICROMIPS_PC16_S1
# CHECK-FIXUP: nop             # encoding: [0x00,0x0c]
# CHECK-FIXUP: beq $3, $4, bar # encoding: [0x83'A',0x94'A',0x00,0x00]
# CHECK-FIXUP:                 #   fixup A - offset: 0, value: bar, kind: fixup_MICROMIPS_PC16_S1
# CHECK-FIXUP: nop             # encoding: [0x00,0x0c]
# CHECK-FIXUP: bne $3, $4, bar # encoding: [0x83'A',0xb4'A',0x00,0x00]
# CHECK-FIXUP:                 #   fixup A - offset: 0, value: bar, kind: fixup_MICROMIPS_PC16_S1
# CHECK-FIXUP: nop             # encoding: [0x00,0x0c]
# CHECK-FIXUP: bgez    $4, bar # encoding: [0x44'A',0x40'A',0x00,0x00]
# CHECK-FIXUP-NEXT:                 #   fixup A - offset: 0, value: bar, kind: fixup_MICROMIPS_PC16_S1
# CHECK-FIXUP-NEXT: nop             # encoding: [0x00,0x0c]
# CHECK-FIXUP: bgtz    $4, bar # encoding: [0xc4'A',0x40'A',0x00,0x00]
# CHECK-FIXUP-NEXT:                 #   fixup A - offset: 0, value: bar, kind: fixup_MICROMIPS_PC16_S1
# CHECK-FIXUP-NEXT: nop             # encoding: [0x00,0x0c]
# CHECK-FIXUP: blez    $4, bar # encoding: [0x84'A',0x40'A',0x00,0x00]
# CHECK-FIXUP-NEXT:                 #   fixup A - offset: 0, value: bar, kind: fixup_MICROMIPS_PC16_S1
# CHECK-FIXUP-NEXT: nop             # encoding: [0x00,0x0c]
# CHECK-FIXUP: bltz    $4, bar # encoding: [0x04'A',0x40'A',0x00,0x00]
# CHECK-FIXUP-NEXT:                 #   fixup A - offset: 0, value: bar, kind: fixup_MICROMIPS_PC16_S1
# CHECK-FIXUP-NEXT: nop             # encoding: [0x00,0x0c]
# CHECK-FIXUP: bgezal  $4, bar # encoding: [0x64'A',0x40'A',0x00,0x00]
# CHECK-FIXUP:                 #   fixup A - offset: 0,
# CHECK-FIXUP:                     value: bar, kind: fixup_MICROMIPS_PC16_S1
# CHECK-FIXUP: nop             # encoding: [0x00,0x00,0x00,0x00]
# CHECK-FIXUP: bltzal  $4, bar # encoding: [0x24'A',0x40'A',0x00,0x00]
# CHECK-FIXUP:                 #   fixup A - offset: 0,
# CHECK-FIXUP:                     value: bar, kind: fixup_MICROMIPS_PC16_S1
# CHECK-FIXUP: nop             # encoding: [0x00,0x00,0x00,0x00]
#------------------------------------------------------------------------------
# Check that the appropriate relocations were created.
#------------------------------------------------------------------------------
# CHECK-ELF: Relocations [
# CHECK-ELF:     0x{{[0-9,A-F]+}} R_MICROMIPS_PC7_S1
# CHECK-ELF:     0x{{[0-9,A-F]+}} R_MICROMIPS_PC7_S1
# CHECK-ELF:     0x{{[0-9,A-F]+}} R_MICROMIPS_PC10_S1
# CHECK-ELF:     0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
# CHECK-ELF:     0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
# CHECK-ELF:     0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
# CHECK-ELF:     0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
# CHECK-ELF:     0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
# CHECK-ELF:     0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
# CHECK-ELF:     0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
# CHECK-ELF:     0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
# CHECK-ELF:     0x{{[0-9,A-F]+}} R_MICROMIPS_PC16_S1
# CHECK-ELF: ]

  .text
  .type main, @function
  .set micromips
main:
  beqz16  $6, bar
  bnez16  $6, bar
  b16     bar
  b       bar
  beq     $3, $4, bar
  bne     $3, $4, bar
  bgez    $4, bar
  bgtz    $4, bar
  blez    $4, bar
  bltz    $4, bar
  bgezal  $4, bar
  bltzal  $4, bar