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

58 lines
1.4 KiB
LLVM

; RUN: llc -mtriple=hexagon < %s | FileCheck %s
target triple = "hexagon"
; CHECK-LABEL: xh_sh
; CHECK: sath
; CHECK-NOT: sxth
define i32 @xh_sh(i32 %x) local_unnamed_addr #0 {
entry:
%0 = tail call i32 @llvm.hexagon.A2.sath(i32 %x)
%1 = tail call i32 @llvm.hexagon.A2.sxth(i32 %0)
ret i32 %1
}
; CHECK-LABEL: xb_sb
; CHECK: satb
; CHECK-NOT: sxtb
define i32 @xb_sb(i32 %x) local_unnamed_addr #0 {
entry:
%0 = tail call i32 @llvm.hexagon.A2.satb(i32 %x)
%1 = tail call i32 @llvm.hexagon.A2.sxtb(i32 %0)
ret i32 %1
}
; CHECK-LABEL: xuh_suh
; CHECK: satuh
; CHECK-NOT: zxth
define i32 @xuh_suh(i32 %x) local_unnamed_addr #0 {
entry:
%0 = tail call i32 @llvm.hexagon.A2.satuh(i32 %x)
%1 = tail call i32 @llvm.hexagon.A2.zxth(i32 %0)
ret i32 %1
}
; CHECK-LABEL: xub_sub
; CHECK: satub
; CHECK-NOT: zxtb
define i32 @xub_sub(i32 %x) local_unnamed_addr #0 {
entry:
%0 = tail call i32 @llvm.hexagon.A2.satub(i32 %x)
%1 = tail call i32 @llvm.hexagon.A2.zxtb(i32 %0)
ret i32 %1
}
declare i32 @llvm.hexagon.A2.sxtb(i32) #1
declare i32 @llvm.hexagon.A2.sxth(i32) #1
declare i32 @llvm.hexagon.A2.zxtb(i32) #1
declare i32 @llvm.hexagon.A2.zxth(i32) #1
declare i32 @llvm.hexagon.A2.satb(i32) #1
declare i32 @llvm.hexagon.A2.sath(i32) #1
declare i32 @llvm.hexagon.A2.satub(i32) #1
declare i32 @llvm.hexagon.A2.satuh(i32) #1
attributes #0 = { nounwind readnone "target-cpu"="hexagonv60" "target-features"="-hvx,-long-calls" }
attributes #1 = { nounwind readnone }