brev_ld.ll
3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
; RUN: llc -march=hexagon < %s | FileCheck %s
; RUN: llc -march=hexagon -verify-machineinstrs=true < %s | FileCheck %s
; Testing bitreverse load intrinsics:
; Q6_bitrev_load_update_D(inputLR, pDelay, nConvLength);
; Q6_bitrev_load_update_W(inputLR, pDelay, nConvLength);
; Q6_bitrev_load_update_H(inputLR, pDelay, nConvLength);
; Q6_bitrev_load_update_UH(inputLR, pDelay, nConvLength);
; Q6_bitrev_load_update_UB(inputLR, pDelay, nConvLength);
; Q6_bitrev_load_update_B(inputLR, pDelay, nConvLength);
; producing these instructions:
; r3:2 = memd(r0++m0:brev)
; r1 = memw(r0++m0:brev)
; r1 = memh(r0++m0:brev)
; r1 = memuh(r0++m0:brev)
; r1 = memub(r0++m0:brev)
; r1 = memb(r0++m0:brev)
target datalayout = "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"
target triple = "hexagon-unknown--elf"
; CHECK: @call_brev_ldd
define i64* @call_brev_ldd(i64* %ptr, i64 %dst, i32 %mod) local_unnamed_addr #0 {
entry:
%0 = bitcast i64* %ptr to i8*
; CHECK: = memd(r{{[0-9]*}}++m{{[0-1]}}:brev)
%1 = tail call { i64, i8* } @llvm.hexagon.L2.loadrd.pbr(i8* %0, i32 %mod)
%2 = extractvalue { i64, i8* } %1, 1
%3 = bitcast i8* %2 to i64*
ret i64* %3
}
; CHECK: @call_brev_ldw
define i32* @call_brev_ldw(i32* %ptr, i32 %dst, i32 %mod) local_unnamed_addr #0 {
entry:
%0 = bitcast i32* %ptr to i8*
; CHECK: = memw(r{{[0-9]*}}++m{{[0-1]}}:brev)
%1 = tail call { i32, i8* } @llvm.hexagon.L2.loadri.pbr(i8* %0, i32 %mod)
%2 = extractvalue { i32, i8* } %1, 1
%3 = bitcast i8* %2 to i32*
ret i32* %3
}
; CHECK: @call_brev_ldh
define i16* @call_brev_ldh(i16* %ptr, i16 signext %dst, i32 %mod) local_unnamed_addr #0 {
entry:
%0 = bitcast i16* %ptr to i8*
; CHECK: = memh(r{{[0-9]*}}++m{{[0-1]}}:brev)
%1 = tail call { i32, i8* } @llvm.hexagon.L2.loadrh.pbr(i8* %0, i32 %mod)
%2 = extractvalue { i32, i8* } %1, 1
%3 = bitcast i8* %2 to i16*
ret i16* %3
}
; CHECK: @call_brev_lduh
define i16* @call_brev_lduh(i16* %ptr, i16 zeroext %dst, i32 %mod) local_unnamed_addr #0 {
entry:
%0 = bitcast i16* %ptr to i8*
; CHECK: = memuh(r{{[0-9]*}}++m{{[0-1]}}:brev)
%1 = tail call { i32, i8* } @llvm.hexagon.L2.loadruh.pbr(i8* %0, i32 %mod)
%2 = extractvalue { i32, i8* } %1, 1
%3 = bitcast i8* %2 to i16*
ret i16* %3
}
; CHECK: @call_brev_ldb
define i8* @call_brev_ldb(i8* %ptr, i8 signext %dst, i32 %mod) local_unnamed_addr #0 {
entry:
; CHECK: = memb(r{{[0-9]*}}++m{{[0-1]}}:brev)
%0 = tail call { i32, i8* } @llvm.hexagon.L2.loadrb.pbr(i8* %ptr, i32 %mod)
%1 = extractvalue { i32, i8* } %0, 1
ret i8* %1
}
; Function Attrs: nounwind readonly
; CHECK: @call_brev_ldub
define i8* @call_brev_ldub(i8* %ptr, i8 zeroext %dst, i32 %mod) local_unnamed_addr #0 {
entry:
; CHECK: = memub(r{{[0-9]*}}++m{{[0-1]}}:brev)
%0 = tail call { i32, i8* } @llvm.hexagon.L2.loadrub.pbr(i8* %ptr, i32 %mod)
%1 = extractvalue { i32, i8* } %0, 1
ret i8* %1
}
declare { i64, i8* } @llvm.hexagon.L2.loadrd.pbr(i8*, i32) #1
declare { i32, i8* } @llvm.hexagon.L2.loadri.pbr(i8*, i32) #1
declare { i32, i8* } @llvm.hexagon.L2.loadrh.pbr(i8*, i32) #1
declare { i32, i8* } @llvm.hexagon.L2.loadruh.pbr(i8*, i32) #1
declare { i32, i8* } @llvm.hexagon.L2.loadrb.pbr(i8*, i32) #1
declare { i32, i8* } @llvm.hexagon.L2.loadrub.pbr(i8*, i32) #1
attributes #0 = { nounwind readonly "target-cpu"="hexagonv60" }
attributes #1 = { nounwind readonly }