-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AIE2P] Instruction selection support for G_FADD/G_FSUB
- Loading branch information
1 parent
ed34d7c
commit b8f9873
Showing
3 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
llvm/test/CodeGen/AIE/aie2p/GlobalIsel/inst-select-fadd.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py | ||
# | ||
# This file is licensed under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# | ||
# (c) Copyright 2025 Advanced Micro Devices, Inc. or its affiliates | ||
|
||
# RUN: llc -mtriple aie2p -run-pass=instruction-select %s -verify-machineinstrs -o - | FileCheck %s | ||
|
||
|
||
--- | ||
name: test_fadd | ||
legalized: true | ||
regBankSelected: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.1.entry: | ||
liveins: $dm0, $dm1 | ||
; CHECK-LABEL: name: test_fadd | ||
; CHECK: liveins: $dm0, $dm1 | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:acc2048 = COPY $dm0 | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:acc2048 = COPY $dm1 | ||
; CHECK-NEXT: [[MOV_RLC_imm11_pseudo:%[0-9]+]]:er = MOV_RLC_imm11_pseudo 28 | ||
; CHECK-NEXT: [[VADD_f_vmac_cm2_add_reg:%[0-9]+]]:acc2048 = VADD_f_vmac_cm2_add_reg [[COPY]], [[COPY1]], [[MOV_RLC_imm11_pseudo]], implicit-def dead $srfpflags, implicit $crfpmask | ||
; CHECK-NEXT: $dm0 = COPY [[VADD_f_vmac_cm2_add_reg]] | ||
; CHECK-NEXT: PseudoRET implicit $lr, implicit $dm0 | ||
%0:accregbank(<64 x s32>) = COPY $dm0 | ||
%1:accregbank(<64 x s32>) = COPY $dm1 | ||
%2:accregbank(<64 x s32>) = G_FADD %0, %1 | ||
$dm0 = COPY %2:accregbank(<64 x s32>) | ||
PseudoRET implicit $lr, implicit $dm0 | ||
... |
34 changes: 34 additions & 0 deletions
34
llvm/test/CodeGen/AIE/aie2p/GlobalIsel/inst-select-fsub.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py | ||
# | ||
# This file is licensed under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# | ||
# (c) Copyright 2025 Advanced Micro Devices, Inc. or its affiliates | ||
|
||
# RUN: llc -mtriple aie2p -run-pass=instruction-select %s -verify-machineinstrs -o - | FileCheck %s | ||
|
||
|
||
--- | ||
name: test_fsub | ||
legalized: true | ||
regBankSelected: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.1.entry: | ||
liveins: $dm0, $dm1 | ||
; CHECK-LABEL: name: test_fsub | ||
; CHECK: liveins: $dm0, $dm1 | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:acc2048 = COPY $dm0 | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:acc2048 = COPY $dm1 | ||
; CHECK-NEXT: [[MOV_RLC_imm11_pseudo:%[0-9]+]]:er = MOV_RLC_imm11_pseudo 28 | ||
; CHECK-NEXT: [[VSUB_f_vmac_cm2_add_reg:%[0-9]+]]:acc2048 = VSUB_f_vmac_cm2_add_reg [[COPY]], [[COPY1]], [[MOV_RLC_imm11_pseudo]], implicit-def dead $srfpflags, implicit $crfpmask | ||
; CHECK-NEXT: $dm0 = COPY [[VSUB_f_vmac_cm2_add_reg]] | ||
; CHECK-NEXT: PseudoRET implicit $lr, implicit $dm0 | ||
%0:accregbank(<64 x s32>) = COPY $dm0 | ||
%1:accregbank(<64 x s32>) = COPY $dm1 | ||
%2:accregbank(<64 x s32>) = G_FSUB %0, %1 | ||
$dm0 = COPY %2:accregbank(<64 x s32>) | ||
PseudoRET implicit $lr, implicit $dm0 | ||
... |