brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · dccf295 Raw
34 lines · plain
1; RUN: llc --mtriple=loongarch64 -mattr=+d --verify-machineinstrs < %s \2; RUN:   | FileCheck %s --check-prefix=ASM3; RUN: llc --mtriple=loongarch64 -mattr=+d --print-after-isel -o /dev/null 2>&1 < %s \4; RUN:   | FileCheck %s --check-prefix=MACHINE-INSTR5 6define i64 @k_variable_offset(ptr %p, i64 %idx) nounwind {7; ASM-LABEL: k_variable_offset:8; ASM:       # %bb.0:9; ASM-NEXT:    #APP10; ASM-NEXT:    ldx.d $a0, $a0, $a111; ASM-NEXT:    #NO_APP12; ASM-NEXT:    ret13  %1 = getelementptr inbounds i8, ptr %p, i64 %idx14;; Make sure machine instr with this 'k' constraint is printed correctly.15; MACHINE-INSTR: INLINEASM{{.*}}[mem:k]16  %2 = call i64 asm "ldx.d $0, $1", "=r,*k"(ptr elementtype(i64) %1)17  ret i64 %218}19 20define i64 @k_constant_offset(ptr %p) nounwind {21; ASM-LABEL: k_constant_offset:22; ASM:       # %bb.0:23; ASM-NEXT:    ori $a1, $zero, 524; ASM-NEXT:    #APP25; ASM-NEXT:    ldx.d $a0, $a0, $a126; ASM-NEXT:    #NO_APP27; ASM-NEXT:    ret28  %1 = getelementptr inbounds i8, ptr %p, i64 529;; Make sure machine instr with this 'k' constraint is printed correctly.30; MACHINE-INSTR: INLINEASM{{.*}}[mem:k]31  %2 = call i64 asm "ldx.d $0, $1", "=r,*k"(ptr elementtype(i64) %1)32  ret i64 %233}34