Home | History | Annotate | Download | only in arm32
      1 ; Show that we can generate vmov for bitcasts between i64 and double.
      2 
      3 ; REQUIRES: allow_dump
      4 
      5 ; Compile using standalone assembler.
      6 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -Om1 \
      7 ; RUN:   -allow-extern -reg-use r5,r10,d20 \
      8 ; RUN:   | FileCheck %s --check-prefix=ASM
      9 
     10 ; Show bytes in assembled standalone code.
     11 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \
     12 ; RUN:   --args -Om1 \
     13 ; RUN:   -allow-extern -reg-use r5,r10,d20 \
     14 ; RUN:   | FileCheck %s --check-prefix=DIS
     15 
     16 ; Compile using integrated assembler.
     17 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \
     18 ; RUN:   -allow-extern -reg-use r5,r10,d20 \
     19 ; RUN:   | FileCheck %s --check-prefix=IASM
     20 
     21 ; Show bytes in assembled integrated code.
     22 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
     23 ; RUN:   --args -Om1 \
     24 ; RUN:   -allow-extern -reg-use r5,r10,d20 \
     25 ; RUN:   | FileCheck %s --check-prefix=DIS
     26 
     27 define internal i64 @convertDoubleToI64(double %d) {
     28 ; ASM-LABEL: convertDoubleToI64:
     29 ; DIS-LABEL: {{.+}} <convertDoubleToI64>:
     30 
     31   %v = bitcast double %d to i64
     32 
     33 ; ASM:  vmov    r5, r10, d20
     34 ; DIS:   {{.+}}:    ec5a5b34
     35 ; IASM-NOT: vmov
     36 
     37   ret i64 %v
     38 }
     39 
     40 define internal double @convertI64ToDouble(i64 %i) {
     41 ; ASM-LABEL: convertI64ToDouble:
     42 ; DIS-LABEL: {{.+}} <convertI64ToDouble>:
     43 
     44   %v = bitcast i64 %i to double
     45 
     46 ; ASM:  vmov    d20, r5, r10
     47 ; DIS:   {{.+}}:    ec4a5b34
     48 ; IASM-NOT: vmov
     49 
     50   ; Note: This call is added to allow %v to be put into d20 (instead of
     51   ; return register d0).
     52   call void @ignore(double %v)
     53 
     54   ret double %v
     55 }
     56 
     57 declare external void @ignore(double)
     58