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

232 lines
6.1 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
; RUN: llc -mtriple=x86_64-linux -mcpu=atom < %s | FileCheck %s
; RUN: llc -mtriple=x86_64-linux -mcpu=slm < %s | FileCheck %s -check-prefix=SLM
; RUN: llc -mtriple=x86_64-linux -mattr=+egpr,+ndd,+prefer-ndd-mem,+movbe < %s | FileCheck %s -check-prefix=EGPR
; RUN: llc -mtriple=x86_64-linux -mattr=+egpr,+ndd,-prefer-ndd-mem,+movbe < %s | FileCheck %s -check-prefix=EGPR
; RUN: llc -mtriple=x86_64-linux -mattr=+egpr,+ndd,+prefer-ndd-mem --show-mc-encoding < %s | FileCheck %s -check-prefix=NOMOVBE
declare i16 @llvm.bswap.i16(i16) nounwind readnone
declare i32 @llvm.bswap.i32(i32) nounwind readnone
declare i64 @llvm.bswap.i64(i64) nounwind readnone
define void @test1(ptr nocapture %x, i16 %y) nounwind {
; CHECK-LABEL: test1:
; CHECK: # %bb.0:
; CHECK-NEXT: movbew %si, (%rdi)
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: retq
;
; SLM-LABEL: test1:
; SLM: # %bb.0:
; SLM-NEXT: movbew %si, (%rdi)
; SLM-NEXT: retq
;
; EGPR-LABEL: test1:
; EGPR: # %bb.0:
; EGPR-NEXT: movbew %si, (%rdi)
; EGPR-NEXT: retq
;
; NOMOVBE-LABEL: test1:
; NOMOVBE: # %bb.0:
; NOMOVBE-NEXT: rolw $8, %si, %ax # encoding: [0x62,0xf4,0x7d,0x18,0xc1,0xc6,0x08]
; NOMOVBE-NEXT: movw %ax, (%rdi) # encoding: [0x66,0x89,0x07]
; NOMOVBE-NEXT: retq # encoding: [0xc3]
%bswap = call i16 @llvm.bswap.i16(i16 %y)
store i16 %bswap, ptr %x, align 2
ret void
}
define i16 @test2(ptr %x) nounwind {
; CHECK-LABEL: test2:
; CHECK: # %bb.0:
; CHECK-NEXT: movbew (%rdi), %ax
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: retq
;
; SLM-LABEL: test2:
; SLM: # %bb.0:
; SLM-NEXT: movbew (%rdi), %ax
; SLM-NEXT: retq
;
; EGPR-LABEL: test2:
; EGPR: # %bb.0:
; EGPR-NEXT: movbew (%rdi), %ax
; EGPR-NEXT: retq
;
; NOMOVBE-LABEL: test2:
; NOMOVBE: # %bb.0:
; NOMOVBE-NEXT: rolw $8, (%rdi), %ax # encoding: [0x62,0xf4,0x7d,0x18,0xc1,0x07,0x08]
; NOMOVBE-NEXT: retq # encoding: [0xc3]
%load = load i16, ptr %x, align 2
%bswap = call i16 @llvm.bswap.i16(i16 %load)
ret i16 %bswap
}
define void @test3(ptr nocapture %x, i32 %y) nounwind {
; CHECK-LABEL: test3:
; CHECK: # %bb.0:
; CHECK-NEXT: movbel %esi, (%rdi)
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: retq
;
; SLM-LABEL: test3:
; SLM: # %bb.0:
; SLM-NEXT: movbel %esi, (%rdi)
; SLM-NEXT: retq
;
; EGPR-LABEL: test3:
; EGPR: # %bb.0:
; EGPR-NEXT: movbel %esi, (%rdi)
; EGPR-NEXT: retq
;
; NOMOVBE-LABEL: test3:
; NOMOVBE: # %bb.0:
; NOMOVBE-NEXT: bswapl %esi # encoding: [0x0f,0xce]
; NOMOVBE-NEXT: movl %esi, (%rdi) # encoding: [0x89,0x37]
; NOMOVBE-NEXT: retq # encoding: [0xc3]
%bswap = call i32 @llvm.bswap.i32(i32 %y)
store i32 %bswap, ptr %x, align 4
ret void
}
define i32 @test4(ptr %x) nounwind {
; CHECK-LABEL: test4:
; CHECK: # %bb.0:
; CHECK-NEXT: movbel (%rdi), %eax
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: retq
;
; SLM-LABEL: test4:
; SLM: # %bb.0:
; SLM-NEXT: movbel (%rdi), %eax
; SLM-NEXT: retq
;
; EGPR-LABEL: test4:
; EGPR: # %bb.0:
; EGPR-NEXT: movbel (%rdi), %eax
; EGPR-NEXT: retq
;
; NOMOVBE-LABEL: test4:
; NOMOVBE: # %bb.0:
; NOMOVBE-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07]
; NOMOVBE-NEXT: bswapl %eax # encoding: [0x0f,0xc8]
; NOMOVBE-NEXT: retq # encoding: [0xc3]
%load = load i32, ptr %x, align 4
%bswap = call i32 @llvm.bswap.i32(i32 %load)
ret i32 %bswap
}
define void @test5(ptr %x, i64 %y) nounwind {
; CHECK-LABEL: test5:
; CHECK: # %bb.0:
; CHECK-NEXT: movbeq %rsi, (%rdi)
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: retq
;
; SLM-LABEL: test5:
; SLM: # %bb.0:
; SLM-NEXT: movbeq %rsi, (%rdi)
; SLM-NEXT: retq
;
; EGPR-LABEL: test5:
; EGPR: # %bb.0:
; EGPR-NEXT: movbeq %rsi, (%rdi)
; EGPR-NEXT: retq
;
; NOMOVBE-LABEL: test5:
; NOMOVBE: # %bb.0:
; NOMOVBE-NEXT: bswapq %rsi # encoding: [0x48,0x0f,0xce]
; NOMOVBE-NEXT: movq %rsi, (%rdi) # encoding: [0x48,0x89,0x37]
; NOMOVBE-NEXT: retq # encoding: [0xc3]
%bswap = call i64 @llvm.bswap.i64(i64 %y)
store i64 %bswap, ptr %x, align 8
ret void
}
define i64 @test6(ptr %x) nounwind {
; CHECK-LABEL: test6:
; CHECK: # %bb.0:
; CHECK-NEXT: movbeq (%rdi), %rax
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: retq
;
; SLM-LABEL: test6:
; SLM: # %bb.0:
; SLM-NEXT: movbeq (%rdi), %rax
; SLM-NEXT: retq
;
; EGPR-LABEL: test6:
; EGPR: # %bb.0:
; EGPR-NEXT: movbeq (%rdi), %rax
; EGPR-NEXT: retq
;
; NOMOVBE-LABEL: test6:
; NOMOVBE: # %bb.0:
; NOMOVBE-NEXT: movq (%rdi), %rax # encoding: [0x48,0x8b,0x07]
; NOMOVBE-NEXT: bswapq %rax # encoding: [0x48,0x0f,0xc8]
; NOMOVBE-NEXT: retq # encoding: [0xc3]
%load = load i64, ptr %x, align 8
%bswap = call i64 @llvm.bswap.i64(i64 %load)
ret i64 %bswap
}
define i64 @test7(i64 %x) nounwind {
; CHECK-LABEL: test7:
; CHECK: # %bb.0:
; CHECK-NEXT: movq %rdi, %rax
; CHECK-NEXT: bswapq %rax
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: retq
;
; SLM-LABEL: test7:
; SLM: # %bb.0:
; SLM-NEXT: movq %rdi, %rax
; SLM-NEXT: bswapq %rax
; SLM-NEXT: retq
;
; EGPR-LABEL: test7:
; EGPR: # %bb.0:
; EGPR-NEXT: movbeq %rdi, %rax
; EGPR-NEXT: retq
;
; NOMOVBE-LABEL: test7:
; NOMOVBE: # %bb.0:
; NOMOVBE-NEXT: movq %rdi, %rax # encoding: [0x48,0x89,0xf8]
; NOMOVBE-NEXT: bswapq %rax # encoding: [0x48,0x0f,0xc8]
; NOMOVBE-NEXT: retq # encoding: [0xc3]
%bswap = call i64 @llvm.bswap.i64(i64 %x)
ret i64 %bswap
}