blob: ec5dc611105d0c1f0c51692421672bca28a05e32 [file] [log] [blame]
Colin LeMahieub8575b12015-06-13 21:46:39 +00001; RUN: llc -march=hexagon < %s | FileCheck %s
Krzysztof Parzyszeka72fad92017-02-10 15:33:13 +00002; CHECK: r{{[0-9]+}} = add(r{{[0-9]+}}.{{L|l}},r{{[0-9]+}}.{{H|h}})
Colin LeMahieub8575b12015-06-13 21:46:39 +00003
4target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a0:0-n16:32"
5target triple = "hexagon-unknown-none"
6
Colin LeMahieub8575b12015-06-13 21:46:39 +00007
Sjoerd Meijer724023a2016-09-14 08:20:03 +00008define i32 @foo(i16 %a, i32 %b) #0 {
9 %and = and i16 %a, -4
Colin LeMahieub8575b12015-06-13 21:46:39 +000010 %conv3 = sext i16 %and to i32
Sjoerd Meijer724023a2016-09-14 08:20:03 +000011 %add13 = mul i32 %b, 65536
Colin LeMahieub8575b12015-06-13 21:46:39 +000012 %sext = add i32 %add13, 262144
13 %phitmp = ashr exact i32 %sext, 16
Sjoerd Meijer724023a2016-09-14 08:20:03 +000014 ret i32 %phitmp
Sjoerd Meijer520a18d2016-09-13 08:51:59 +000015}
Sjoerd Meijer05453992016-09-13 08:08:06 +000016
Sjoerd Meijer724023a2016-09-14 08:20:03 +000017
Colin LeMahieub8575b12015-06-13 21:46:39 +000018attributes #0 = { nounwind readonly "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
19
20!0 = !{!"short", !1}
21!1 = !{!"omnipotent char", !2}
22!2 = !{!"Simple C/C++ TBAA"}
23!3 = !{!"any pointer", !1}