Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/Hexagon/mapped_intrinsics.ll
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

114 lines
3.7 KiB
LLVM

; RUN: llc -mtriple=hexagon -debug-only=isel < %s 2>&1 | FileCheck %s
; REQUIRES: asserts
; This test validates that ISel picks the correct equivalent of below mentioned intrinsics
; For S2_asr_i_r_rnd_goodsyntax:
; if (#u5 == 0) Assembler mapped to: Rd = Rs
; else Rd = asr(Rs,#u5-1):rnd
; For S2_asr_i_p_rnd_goodsyntax:
; if (#u6 == 0) Assembler mapped to: Rdd = combine(Rss.H32,Rss.L32)
; else Rdd = asr(Rss,#u6-1):rnd
; For S5_vasrhrnd_goodsyntax:
; if (#u4 == 0) Assembler mapped to: Rdd = combine(Rss.H32,Rss.L32)
; else Rdd = vasrh(Rss,#u4-1):raw
; For S5_asrhub_rnd_sat_goodsyntax:
; if (#u4 == 0) Assembler mapped to: Rd = vsathub(Rss)
; else Rd = vasrhub(Rss,#u4-1):raw
target triple = "hexagon-unknown--elf"
; CHECK-LABEL: f0
; CHECK: ISEL: Starting selection on{{.*}}llvm.hexagon.S2.asr.i.r.rnd.goodsyntax
; CHECK: Morphed node{{.*}}A2_tfr
define i32 @f0(i32 %a0, i32 %a1) local_unnamed_addr #0 {
b0:
%v0 = tail call i32 @llvm.hexagon.S2.asr.i.r.rnd.goodsyntax(i32 %a0, i32 0)
%v1 = add i32 %v0, %a1
ret i32 %v1
}
declare i32 @llvm.hexagon.S2.asr.i.r.rnd.goodsyntax(i32, i32) #1
; CHECK-LABEL: f1
; CHECK: ISEL: Starting selection on{{.*}}llvm.hexagon.S2.asr.i.r.rnd.goodsyntax
; CHECK: Morphed node{{.*}}S2_asr_i_r_rnd
define i32 @f1(i32 %a0, i32 %a1) local_unnamed_addr #0 {
b0:
%v0 = tail call i32 @llvm.hexagon.S2.asr.i.r.rnd.goodsyntax(i32 %a0, i32 9)
%v1 = add i32 %v0, %a1
ret i32 %v1
}
; CHECK-LABEL: f2
; CHECK: ISEL: Starting selection on{{.*}}llvm.hexagon.S2.asr.i.p.rnd.goodsyntax
; CHECK: Morphed node{{.*}}A2_combinew
define i64 @f2(i64 %a0, i32 %a1) local_unnamed_addr #0 {
b0:
%v0 = zext i32 %a1 to i64
%v1 = tail call i64 @llvm.hexagon.S2.asr.i.p.rnd.goodsyntax(i64 %a0, i32 0)
%v2 = add nsw i64 %v1, %v0
ret i64 %v2
}
declare i64 @llvm.hexagon.S2.asr.i.p.rnd.goodsyntax(i64, i32) #1
; CHECK-LABEL: f3
; CHECK: ISEL: Starting selection on{{.*}}llvm.hexagon.S2.asr.i.p.rnd.goodsyntax
; CHECK: Morphed node{{.*}}S2_asr_i_p_rnd
define i64 @f3(i64 %a0, i32 %a1) local_unnamed_addr #0 {
b0:
%v0 = zext i32 %a1 to i64
%v1 = tail call i64 @llvm.hexagon.S2.asr.i.p.rnd.goodsyntax(i64 %a0, i32 9)
%v2 = add nsw i64 %v1, %v0
ret i64 %v2
}
; CHECK-LABEL: f4
; CHECK: ISEL: Starting selection on{{.*}}llvm.hexagon.S5.asrhub.rnd.sat.goodsyntax
; CHECK: Morphed node{{.*}}S2_vsathub
define i32 @f4(i64 %a0, i32 %a1) local_unnamed_addr #0 {
b0:
%v0 = tail call i32 @llvm.hexagon.S5.asrhub.rnd.sat.goodsyntax(i64 %a0, i32 0)
%v1 = add i32 %v0, %a1
ret i32 %v1
}
declare i32 @llvm.hexagon.S5.asrhub.rnd.sat.goodsyntax(i64, i32) #1
; CHECK-LABEL: f5
; CHECK: ISEL: Starting selection on{{.*}}llvm.hexagon.S5.asrhub.rnd.sat.goodsyntax
; CHECK: Morphed node{{.*}}S5_asrhub_rnd_sat
define i32 @f5(i64 %a0, i32 %a1) local_unnamed_addr #0 {
b0:
%v0 = tail call i32 @llvm.hexagon.S5.asrhub.rnd.sat.goodsyntax(i64 %a0, i32 9)
%v1 = add i32 %v0, %a1
ret i32 %v1
}
; CHECK-LABEL: f6
; CHECK: ISEL: Starting selection on{{.*}}llvm.hexagon.S5.vasrhrnd.goodsyntax
; CHECK: Morphed node{{.*}}A2_combinew
define i64 @f6(i64 %a0, i32 %a1) local_unnamed_addr #0 {
b0:
%v0 = zext i32 %a1 to i64
%v1 = tail call i64 @llvm.hexagon.S5.vasrhrnd.goodsyntax(i64 %a0, i32 0)
%v2 = add nsw i64 %v1, %v0
ret i64 %v2
}
declare i64 @llvm.hexagon.S5.vasrhrnd.goodsyntax(i64, i32) #1
; CHECK-LABEL: f7
; CHECK: ISEL: Starting selection on{{.*}}llvm.hexagon.S5.vasrhrnd.goodsyntax
; CHECK: Morphed node{{.*}}S5_vasrhrnd
define i64 @f7(i64 %a0, i32 %a1) local_unnamed_addr #0 {
b0:
%v0 = zext i32 %a1 to i64
%v1 = tail call i64 @llvm.hexagon.S5.vasrhrnd.goodsyntax(i64 %a0, i32 9)
%v2 = add nsw i64 %v1, %v0
ret i64 %v2
}
attributes #0 = { nounwind readnone "target-cpu"="hexagonv60" }
attributes #1 = { nounwind readnone }