[llvm] [X86][GlobalIsel] support G_FABS for f80 (PR #136718)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 23 23:31:00 PDT 2025
================
@@ -0,0 +1,52 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -global-isel=0 -mattr=+x87,+sse,+sse2 -o - | FileCheck %s --check-prefix=X64
+; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -global-isel=1 -mattr=+x87,+sse,+sse2 -o - | FileCheck %s -check-prefixes=GISEL
+
+define float @test_float_abs(float %arg) {
+; X64-LABEL: test_float_abs:
+; X64: # %bb.0:
+; X64-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
+; X64-NEXT: retq
+;
+; GISEL-LABEL: test_float_abs:
+; GISEL: # %bb.0:
+; GISEL-NEXT: movd %xmm0, %eax
+; GISEL-NEXT: andl $2147483647, %eax # imm = 0x7FFFFFFF
+; GISEL-NEXT: movd %eax, %xmm0
+; GISEL-NEXT: retq
+ %abs = tail call float @llvm.fabs.f32(float %arg)
+ ret float %abs
+}
+
+define double @test_double_abs(double %arg) {
+; X64-LABEL: test_double_abs:
+; X64: # %bb.0:
+; X64-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
+; X64-NEXT: retq
+;
+; GISEL-LABEL: test_double_abs:
+; GISEL: # %bb.0:
+; GISEL-NEXT: movabsq $9223372036854775807, %rax # imm = 0x7FFFFFFFFFFFFFFF
----------------
mahesh-attarde wrote:
@e-kud is that expected with Global Pointer ?
https://github.com/llvm/llvm-project/pull/136718
More information about the llvm-commits
mailing list