File: ldr-pseudo-cond.s

package info (click to toggle)
llvm-toolchain-17 1%3A17.0.6-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,799,624 kB
  • sloc: cpp: 6,428,607; ansic: 1,383,196; asm: 793,408; python: 223,504; objc: 75,364; f90: 60,502; lisp: 33,869; pascal: 15,282; sh: 9,684; perl: 7,453; ml: 4,937; awk: 3,523; makefile: 2,889; javascript: 2,149; xml: 888; fortran: 619; cs: 573
file content (55 lines) | stat: -rw-r--r-- 1,284 bytes parent folder | download | duplicates (19)
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
@RUN: llvm-mc -triple armv7-unknown-linux-gnueabi %s | FileCheck --check-prefix=CHECK %s
@RUN: llvm-mc -triple thumbv7-unknown-linux-gnueabi %s | FileCheck --check-prefix=CHECK %s

@
@ Check that ldr to constant pool correctly transfers the condition codes
@
@ simple test
.section a,"ax",%progbits
@ CHECK-LABEL: f0:
f0:
  it eq
  ldreq r0, =0x10002
@ CHECK: ldreq r0, .Ltmp[[TMP0:[0-9]+]]

@ loading multiple constants
.section b,"ax",%progbits
@ CHECK-LABEL: f1:
f1:
  ite eq
  ldreq r0, =0x10003
@ CHECK: ldreq r0, .Ltmp[[TMP1:[0-9]+]]
  ldrne r0, =0x10004
@ CHECK: ldrne r0, .Ltmp[[TMP2:[0-9]+]]

@ transformation to mov
.section c, "ax", %progbits
@ CHECK-LABEL: f2:
f2:
@ Can use the narrow Thumb mov as it does not set flags in an IT block
  it eq
  ldreq r1, =0x1
@ CHECK: moveq r1, #1

@ Must use the wide Thumb mov if the constant can't be represented
  ite eq
  ldreq r2, = 0x1f000000
@ CHECK-ARM moveq r2, #520093696
@ CHECK-THUMB2 moveq.w r2, #520093696
  ldrne r3, = 0x00001234
@ CHECK: movwne r3, #4660

@
@ Constant Pools
@
@ CHECK: .section a,"ax",%progbits
@ CHECK: .p2align 2
@ CHECK: .Ltmp[[TMP0]]
@ CHECK: .long 65538

@ CHECK: .section b,"ax",%progbits
@ CHECK: .p2align 2
@ CHECK: .Ltmp[[TMP1]]
@ CHECK: .long 65539
@ CHECK: .Ltmp[[TMP2]]
@ CHECK: .long 65540