Fangrui Song 2208c97c1b [Hexagon,test] Change llc -march= to -mtriple=
Similar to 806761a7629df268c8aed49657aeccffa6bca449

-mtriple= specifies the full target triple while -march= merely sets the
architecture part of the default target triple, leaving a target triple which
may not make sense.

Therefore, -march= is error-prone and not recommended for tests without a target
triple. The issue has been benign as we recognize $unknown-apple-darwin as ELF instead
of rejecting it outrightly.
2024-12-15 10:20:22 -08:00

25 lines
688 B
LLVM

; RUN: llc -mtriple=hexagon < %s | FileCheck %s
; CHECK: r{{[0-9]+}} = sub(r{{[0-9]+}}.{{L|l}},r{{[0-9]+}}.{{L|l}})
; Function Attrs: nounwind readnone
define i64 @f0(i64 %a0, i16 zeroext %a1, i16 zeroext %a2) #0 {
b0:
%v0 = zext i16 %a1 to i32
%v1 = zext i16 %a2 to i32
%v2 = sub nsw i32 %v0, %v1
%v3 = shl i32 %v2, 16
%v4 = icmp slt i32 %v3, 65536
%v5 = ashr exact i32 %v3, 16
%v6 = select i1 %v4, i32 1, i32 %v5
%v7 = icmp sgt i32 %v6, 4
%v8 = add i32 %v6, 65535
%v9 = shl i64 %a0, 2
%v10 = and i32 %v8, 65535
%v11 = zext i32 %v10 to i64
%v12 = select i1 %v7, i64 3, i64 %v11
%v13 = or i64 %v12, %v9
ret i64 %v13
}
attributes #0 = { nounwind readnone }