Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/X86/widen_bitops-1.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

236 lines
5.8 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=i686-unknown -mattr=+sse4.2 | FileCheck %s --check-prefix=X86
; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse4.2 | FileCheck %s --check-prefix=X64
;
; AND/XOR/OR i32 as v4i8
;
define i32 @and_i32_as_v4i8(i32 %a, i32 %b) nounwind {
; X86-LABEL: and_i32_as_v4i8:
; X86: # %bb.0:
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: andl {{[0-9]+}}(%esp), %eax
; X86-NEXT: retl
;
; X64-LABEL: and_i32_as_v4i8:
; X64: # %bb.0:
; X64-NEXT: movl %edi, %eax
; X64-NEXT: andl %esi, %eax
; X64-NEXT: retq
%1 = bitcast i32 %a to <4 x i8>
%2 = bitcast i32 %b to <4 x i8>
%3 = and <4 x i8> %1, %2
%4 = bitcast <4 x i8> %3 to i32
ret i32 %4
}
define i32 @xor_i32_as_v4i8(i32 %a, i32 %b) nounwind {
; X86-LABEL: xor_i32_as_v4i8:
; X86: # %bb.0:
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: xorl {{[0-9]+}}(%esp), %eax
; X86-NEXT: retl
;
; X64-LABEL: xor_i32_as_v4i8:
; X64: # %bb.0:
; X64-NEXT: movl %edi, %eax
; X64-NEXT: xorl %esi, %eax
; X64-NEXT: retq
%1 = bitcast i32 %a to <4 x i8>
%2 = bitcast i32 %b to <4 x i8>
%3 = xor <4 x i8> %1, %2
%4 = bitcast <4 x i8> %3 to i32
ret i32 %4
}
define i32 @or_i32_as_v4i8(i32 %a, i32 %b) nounwind {
; X86-LABEL: or_i32_as_v4i8:
; X86: # %bb.0:
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: orl {{[0-9]+}}(%esp), %eax
; X86-NEXT: retl
;
; X64-LABEL: or_i32_as_v4i8:
; X64: # %bb.0:
; X64-NEXT: movl %edi, %eax
; X64-NEXT: orl %esi, %eax
; X64-NEXT: retq
%1 = bitcast i32 %a to <4 x i8>
%2 = bitcast i32 %b to <4 x i8>
%3 = or <4 x i8> %1, %2
%4 = bitcast <4 x i8> %3 to i32
ret i32 %4
}
;
; AND/XOR/OR i32 as v8i4
;
define i32 @and_i32_as_v8i4(i32 %a, i32 %b) nounwind {
; X86-LABEL: and_i32_as_v8i4:
; X86: # %bb.0:
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: andl {{[0-9]+}}(%esp), %eax
; X86-NEXT: retl
;
; X64-LABEL: and_i32_as_v8i4:
; X64: # %bb.0:
; X64-NEXT: movl %edi, %eax
; X64-NEXT: andl %esi, %eax
; X64-NEXT: retq
%1 = bitcast i32 %a to <8 x i4>
%2 = bitcast i32 %b to <8 x i4>
%3 = and <8 x i4> %1, %2
%4 = bitcast <8 x i4> %3 to i32
ret i32 %4
}
define i32 @xor_i32_as_v8i4(i32 %a, i32 %b) nounwind {
; X86-LABEL: xor_i32_as_v8i4:
; X86: # %bb.0:
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: xorl {{[0-9]+}}(%esp), %eax
; X86-NEXT: retl
;
; X64-LABEL: xor_i32_as_v8i4:
; X64: # %bb.0:
; X64-NEXT: movl %edi, %eax
; X64-NEXT: xorl %esi, %eax
; X64-NEXT: retq
%1 = bitcast i32 %a to <8 x i4>
%2 = bitcast i32 %b to <8 x i4>
%3 = xor <8 x i4> %1, %2
%4 = bitcast <8 x i4> %3 to i32
ret i32 %4
}
define i32 @or_i32_as_v8i4(i32 %a, i32 %b) nounwind {
; X86-LABEL: or_i32_as_v8i4:
; X86: # %bb.0:
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: orl {{[0-9]+}}(%esp), %eax
; X86-NEXT: retl
;
; X64-LABEL: or_i32_as_v8i4:
; X64: # %bb.0:
; X64-NEXT: movl %edi, %eax
; X64-NEXT: orl %esi, %eax
; X64-NEXT: retq
%1 = bitcast i32 %a to <8 x i4>
%2 = bitcast i32 %b to <8 x i4>
%3 = or <8 x i4> %1, %2
%4 = bitcast <8 x i4> %3 to i32
ret i32 %4
}
;
; AND/XOR/OR v4i8 as i32
;
define <4 x i8> @and_v4i8_as_i32(<4 x i8> %a, <4 x i8> %b) nounwind {
; X86-LABEL: and_v4i8_as_i32:
; X86: # %bb.0:
; X86-NEXT: andps %xmm1, %xmm0
; X86-NEXT: retl
;
; X64-LABEL: and_v4i8_as_i32:
; X64: # %bb.0:
; X64-NEXT: andps %xmm1, %xmm0
; X64-NEXT: retq
%1 = bitcast <4 x i8> %a to i32
%2 = bitcast <4 x i8> %b to i32
%3 = and i32 %1, %2
%4 = bitcast i32 %3 to <4 x i8>
ret <4 x i8> %4
}
define <4 x i8> @xor_v4i8_as_i32(<4 x i8> %a, <4 x i8> %b) nounwind {
; X86-LABEL: xor_v4i8_as_i32:
; X86: # %bb.0:
; X86-NEXT: xorps %xmm1, %xmm0
; X86-NEXT: retl
;
; X64-LABEL: xor_v4i8_as_i32:
; X64: # %bb.0:
; X64-NEXT: xorps %xmm1, %xmm0
; X64-NEXT: retq
%1 = bitcast <4 x i8> %a to i32
%2 = bitcast <4 x i8> %b to i32
%3 = xor i32 %1, %2
%4 = bitcast i32 %3 to <4 x i8>
ret <4 x i8> %4
}
define <4 x i8> @or_v4i8_as_i32(<4 x i8> %a, <4 x i8> %b) nounwind {
; X86-LABEL: or_v4i8_as_i32:
; X86: # %bb.0:
; X86-NEXT: orps %xmm1, %xmm0
; X86-NEXT: retl
;
; X64-LABEL: or_v4i8_as_i32:
; X64: # %bb.0:
; X64-NEXT: orps %xmm1, %xmm0
; X64-NEXT: retq
%1 = bitcast <4 x i8> %a to i32
%2 = bitcast <4 x i8> %b to i32
%3 = or i32 %1, %2
%4 = bitcast i32 %3 to <4 x i8>
ret <4 x i8> %4
}
;
; AND/XOR/OR v8i4 as i32
;
define <8 x i4> @and_v8i4_as_i32(<8 x i4> %a, <8 x i4> %b) nounwind {
; X86-LABEL: and_v8i4_as_i32:
; X86: # %bb.0:
; X86-NEXT: andps %xmm1, %xmm0
; X86-NEXT: retl
;
; X64-LABEL: and_v8i4_as_i32:
; X64: # %bb.0:
; X64-NEXT: andps %xmm1, %xmm0
; X64-NEXT: retq
%1 = bitcast <8 x i4> %a to i32
%2 = bitcast <8 x i4> %b to i32
%3 = and i32 %1, %2
%4 = bitcast i32 %3 to <8 x i4>
ret <8 x i4> %4
}
define <8 x i4> @xor_v8i4_as_i32(<8 x i4> %a, <8 x i4> %b) nounwind {
; X86-LABEL: xor_v8i4_as_i32:
; X86: # %bb.0:
; X86-NEXT: xorps %xmm1, %xmm0
; X86-NEXT: retl
;
; X64-LABEL: xor_v8i4_as_i32:
; X64: # %bb.0:
; X64-NEXT: xorps %xmm1, %xmm0
; X64-NEXT: retq
%1 = bitcast <8 x i4> %a to i32
%2 = bitcast <8 x i4> %b to i32
%3 = xor i32 %1, %2
%4 = bitcast i32 %3 to <8 x i4>
ret <8 x i4> %4
}
define <8 x i4> @or_v8i4_as_i32(<8 x i4> %a, <8 x i4> %b) nounwind {
; X86-LABEL: or_v8i4_as_i32:
; X86: # %bb.0:
; X86-NEXT: orps %xmm1, %xmm0
; X86-NEXT: retl
;
; X64-LABEL: or_v8i4_as_i32:
; X64: # %bb.0:
; X64-NEXT: orps %xmm1, %xmm0
; X64-NEXT: retq
%1 = bitcast <8 x i4> %a to i32
%2 = bitcast <8 x i4> %b to i32
%3 = or i32 %1, %2
%4 = bitcast i32 %3 to <8 x i4>
ret <8 x i4> %4
}