Home | History | Annotate | Download | only in SystemZ
      1 ; Test matching operands with the GPR constraint "r".
      2 ;
      3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
      4 
      5 define void @f1(i32 *%dst) {
      6 ; CHECK-LABEL: f1:
      7 ; CHECK: lhi %r0, 100
      8 ; CHECK: blah %r0
      9 ; CHECK: st %r0, 0(%r2)
     10 ; CHECK: br %r14
     11   %val = call i32 asm "blah $0", "=r,0" (i8 100)
     12   store i32 %val, i32 *%dst
     13   ret void
     14 }
     15 
     16 define void @f2(i32 *%dst) {
     17 ; CHECK-LABEL: f2:
     18 ; CHECK: lhi %r0, 101
     19 ; CHECK: blah %r0
     20 ; CHECK: st %r0, 0(%r2)
     21 ; CHECK: br %r14
     22   %val = call i32 asm "blah $0", "=r,0" (i16 101)
     23   store i32 %val, i32 *%dst
     24   ret void
     25 }
     26 
     27 define void @f3(i32 *%dst) {
     28 ; CHECK-LABEL: f3:
     29 ; CHECK: lhi %r0, 102
     30 ; CHECK: blah %r0
     31 ; CHECK: st %r0, 0(%r2)
     32 ; CHECK: br %r14
     33   %val = call i32 asm "blah $0", "=r,0" (i32 102)
     34   store i32 %val, i32 *%dst
     35   ret void
     36 }
     37 
     38 ; FIXME: this uses "lhi %r0, 103", but should use "lghi %r0, 103".
     39 define void @f4(i32 *%dst) {
     40 ; CHECK-LABEL: f4:
     41 ; CHECK: blah %r0
     42 ; CHECK: st %r0, 0(%r2)
     43 ; CHECK: br %r14
     44   %val = call i32 asm "blah $0", "=r,0" (i64 103)
     45   store i32 %val, i32 *%dst
     46   ret void
     47 }
     48 
     49 define i64 @f5() {
     50 ; CHECK-LABEL: f5:
     51 ; CHECK: lghi %r2, 104
     52 ; CHECK: blah %r2
     53 ; CHECK: br %r14
     54   %val = call i64 asm "blah $0", "=r,0" (i8 104)
     55   ret i64 %val
     56 }
     57 
     58 define i64 @f6() {
     59 ; CHECK-LABEL: f6:
     60 ; CHECK: lghi %r2, 105
     61 ; CHECK: blah %r2
     62 ; CHECK: br %r14
     63   %val = call i64 asm "blah $0", "=r,0" (i16 105)
     64   ret i64 %val
     65 }
     66 
     67 define i64 @f7() {
     68 ; CHECK-LABEL: f7:
     69 ; CHECK: lghi %r2, 106
     70 ; CHECK: blah %r2
     71 ; CHECK: br %r14
     72   %val = call i64 asm "blah $0", "=r,0" (i32 106)
     73   ret i64 %val
     74 }
     75 
     76 define i64 @f8() {
     77 ; CHECK-LABEL: f8:
     78 ; CHECK: lghi %r2, 107
     79 ; CHECK: blah %r2
     80 ; CHECK: br %r14
     81   %val = call i64 asm "blah $0", "=r,0" (i64 107)
     82   ret i64 %val
     83 }
     84