[llvm] XCore: Add test for sincos and exp10 intrinsics (PR #148621)

Nigel Perks via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 14 06:03:34 PDT 2025


================
@@ -0,0 +1,71 @@
+; RUN: llc -mtriple=xcore-unknown-unknown < %s | FileCheck %s
+; RUN: llc -mtriple=xcore-none-linux < %s | FileCheck %s
+; RUN: llc -mtriple=xcore-none-linux-gnu < %s | FileCheck %s
+
+; CHECK-LABEL: exp10_f16:
+; CHECK: bl __extendhfsf2
+; CHECK: bl exp10f
+; CHECK: bl __truncsfhf2
+define half @exp10_f16(half %x) #0 {
+  %r = call half @llvm.exp10.f16(half %x)
+  ret half %r
+}
+
+; CHECK-LABEL: exp10_v2f16:
+; CHECK: bl __extendhfsf2
+; CHECK: bl __extendhfsf2
+; CHECK: bl exp10f
+; CHECK: bl exp10f
+; CHECK: bl __truncsfhf2
+; CHECK: bl __truncsfhf2
+define <2 x half> @exp10_v2f16(<2 x half> %x) #0 {
+  %r = call <2 x half> @llvm.exp10.v2f16(<2 x half> %x)
+  ret <2 x half> %r
+}
+
+; CHECK-LABEL: exp10_f32:
+; CHECK: bl exp10f
+define float @exp10_f32(float %x) #0 {
+  %r = call float @llvm.exp10.f32(float %x)
+  ret float %r
+}
+
+; CHECK-LABEL: exp10_v2f32:
+; CHECK: bl exp10f
+; CHECK: bl exp10f
+define <2 x float> @exp10_v2f32(<2 x float> %x) #0 {
+  %r = call <2 x float> @llvm.exp10.v2f32(<2 x float> %x)
+  ret <2 x float> %r
----------------
nigelp-xmos wrote:

Sorry I haven't had much to do with vectors. We don't work with them on XCore. Is there a reason to test this, for generic LLVM reasons?

https://github.com/llvm/llvm-project/pull/148621


More information about the llvm-commits mailing list