75 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \3; RUN: | FileCheck %s -check-prefix=RV32I4 5@bytes = dso_local global [5 x i8] zeroinitializer, align 16 7define dso_local i32 @test_zext_i8() nounwind {8; RV32I-LABEL: test_zext_i8:9; RV32I: # %bb.0: # %entry10; RV32I-NEXT: lui a0, %hi(bytes)11; RV32I-NEXT: addi a0, a0, %lo(bytes)12; RV32I-NEXT: lbu a1, 0(a0)13; RV32I-NEXT: li a2, 13614; RV32I-NEXT: bne a1, a2, .LBB0_315; RV32I-NEXT: # %bb.1: # %entry16; RV32I-NEXT: lbu a0, 1(a0)17; RV32I-NEXT: li a1, 718; RV32I-NEXT: bne a0, a1, .LBB0_319; RV32I-NEXT: # %bb.2: # %if.end20; RV32I-NEXT: li a0, 021; RV32I-NEXT: ret22; RV32I-NEXT: .LBB0_3: # %if.then23; RV32I-NEXT: li a0, 124; RV32I-NEXT: ret25entry:26 %0 = load i8, ptr @bytes, align 127 %cmp = icmp eq i8 %0, -12028 %1 = load i8, ptr getelementptr inbounds ([5 x i8], ptr @bytes, i32 0, i32 1), align 129 %cmp3 = icmp eq i8 %1, 730 %or.cond = and i1 %cmp, %cmp331 br i1 %or.cond, label %if.end, label %if.then32 33if.then:34 ret i32 135 36if.end:37 ret i32 038}39 40@shorts = dso_local global [5 x i16] zeroinitializer, align 241 42define dso_local i32 @test_zext_i16() nounwind {43; RV32I-LABEL: test_zext_i16:44; RV32I: # %bb.0: # %entry45; RV32I-NEXT: lui a0, %hi(shorts)46; RV32I-NEXT: addi a0, a0, %lo(shorts)47; RV32I-NEXT: lhu a1, 0(a0)48; RV32I-NEXT: lui a2, 1649; RV32I-NEXT: addi a2, a2, -12050; RV32I-NEXT: bne a1, a2, .LBB1_351; RV32I-NEXT: # %bb.1: # %entry52; RV32I-NEXT: lhu a0, 2(a0)53; RV32I-NEXT: li a1, 754; RV32I-NEXT: bne a0, a1, .LBB1_355; RV32I-NEXT: # %bb.2: # %if.end56; RV32I-NEXT: li a0, 057; RV32I-NEXT: ret58; RV32I-NEXT: .LBB1_3: # %if.then59; RV32I-NEXT: li a0, 160; RV32I-NEXT: ret61entry:62 %0 = load i16, ptr @shorts, align 263 %cmp = icmp eq i16 %0, -12064 %1 = load i16, ptr getelementptr inbounds ([5 x i16], ptr @shorts, i32 0, i32 1), align 265 %cmp3 = icmp eq i16 %1, 766 %or.cond = and i1 %cmp, %cmp367 br i1 %or.cond, label %if.end, label %if.then68 69if.then:70 ret i32 171 72if.end:73 ret i32 074}75