[Hexagon] Adding intrinsics for doubleword ALU operations.
[oota-llvm.git] / test / CodeGen / Hexagon / intrinsics-alu32_3op.ll
1 ; RUN: llc < %s | FileCheck %s
2
3 target datalayout = "e-m:e-p:32:32-i1:32-i64:64-a:0-v32:32-n16:32"
4 target triple = "hexagon"
5
6 ; CHECK: test13:
7 ; CHECK: r{{[0-9]+}} = add(r{{[0-9]+}}, r{{[0-9]+}}):sat
8 define i32 @test13(i32 %Rs, i32 %Rt) #0 {
9 entry:
10   %0 = tail call i32 @llvm.hexagon.A2.addsat(i32 %Rs, i32 %Rt)
11   ret i32 %0
12 }
13
14
15 ; CHECK: test14:
16 ; CHECK: r{{[0-9]+}} = sub(r{{[0-9]+}}, r{{[0-9]+}}):sat
17 define i32 @test14(i32 %Rs, i32 %Rt) #0 {
18 entry:
19   %0 = tail call i32 @llvm.hexagon.A2.subsat(i32 %Rs, i32 %Rt)
20   ret i32 %0
21 }
22
23
24 ; CHECK: test61:
25 ; CHECK: r{{[0-9]+:[0-9]+}} = packhl(r{{[0-9]+}}, r{{[0-9]+}})
26 define i64 @test61(i32 %Rs, i32 %Rt) #0 {
27 entry:
28   %0 = tail call i64 @llvm.hexagon.S2.packhl(i32 %Rs, i32 %Rt)
29   ret i64 %0
30 }
31
32 declare i32 @llvm.hexagon.A2.addsat(i32, i32) #1
33 declare i32 @llvm.hexagon.A2.subsat(i32, i32) #1
34 declare i64 @llvm.hexagon.S2.packhl(i32, i32) #1