Skip to content

Commit 54c7ce2

Browse files
committed
Remove bfloat ABI workaround in atomic test
1 parent 93097b0 commit 54c7ce2

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

llvm/test/CodeGen/X86/atomic-non-integer.ll

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,7 @@ define void @store_bfloat(ptr %fptr, bfloat %v) {
854854
ret void
855855
}
856856

857-
; Work around issue #92899 by casting to float
858-
define float @load_bfloat(ptr %fptr) {
857+
define bfloat @load_bfloat(ptr %fptr) {
859858
; X86-SSE1-LABEL: load_bfloat:
860859
; X86-SSE1: # %bb.0:
861860
; X86-SSE1-NEXT: pushl %eax
@@ -871,30 +870,16 @@ define float @load_bfloat(ptr %fptr) {
871870
;
872871
; X86-SSE2-LABEL: load_bfloat:
873872
; X86-SSE2: # %bb.0:
874-
; X86-SSE2-NEXT: pushl %eax
875-
; X86-SSE2-NEXT: .cfi_def_cfa_offset 8
876873
; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
877874
; X86-SSE2-NEXT: movzwl (%eax), %eax
878-
; X86-SSE2-NEXT: shll $16, %eax
879-
; X86-SSE2-NEXT: movd %eax, %xmm0
880-
; X86-SSE2-NEXT: movd %xmm0, (%esp)
881-
; X86-SSE2-NEXT: flds (%esp)
882-
; X86-SSE2-NEXT: popl %eax
883-
; X86-SSE2-NEXT: .cfi_def_cfa_offset 4
875+
; X86-SSE2-NEXT: pinsrw $0, %eax, %xmm0
884876
; X86-SSE2-NEXT: retl
885877
;
886878
; X86-AVX-LABEL: load_bfloat:
887879
; X86-AVX: # %bb.0:
888-
; X86-AVX-NEXT: pushl %eax
889-
; X86-AVX-NEXT: .cfi_def_cfa_offset 8
890880
; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
891881
; X86-AVX-NEXT: movzwl (%eax), %eax
892-
; X86-AVX-NEXT: shll $16, %eax
893-
; X86-AVX-NEXT: vmovd %eax, %xmm0
894-
; X86-AVX-NEXT: vmovd %xmm0, (%esp)
895-
; X86-AVX-NEXT: flds (%esp)
896-
; X86-AVX-NEXT: popl %eax
897-
; X86-AVX-NEXT: .cfi_def_cfa_offset 4
882+
; X86-AVX-NEXT: vpinsrw $0, %eax, %xmm0, %xmm0
898883
; X86-AVX-NEXT: retl
899884
;
900885
; X86-NOSSE-LABEL: load_bfloat:
@@ -913,17 +898,14 @@ define float @load_bfloat(ptr %fptr) {
913898
; X64-SSE-LABEL: load_bfloat:
914899
; X64-SSE: # %bb.0:
915900
; X64-SSE-NEXT: movzwl (%rdi), %eax
916-
; X64-SSE-NEXT: shll $16, %eax
917-
; X64-SSE-NEXT: movd %eax, %xmm0
901+
; X64-SSE-NEXT: pinsrw $0, %eax, %xmm0
918902
; X64-SSE-NEXT: retq
919903
;
920904
; X64-AVX-LABEL: load_bfloat:
921905
; X64-AVX: # %bb.0:
922906
; X64-AVX-NEXT: movzwl (%rdi), %eax
923-
; X64-AVX-NEXT: shll $16, %eax
924-
; X64-AVX-NEXT: vmovd %eax, %xmm0
907+
; X64-AVX-NEXT: vpinsrw $0, %eax, %xmm0, %xmm0
925908
; X64-AVX-NEXT: retq
926909
%v = load atomic bfloat, ptr %fptr unordered, align 2
927-
%ext = fpext bfloat %v to float
928-
ret float %ext
910+
ret bfloat %v
929911
}

0 commit comments

Comments
 (0)