14615cc38SSam Elliott; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 24615cc38SSam Elliott; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \ 34615cc38SSam Elliott; RUN: | FileCheck %s 44615cc38SSam Elliott 54615cc38SSam Elliottdefine i128 @test_R_wide_scalar_simple(i128 noundef %0) nounwind { 64615cc38SSam Elliott; CHECK-LABEL: test_R_wide_scalar_simple: 74615cc38SSam Elliott; CHECK: # %bb.0: # %entry 84615cc38SSam Elliott; CHECK-NEXT: #APP 94615cc38SSam Elliott; CHECK-NEXT: # a2 <- a0 104615cc38SSam Elliott; CHECK-NEXT: #NO_APP 114615cc38SSam Elliott; CHECK-NEXT: mv a0, a2 124615cc38SSam Elliott; CHECK-NEXT: mv a1, a3 134615cc38SSam Elliott; CHECK-NEXT: ret 144615cc38SSam Elliottentry: 154615cc38SSam Elliott %1 = call i128 asm sideeffect "/* $0 <- $1 */", "=&R,R"(i128 %0) 164615cc38SSam Elliott ret i128 %1 174615cc38SSam Elliott} 184615cc38SSam Elliott 194615cc38SSam Elliottdefine i64 @test_R_wide_scalar_with_ops(i64 noundef %0) nounwind { 204615cc38SSam Elliott; CHECK-LABEL: test_R_wide_scalar_with_ops: 214615cc38SSam Elliott; CHECK: # %bb.0: # %entry 224615cc38SSam Elliott; CHECK-NEXT: mv a1, a0 234615cc38SSam Elliott; CHECK-NEXT: #APP 244615cc38SSam Elliott; CHECK-NEXT: # a2 <- a0 254615cc38SSam Elliott; CHECK-NEXT: #NO_APP 264615cc38SSam Elliott; CHECK-NEXT: or a0, a2, a3 274615cc38SSam Elliott; CHECK-NEXT: ret 284615cc38SSam Elliottentry: 294615cc38SSam Elliott %1 = zext i64 %0 to i128 304615cc38SSam Elliott %2 = shl i128 %1, 64 314615cc38SSam Elliott %3 = or i128 %1, %2 324615cc38SSam Elliott %4 = call i128 asm sideeffect "/* $0 <- $1 */", "=&R,R"(i128 %3) 334615cc38SSam Elliott %5 = trunc i128 %4 to i64 344615cc38SSam Elliott %6 = lshr i128 %4, 64 354615cc38SSam Elliott %7 = trunc i128 %6 to i64 364615cc38SSam Elliott %8 = or i64 %5, %7 374615cc38SSam Elliott ret i64 %8 384615cc38SSam Elliott} 394615cc38SSam Elliott 404615cc38SSam Elliottdefine i128 @test_R_wide_scalar_inout(ptr %0, i128 noundef %1) nounwind { 414615cc38SSam Elliott; CHECK-LABEL: test_R_wide_scalar_inout: 424615cc38SSam Elliott; CHECK: # %bb.0: # %entry 434615cc38SSam Elliott; CHECK-NEXT: addi sp, sp, -32 444615cc38SSam Elliott; CHECK-NEXT: mv a3, a2 454615cc38SSam Elliott; CHECK-NEXT: sd a0, 24(sp) 464615cc38SSam Elliott; CHECK-NEXT: mv a2, a1 474615cc38SSam Elliott; CHECK-NEXT: sd a1, 0(sp) 484615cc38SSam Elliott; CHECK-NEXT: sd a3, 8(sp) 494615cc38SSam Elliott; CHECK-NEXT: #APP 504615cc38SSam Elliott; CHECK-NEXT: # a0; a2 514615cc38SSam Elliott; CHECK-NEXT: #NO_APP 524615cc38SSam Elliott; CHECK-NEXT: sd a0, 24(sp) 534615cc38SSam Elliott; CHECK-NEXT: sd a2, 0(sp) 544615cc38SSam Elliott; CHECK-NEXT: sd a3, 8(sp) 554615cc38SSam Elliott; CHECK-NEXT: mv a0, a2 564615cc38SSam Elliott; CHECK-NEXT: mv a1, a3 574615cc38SSam Elliott; CHECK-NEXT: addi sp, sp, 32 584615cc38SSam Elliott; CHECK-NEXT: ret 594615cc38SSam Elliottentry: 604615cc38SSam Elliott %2 = alloca ptr, align 8 614615cc38SSam Elliott %3 = alloca i128, align 16 624615cc38SSam Elliott store ptr %0, ptr %2, align 8 634615cc38SSam Elliott store i128 %1, ptr %3, align 16 644615cc38SSam Elliott %4 = load ptr, ptr %2, align 8 654615cc38SSam Elliott %5 = load i128, ptr %3, align 16 664615cc38SSam Elliott %6 = call { ptr, i128 } asm sideeffect "/* $0; $1 */", "=r,=R,0,1"(ptr %4, i128 %5) 674615cc38SSam Elliott %7 = extractvalue { ptr, i128} %6, 0 684615cc38SSam Elliott %8 = extractvalue { ptr, i128 } %6, 1 694615cc38SSam Elliott store ptr %7, ptr %2, align 8 704615cc38SSam Elliott store i128 %8, ptr %3, align 16 714615cc38SSam Elliott %9 = load i128, ptr %3, align 16 724615cc38SSam Elliott ret i128 %9 734615cc38SSam Elliott} 74*33c44074SSam Elliott 75*33c44074SSam Elliottdefine i128 @test_cR_wide_scalar_simple(i128 noundef %0) nounwind { 76*33c44074SSam Elliott; CHECK-LABEL: test_cR_wide_scalar_simple: 77*33c44074SSam Elliott; CHECK: # %bb.0: # %entry 78*33c44074SSam Elliott; CHECK-NEXT: #APP 79*33c44074SSam Elliott; CHECK-NEXT: # a2 <- a0 80*33c44074SSam Elliott; CHECK-NEXT: #NO_APP 81*33c44074SSam Elliott; CHECK-NEXT: mv a0, a2 82*33c44074SSam Elliott; CHECK-NEXT: mv a1, a3 83*33c44074SSam Elliott; CHECK-NEXT: ret 84*33c44074SSam Elliottentry: 85*33c44074SSam Elliott %1 = call i128 asm sideeffect "/* $0 <- $1 */", "=&^cR,^cR"(i128 %0) 86*33c44074SSam Elliott ret i128 %1 87*33c44074SSam Elliott} 88*33c44074SSam Elliott 89*33c44074SSam Elliottdefine i64 @test_cR_wide_scalar_with_ops(i64 noundef %0) nounwind { 90*33c44074SSam Elliott; CHECK-LABEL: test_cR_wide_scalar_with_ops: 91*33c44074SSam Elliott; CHECK: # %bb.0: # %entry 92*33c44074SSam Elliott; CHECK-NEXT: mv a1, a0 93*33c44074SSam Elliott; CHECK-NEXT: #APP 94*33c44074SSam Elliott; CHECK-NEXT: # a2 <- a0 95*33c44074SSam Elliott; CHECK-NEXT: #NO_APP 96*33c44074SSam Elliott; CHECK-NEXT: or a0, a2, a3 97*33c44074SSam Elliott; CHECK-NEXT: ret 98*33c44074SSam Elliottentry: 99*33c44074SSam Elliott %1 = zext i64 %0 to i128 100*33c44074SSam Elliott %2 = shl i128 %1, 64 101*33c44074SSam Elliott %3 = or i128 %1, %2 102*33c44074SSam Elliott %4 = call i128 asm sideeffect "/* $0 <- $1 */", "=&^cR,^cR"(i128 %3) 103*33c44074SSam Elliott %5 = trunc i128 %4 to i64 104*33c44074SSam Elliott %6 = lshr i128 %4, 64 105*33c44074SSam Elliott %7 = trunc i128 %6 to i64 106*33c44074SSam Elliott %8 = or i64 %5, %7 107*33c44074SSam Elliott ret i64 %8 108*33c44074SSam Elliott} 109*33c44074SSam Elliott 110*33c44074SSam Elliottdefine i128 @test_cR_wide_scalar_inout(ptr %0, i128 noundef %1) nounwind { 111*33c44074SSam Elliott; CHECK-LABEL: test_cR_wide_scalar_inout: 112*33c44074SSam Elliott; CHECK: # %bb.0: # %entry 113*33c44074SSam Elliott; CHECK-NEXT: addi sp, sp, -32 114*33c44074SSam Elliott; CHECK-NEXT: mv a3, a2 115*33c44074SSam Elliott; CHECK-NEXT: sd a0, 24(sp) 116*33c44074SSam Elliott; CHECK-NEXT: mv a2, a1 117*33c44074SSam Elliott; CHECK-NEXT: sd a1, 0(sp) 118*33c44074SSam Elliott; CHECK-NEXT: sd a3, 8(sp) 119*33c44074SSam Elliott; CHECK-NEXT: #APP 120*33c44074SSam Elliott; CHECK-NEXT: # a0; a2 121*33c44074SSam Elliott; CHECK-NEXT: #NO_APP 122*33c44074SSam Elliott; CHECK-NEXT: sd a0, 24(sp) 123*33c44074SSam Elliott; CHECK-NEXT: sd a2, 0(sp) 124*33c44074SSam Elliott; CHECK-NEXT: sd a3, 8(sp) 125*33c44074SSam Elliott; CHECK-NEXT: mv a0, a2 126*33c44074SSam Elliott; CHECK-NEXT: mv a1, a3 127*33c44074SSam Elliott; CHECK-NEXT: addi sp, sp, 32 128*33c44074SSam Elliott; CHECK-NEXT: ret 129*33c44074SSam Elliottentry: 130*33c44074SSam Elliott %2 = alloca ptr, align 8 131*33c44074SSam Elliott %3 = alloca i128, align 16 132*33c44074SSam Elliott store ptr %0, ptr %2, align 8 133*33c44074SSam Elliott store i128 %1, ptr %3, align 16 134*33c44074SSam Elliott %4 = load ptr, ptr %2, align 8 135*33c44074SSam Elliott %5 = load i128, ptr %3, align 16 136*33c44074SSam Elliott %6 = call { ptr, i128 } asm sideeffect "/* $0; $1 */", "=r,=^cR,0,1"(ptr %4, i128 %5) 137*33c44074SSam Elliott %7 = extractvalue { ptr, i128} %6, 0 138*33c44074SSam Elliott %8 = extractvalue { ptr, i128 } %6, 1 139*33c44074SSam Elliott store ptr %7, ptr %2, align 8 140*33c44074SSam Elliott store i128 %8, ptr %3, align 16 141*33c44074SSam Elliott %9 = load i128, ptr %3, align 16 142*33c44074SSam Elliott ret i128 %9 143*33c44074SSam Elliott} 144