File: inlineasm_constraint.ll

package info (click to toggle)
llvm-toolchain-3.8 1%3A3.8.1-24
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 379,280 kB
  • ctags: 388,501
  • sloc: cpp: 2,309,705; ansic: 477,070; objc: 100,918; asm: 97,974; python: 95,911; sh: 18,634; makefile: 7,294; perl: 5,584; ml: 5,460; pascal: 4,661; lisp: 2,548; xml: 686; cs: 350; php: 212; csh: 117
file content (73 lines) | stat: -rw-r--r-- 1,986 bytes parent folder | download | duplicates (2)
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
; RUN: llc -no-integrated-as -march=mipsel < %s | \
; RUN:     FileCheck %s -check-prefix=ALL -check-prefix=GAS

define void @constraint_I() nounwind {
; First I with short
; ALL-LABEL: constraint_I:
; ALL:           #APP
; ALL:           addiu ${{[0-9]+}}, ${{[0-9]+}}, 4096
; ALL:           #NO_APP
  tail call i16 asm sideeffect "addiu $0, $1, $2", "=r,r,I"(i16 7, i16 4096) nounwind

; Then I with int
; ALL: #APP
; ALL: addiu ${{[0-9]+}}, ${{[0-9]+}}, -3
; ALL: #NO_APP
  tail call i32 asm sideeffect "addiu $0, $1, $2", "=r,r,I"(i32 7, i32 -3) nounwind
  ret void
}

define void @constraint_J() nounwind {
; Now J with 0
; ALL-LABEL: constraint_J:
; ALL: #APP
; ALL: addiu ${{[0-9]+}}, ${{[0-9]+}}, 0
; ALL: #NO_APP
  tail call i32 asm sideeffect "addiu $0, $1, $2\0A\09 ", "=r,r,J"(i32 7, i16 0) nounwind
  ret void
}

define void @constraint_K() nounwind {
; Now K with 64
; ALL: #APP
; GAS: addu ${{[0-9]+}}, ${{[0-9]+}}, 64
; ALL: #NO_APP	
  tail call i16 asm sideeffect "addu $0, $1, $2\0A\09 ", "=r,r,K"(i16 7, i16 64) nounwind
  ret void
}

define void @constraint_L() nounwind {
; Now L with 0x00100000
; ALL: #APP
; ALL: add ${{[0-9]+}}, ${{[0-9]+}}, ${{[0-9]+}}
; ALL: #NO_APP	
  tail call i32 asm sideeffect "add $0, $1, $3\0A\09", "=r,r,L,r"(i32 7, i32 1048576, i32 0) nounwind
  ret void
}

define void @constraint_N() nounwind {
; Now N with -3
; ALL: #APP
; ALL: addiu ${{[0-9]+}}, ${{[0-9]+}}, -3
; ALL: #NO_APP	
  tail call i32 asm sideeffect "addiu $0, $1, $2", "=r,r,N"(i32 7, i32 -3) nounwind
  ret void
}

define void @constraint_O() nounwind {
; Now O with -3
; ALL: #APP
; ALL: addiu ${{[0-9]+}}, ${{[0-9]+}}, -3
; ALL: #NO_APP	
  tail call i32 asm sideeffect "addiu $0, $1, $2", "=r,r,O"(i32 7, i16 -3) nounwind
  ret void
}

define void @constraint_P() nounwind {
; Now P with 65535
; ALL: #APP
; GAS: addiu ${{[0-9]+}}, ${{[0-9]+}}, 65535
; ALL: #NO_APP
  tail call i32 asm sideeffect "addiu $0, $1, $2", "=r,r,P"(i32 7, i32 65535) nounwind
  ret void
}