File: arm-thumb-alu.s

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, 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 (114 lines) | stat: -rw-r--r-- 3,154 bytes parent folder | download | duplicates (12)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// REQUIRES: arm

// RUN: split-file %s %t
// RUN: llvm-mc -filetype=obj -triple=thumbv6m-unknown-linux-gnueabi %t/asm -o %t.o
// RUN: ld.lld --script %t/lds %t.o -o %t2
// RUN: llvm-objdump -d %t2 --triple=thumbv6m-unknown-linux-gnueabi --no-show-raw-insn | FileCheck %s

//--- lds
SECTIONS {
  .tests 0x00001000 : AT(0x00001000) { *(.tests) }
  .sym1  0x11223344 : AT(0x11223344) { *(.sym1) }
  .sym2  0x00ffffff : AT(0x00ffffff) { *(.sym2) }
  .fn    0x55667788 : AT(0x55667788) { *(.fn) }
}

//--- asm
  .section .tests, "ax", %progbits

// CHECK-LABEL: <R_ARM_THM_ALU_ABS_G0_NC>:
// CHECK:      adds    r0, #0x44
// CHECK-NEXT: movs    r0, #0x44
// CHECK-NEXT: movs    r0, #0x45
// CHECK-NEXT: movs    r0, #0x43
// CHECK-NEXT: movs    r0, #0xff
// CHECK-NEXT: movs    r0, #0x0
// CHECK-NEXT: movs    r0, #0xfe
// CHECK-NEXT: movs    r0, #0x89
// CHECK-NEXT: movs    r0, #0x8b
R_ARM_THM_ALU_ABS_G0_NC:
  adds r0, :lower0_7:sym1
  movs r0, :lower0_7:sym1
  movs r0, :lower0_7:sym1+1
  movs r0, :lower0_7:sym1+0xff
  movs r0, :lower0_7:sym2
  movs r0, :lower0_7:sym2+1
  movs r0, :lower0_7:sym2+0xff
  movs r0, :lower0_7:fn
  movs r0, :lower0_7:fn+2

// CHECK-LABEL: <R_ARM_THM_ALU_ABS_G1_NC>:
// CHECK:      adds    r0, #0x33
// CHECK-NEXT: movs    r0, #0x33
// CHECK-NEXT: movs    r0, #0x33
// CHECK-NEXT: movs    r0, #0x34
// CHECK-NEXT: movs    r0, #0xff
// CHECK-NEXT: movs    r0, #0x0
// CHECK-NEXT: movs    r0, #0x0
// CHECK-NEXT: movs    r0, #0x77
// CHECK-NEXT: movs    r0, #0x77
R_ARM_THM_ALU_ABS_G1_NC:
  adds r0, :lower8_15:sym1
  movs r0, :lower8_15:sym1
  movs r0, :lower8_15:sym1+1
  movs r0, :lower8_15:sym1+0xff
  movs r0, :lower8_15:sym2
  movs r0, :lower8_15:sym2+1
  movs r0, :lower8_15:sym2+0xff
  movs r0, :lower8_15:fn
  movs r0, :lower8_15:fn+2

// CHECK-LABEL: <R_ARM_THM_ALU_ABS_G2_NC>:
// CHECK:      adds    r0, #0x22
// CHECK-NEXT: movs    r0, #0x22
// CHECK-NEXT: movs    r0, #0x22
// CHECK-NEXT: movs    r0, #0x22
// CHECK-NEXT: movs    r0, #0xff
// CHECK-NEXT: movs    r0, #0x0
// CHECK-NEXT: movs    r0, #0x0
// CHECK-NEXT: movs    r0, #0x66
// CHECK-NEXT: movs    r0, #0x66
R_ARM_THM_ALU_ABS_G2_NC:
  adds r0, :upper0_7:sym1
  movs r0, :upper0_7:sym1
  movs r0, :upper0_7:sym1+1
  movs r0, :upper0_7:sym1+0xff
  movs r0, :upper0_7:sym2
  movs r0, :upper0_7:sym2+1
  movs r0, :upper0_7:sym2+0xff
  movs r0, :upper0_7:fn
  movs r0, :upper0_7:fn+2

// CHECK-LABEL: <R_ARM_THM_ALU_ABS_G3>:
// CHECK:      adds    r0, #0x11
// CHECK-NEXT: movs    r0, #0x11
// CHECK-NEXT: movs    r0, #0x11
// CHECK-NEXT: movs    r0, #0x11
// CHECK-NEXT: movs    r0, #0x0
// CHECK-NEXT: movs    r0, #0x1
// CHECK-NEXT: movs    r0, #0x1
// CHECK-NEXT: movs    r0, #0x55
// CHECK-NEXT: movs    r0, #0x55
R_ARM_THM_ALU_ABS_G3:
  adds r0, :upper8_15:sym1
  movs r0, :upper8_15:sym1
  movs r0, :upper8_15:sym1+1
  movs r0, :upper8_15:sym1+0xff
  movs r0, :upper8_15:sym2
  movs r0, :upper8_15:sym2+1
  movs r0, :upper8_15:sym2+0xff
  movs r0, :upper8_15:fn
  movs r0, :upper8_15:fn+2

  .section .sym1, "aw", %progbits
sym1:
  .byte 0

  .section .sym2, "aw", %progbits
sym2:
  .byte 0

  .section .fn, "ax", %progbits
  .thumb_func
fn:
  bx lr