218 lines
6.0 KiB
LLVM
218 lines
6.0 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc -verify-machineinstrs < %s | FileCheck %s
|
|
|
|
target datalayout = "E-m:a-p:32:32-i64:64-n32"
|
|
target triple = "powerpc-ibm-aix7.2.0.0"
|
|
|
|
%struct.USST = type { i16, i16 }
|
|
%struct.SST = type { i16, i16 }
|
|
%struct.CST = type { i8, i8 }
|
|
%struct.SCST = type { i8, i8 }
|
|
%struct.ST = type { i32, i32 }
|
|
%struct.UST = type { i32, i32 }
|
|
|
|
; Function Attrs: nounwind
|
|
define i32 @ustc1(%struct.USST* noundef byval(%struct.USST) align 4 %s) {
|
|
; CHECK-LABEL: ustc1:
|
|
; CHECK: # %bb.0: # %entry
|
|
; CHECK-NEXT: stw 3, 24(1)
|
|
; CHECK-NEXT: lbz 3, 24(1)
|
|
; CHECK-NEXT: blr
|
|
entry:
|
|
%a = getelementptr inbounds %struct.USST, %struct.USST* %s, i32 0, i32 0
|
|
%0 = load i16, i16* %a, align 4
|
|
%conv = zext i16 %0 to i32
|
|
%shr = ashr i32 %conv, 8
|
|
ret i32 %shr
|
|
}
|
|
|
|
; Function Attrs: nounwind
|
|
define i32 @ustc2(%struct.USST* noundef byval(%struct.USST) align 4 %s) {
|
|
; CHECK-LABEL: ustc2:
|
|
; CHECK: # %bb.0: # %entry
|
|
; CHECK-NEXT: stw 3, 24(1)
|
|
; CHECK-NEXT: lhz 3, 24(1)
|
|
; CHECK-NEXT: blr
|
|
entry:
|
|
%a = getelementptr inbounds %struct.USST, %struct.USST* %s, i32 0, i32 0
|
|
%0 = load i16, i16* %a, align 4
|
|
%conv = zext i16 %0 to i32
|
|
ret i32 %conv
|
|
}
|
|
|
|
; Function Attrs: nounwind
|
|
define i32 @stc1(%struct.SST* noundef byval(%struct.SST) align 4 %s) {
|
|
; CHECK-LABEL: stc1:
|
|
; CHECK: # %bb.0: # %entry
|
|
; CHECK-NEXT: stw 3, 24(1)
|
|
; CHECK-NEXT: lbz 3, 24(1)
|
|
; CHECK-NEXT: extsb 3, 3
|
|
; CHECK-NEXT: blr
|
|
entry:
|
|
%a = getelementptr inbounds %struct.SST, %struct.SST* %s, i32 0, i32 0
|
|
%0 = load i16, i16* %a, align 4
|
|
%conv = sext i16 %0 to i32
|
|
%shr = ashr i32 %conv, 8
|
|
ret i32 %shr
|
|
}
|
|
|
|
; Function Attrs: nounwind
|
|
define i32 @stc2(%struct.SST* noundef byval(%struct.SST) align 4 %s) {
|
|
; CHECK-LABEL: stc2:
|
|
; CHECK: # %bb.0: # %entry
|
|
; CHECK-NEXT: stw 3, 24(1)
|
|
; CHECK-NEXT: lha 3, 24(1)
|
|
; CHECK-NEXT: blr
|
|
entry:
|
|
%a = getelementptr inbounds %struct.SST, %struct.SST* %s, i32 0, i32 0
|
|
%0 = load i16, i16* %a, align 4
|
|
%conv = sext i16 %0 to i32
|
|
ret i32 %conv
|
|
}
|
|
|
|
; Function Attrs: nounwind
|
|
define i32 @ctc(%struct.CST* noundef byval(%struct.CST) align 4 %s) {
|
|
; CHECK-LABEL: ctc:
|
|
; CHECK: # %bb.0: # %entry
|
|
; CHECK-NEXT: stw 3, 24(1)
|
|
; CHECK-NEXT: lbz 3, 24(1)
|
|
; CHECK-NEXT: blr
|
|
entry:
|
|
%a = getelementptr inbounds %struct.CST, %struct.CST* %s, i32 0, i32 0
|
|
%0 = load i8, i8* %a, align 4
|
|
%conv = zext i8 %0 to i32
|
|
ret i32 %conv
|
|
}
|
|
|
|
; Function Attrs: nounwind
|
|
define i32 @sctc(%struct.SCST* noundef byval(%struct.SCST) align 4 %s) {
|
|
; CHECK-LABEL: sctc:
|
|
; CHECK: # %bb.0: # %entry
|
|
; CHECK-NEXT: stw 3, 24(1)
|
|
; CHECK-NEXT: lbz 3, 24(1)
|
|
; CHECK-NEXT: extsb 3, 3
|
|
; CHECK-NEXT: blr
|
|
entry:
|
|
%a = getelementptr inbounds %struct.SCST, %struct.SCST* %s, i32 0, i32 0
|
|
%0 = load i8, i8* %a, align 4
|
|
%conv = sext i8 %0 to i32
|
|
ret i32 %conv
|
|
}
|
|
|
|
; Function Attrs: nounwind
|
|
define i32 @tc44(%struct.ST* noundef byval(%struct.ST) align 4 %s) {
|
|
; CHECK-LABEL: tc44:
|
|
; CHECK: # %bb.0: # %entry
|
|
; CHECK-NEXT: stw 3, 24(1)
|
|
; CHECK-NEXT: stw 4, 28(1)
|
|
; CHECK-NEXT: blr
|
|
entry:
|
|
%a = getelementptr inbounds %struct.ST, %struct.ST* %s, i32 0, i32 0
|
|
%0 = load i32, i32* %a, align 4
|
|
ret i32 %0
|
|
}
|
|
|
|
; Function Attrs: nounwind
|
|
define i32 @tc41(%struct.ST* noundef byval(%struct.ST) align 4 %s) {
|
|
; CHECK-LABEL: tc41:
|
|
; CHECK: # %bb.0: # %entry
|
|
; CHECK-NEXT: stw 3, 24(1)
|
|
; CHECK-NEXT: lbz 3, 24(1)
|
|
; CHECK-NEXT: stw 4, 28(1)
|
|
; CHECK-NEXT: extsb 3, 3
|
|
; CHECK-NEXT: blr
|
|
entry:
|
|
%a = getelementptr inbounds %struct.ST, %struct.ST* %s, i32 0, i32 0
|
|
%0 = load i32, i32* %a, align 4
|
|
%shr = ashr i32 %0, 24
|
|
ret i32 %shr
|
|
}
|
|
|
|
; Function Attrs: nounwind
|
|
define i32 @tc42(%struct.ST* noundef byval(%struct.ST) align 4 %s) {
|
|
; CHECK-LABEL: tc42:
|
|
; CHECK: # %bb.0: # %entry
|
|
; CHECK-NEXT: stw 3, 24(1)
|
|
; CHECK-NEXT: lha 3, 24(1)
|
|
; CHECK-NEXT: stw 4, 28(1)
|
|
; CHECK-NEXT: blr
|
|
entry:
|
|
%a = getelementptr inbounds %struct.ST, %struct.ST* %s, i32 0, i32 0
|
|
%0 = load i32, i32* %a, align 4
|
|
%shr = ashr i32 %0, 16
|
|
ret i32 %shr
|
|
}
|
|
|
|
; Function Attrs: nounwind
|
|
define i32 @tc43(%struct.ST* noundef byval(%struct.ST) align 4 %s) {
|
|
; CHECK-LABEL: tc43:
|
|
; CHECK: # %bb.0: # %entry
|
|
; CHECK-NEXT: stw 3, 24(1)
|
|
; CHECK-NEXT: srawi 3, 3, 8
|
|
; CHECK-NEXT: stw 4, 28(1)
|
|
; CHECK-NEXT: blr
|
|
entry:
|
|
%a = getelementptr inbounds %struct.ST, %struct.ST* %s, i32 0, i32 0
|
|
%0 = load i32, i32* %a, align 4
|
|
%shr = ashr i32 %0, 8
|
|
ret i32 %shr
|
|
}
|
|
|
|
; Function Attrs: nounwind
|
|
define i32 @utc44(%struct.UST* noundef byval(%struct.UST) align 4 %s) {
|
|
; CHECK-LABEL: utc44:
|
|
; CHECK: # %bb.0: # %entry
|
|
; CHECK-NEXT: stw 3, 24(1)
|
|
; CHECK-NEXT: stw 4, 28(1)
|
|
; CHECK-NEXT: blr
|
|
entry:
|
|
%a = getelementptr inbounds %struct.UST, %struct.UST* %s, i32 0, i32 0
|
|
%0 = load i32, i32* %a, align 4
|
|
ret i32 %0
|
|
}
|
|
|
|
; Function Attrs: nounwind
|
|
define i32 @utc41(%struct.UST* noundef byval(%struct.UST) align 4 %s) {
|
|
; CHECK-LABEL: utc41:
|
|
; CHECK: # %bb.0: # %entry
|
|
; CHECK-NEXT: stw 3, 24(1)
|
|
; CHECK-NEXT: lbz 3, 24(1)
|
|
; CHECK-NEXT: stw 4, 28(1)
|
|
; CHECK-NEXT: blr
|
|
entry:
|
|
%a = getelementptr inbounds %struct.UST, %struct.UST* %s, i32 0, i32 0
|
|
%0 = load i32, i32* %a, align 4
|
|
%shr = lshr i32 %0, 24
|
|
ret i32 %shr
|
|
}
|
|
|
|
; Function Attrs: nounwind
|
|
define i32 @utc42(%struct.UST* noundef byval(%struct.UST) align 4 %s) {
|
|
; CHECK-LABEL: utc42:
|
|
; CHECK: # %bb.0: # %entry
|
|
; CHECK-NEXT: stw 3, 24(1)
|
|
; CHECK-NEXT: lhz 3, 24(1)
|
|
; CHECK-NEXT: stw 4, 28(1)
|
|
; CHECK-NEXT: blr
|
|
entry:
|
|
%a = getelementptr inbounds %struct.UST, %struct.UST* %s, i32 0, i32 0
|
|
%0 = load i32, i32* %a, align 4
|
|
%shr = lshr i32 %0, 16
|
|
ret i32 %shr
|
|
}
|
|
|
|
; Function Attrs: nounwind
|
|
define i32 @utc43(%struct.UST* noundef byval(%struct.UST) align 4 %s) {
|
|
; CHECK-LABEL: utc43:
|
|
; CHECK: # %bb.0: # %entry
|
|
; CHECK-NEXT: stw 3, 24(1)
|
|
; CHECK-NEXT: srwi 3, 3, 8
|
|
; CHECK-NEXT: stw 4, 28(1)
|
|
; CHECK-NEXT: blr
|
|
entry:
|
|
%a = getelementptr inbounds %struct.UST, %struct.UST* %s, i32 0, i32 0
|
|
%0 = load i32, i32* %a, align 4
|
|
%shr = lshr i32 %0, 8
|
|
ret i32 %shr
|
|
}
|