File: branch32.s

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 2,245,044 kB
  • sloc: cpp: 7,619,726; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,666; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (49 lines) | stat: -rw-r--r-- 1,107 bytes parent folder | download | duplicates (3)
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
; RUN: llvm-mc -triple=m68k --mcpu=M68020 -motorola-integers -filetype=obj --position-independent < %s \
; RUN:     | llvm-objdump -d - | FileCheck %s
; RUN: llvm-mc -triple m68k --mcpu=M68020 -show-encoding --position-independent %s -o - \
; RUN:   | FileCheck -check-prefix=INSTR %s

; Branch relocations are relaxed as part of object layout, so -show-encoding still 
; shows them as 1-byte relocactions 

; CHECK-LABEL: <TIGHT>:
TIGHT:
	; CHECK: bra  $7f
	; INSTR: bra .LBB0_2 ; encoding: [0x60,A]
	bra	.LBB0_2
	.space 0x7F  ; i8::MAX
.LBB0_2:
	add.l	#0, %d0
	rts

; CHECK-LABEL: <RELAXED>:
RELAXED:
	; CHECK: bra  $82
	; INSTR: bra .LBB1_2 ; encoding: [0x60,A]
	bra	.LBB1_2
	.space 0x80  ; Greater than i8::MAX
.LBB1_2:
	add.l	#0, %d0
	rts

; CHECK-LABEL: <RELAXED_32>:
RELAXED_32:
	; CHECK: bra  $ff
	; CHECK-NEXT: 00 00
	; CHECK-NEXT: 80 04
	; INSTR: bra .LBB2_1 ; encoding: [0x60,A]
	bra	.LBB2_1
	.space 0x8000  ; Greater than i16::MAX.
.LBB2_1:
	add.l	#0, %d0
	rts

; CHECK-LABEL: <ZERO>:
ZERO:
	; CHECK: bra  $2
	; INSTR: bra .LBB3_1 ; encoding: [0x60,A]
	bra	.LBB3_1
.LBB3_1:
	add.l	#0, %d0
	rts