1
; RUN: llc -o - %s -no-integrated-as | FileCheck %s
2
target triple = "x86_64--"
4
; Allow to specify any of the 8/16/32/64 register names interchangeably in
7
; Produced by C-programs like this:
8
; void foo(int p) { register int reg __asm__("r8") = p;
9
; __asm__ __volatile__("# REG: %0" : : "r" (reg)); }
11
; CHECK-LABEL: reg64_as_32:
13
define void @reg64_as_32(i32 %p) {
14
call void asm sideeffect "# REG: $0", "{r8}"(i32 %p)
18
; CHECK-LABEL: reg64_as_32_float:
20
define void @reg64_as_32_float(float %p) {
21
call void asm sideeffect "# REG: $0", "{r8}"(float %p)
25
; CHECK-LABEL: reg64_as_16:
27
define void @reg64_as_16(i16 %p) {
28
call void asm sideeffect "# REG: $0", "{r9}"(i16 %p)
32
; CHECK-LABEL: reg64_as_8:
34
define void @reg64_as_8(i8 %p) {
35
call void asm sideeffect "# REG: $0", "{rbp}"(i8 %p)
39
; CHECK-LABEL: reg32_as_16:
41
define void @reg32_as_16(i16 %p) {
42
call void asm sideeffect "# REG: $0", "{r15d}"(i16 %p)
46
; CHECK-LABEL: reg32_as_8:
48
define void @reg32_as_8(i8 %p) {
49
call void asm sideeffect "# REG: $0", "{r12d}"(i8 %p)
53
; CHECK-LABEL: reg16_as_8:
55
define void @reg16_as_8(i8 %p) {
56
call void asm sideeffect "# REG: $0", "{cx}"(i8 %p)
60
; CHECK-LABEL: reg32_as_64:
62
define void @reg32_as_64(i64 %p) {
63
call void asm sideeffect "# REG: $0", "{ebp}"(i64 %p)
67
; CHECK-LABEL: reg32_as_64_float:
69
define void @reg32_as_64_float(double %p) {
70
call void asm sideeffect "# REG: $0", "{ebp}"(double %p)
74
; CHECK-LABEL: reg16_as_64:
76
define void @reg16_as_64(i64 %p) {
77
call void asm sideeffect "# REG: $0", "{r13w}"(i64 %p)
81
; CHECK-LABEL: reg16_as_64_float:
83
define void @reg16_as_64_float(double %p) {
84
call void asm sideeffect "# REG: $0", "{r13w}"(double %p)
88
; CHECK-LABEL: reg8_as_64:
90
define void @reg8_as_64(i64 %p) {
91
call void asm sideeffect "# REG: $0", "{al}"(i64 %p)
95
; CHECK-LABEL: reg8_as_64_float:
97
define void @reg8_as_64_float(double %p) {
98
call void asm sideeffect "# REG: $0", "{al}"(double %p)
102
; CHECK-LABEL: reg16_as_32:
103
; CHECK: # REG: %r11d
104
define void @reg16_as_32(i32 %p) {
105
call void asm sideeffect "# REG: $0", "{r11w}"(i32 %p)
109
; CHECK-LABEL: reg16_as_32_float:
110
; CHECK: # REG: %r11d
111
define void @reg16_as_32_float(float %p) {
112
call void asm sideeffect "# REG: $0", "{r11w}"(float %p)
116
; CHECK-LABEL: reg8_as_32:
118
define void @reg8_as_32(i32 %p) {
119
call void asm sideeffect "# REG: $0", "{r9b}"(i32 %p)
123
; CHECK-LABEL: reg8_as_32_float:
125
define void @reg8_as_32_float(float %p) {
126
call void asm sideeffect "# REG: $0", "{r9b}"(float %p)
130
; CHECK-LABEL: reg8_as_16:
132
define void @reg8_as_16(i16 %p) {
133
call void asm sideeffect "# REG: $0", "{dil}"(i16 %p)