-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[X86][GlobalISel] - Legalize And Select of G_FPTOSI/G_SITOFP in X87 mode #137377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1415d66
2dcb057
1ca8ff2
4d9944d
c62687d
10bc9bf
1e910d3
c1bb7af
919c934
9821d76
19b359e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -844,13 +844,24 @@ def X86fldf80 : PatFrag<(ops node:$ptr), (X86fld node:$ptr), [{ | |
|
||
def X86fild16 : PatFrag<(ops node:$ptr), (X86fild node:$ptr), [{ | ||
return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i16; | ||
}]>; | ||
}]> { | ||
let IsLoad = true; | ||
let MemoryVT = i16; | ||
} | ||
|
||
def X86fild32 : PatFrag<(ops node:$ptr), (X86fild node:$ptr), [{ | ||
return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i32; | ||
}]>; | ||
}]> { | ||
let IsLoad = true; | ||
let MemoryVT = i32; | ||
} | ||
|
||
def X86fild64 : PatFrag<(ops node:$ptr), (X86fild node:$ptr), [{ | ||
return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i64; | ||
}]>; | ||
}]> { | ||
let IsLoad = true; | ||
let MemoryVT = i64; | ||
} | ||
|
||
def X86fist32 : PatFrag<(ops node:$val, node:$ptr), | ||
(X86fist node:$val, node:$ptr), [{ | ||
|
@@ -865,15 +876,26 @@ def X86fist64 : PatFrag<(ops node:$val, node:$ptr), | |
def X86fp_to_i16mem : PatFrag<(ops node:$val, node:$ptr), | ||
(X86fp_to_mem node:$val, node:$ptr), [{ | ||
return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i16; | ||
}]>; | ||
}]> { | ||
let IsStore = true; | ||
let MemoryVT = i16; | ||
} | ||
|
||
def X86fp_to_i32mem : PatFrag<(ops node:$val, node:$ptr), | ||
(X86fp_to_mem node:$val, node:$ptr), [{ | ||
return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i32; | ||
}]>; | ||
}]> { | ||
let IsStore = true; | ||
let MemoryVT = i32; | ||
} | ||
|
||
def X86fp_to_i64mem : PatFrag<(ops node:$val, node:$ptr), | ||
(X86fp_to_mem node:$val, node:$ptr), [{ | ||
return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i64; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I expected that we don't need SDAG predicate as well, do we? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The memory type should replace this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel that should be done in a separate PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm ok with both options. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you, I will address this in a separate PR. |
||
}]>; | ||
}]> { | ||
let IsStore = true; | ||
let MemoryVT = i64; | ||
} | ||
|
||
//===----------------------------------------------------------------------===// | ||
// FPStack pattern fragments | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//===- X86InstrGISel.td - X86 GISel target specific opcodes -*- tablegen -*===// | ||
// | ||
// Part of the LLVM Project, 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// X86 GlobalISel target pseudo instruction definitions. This is kept | ||
// separately from the other tablegen files for organizational purposes, but | ||
// share the same infrastructure. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
class X86GenericInstruction : GenericInstruction { let Namespace = "X86"; } | ||
|
||
def G_FILD : X86GenericInstruction { | ||
let OutOperandList = (outs type0:$dst); | ||
let InOperandList = (ins ptype1:$src); | ||
let hasSideEffects = false; | ||
let mayLoad = true; | ||
} | ||
def G_FIST : X86GenericInstruction { | ||
let OutOperandList = (outs); | ||
let InOperandList = (ins type0:$src1, ptype1:$src2); | ||
let hasSideEffects = false; | ||
let mayStore = true; | ||
} | ||
|
||
def : GINodeEquiv<G_FILD, X86fild>; | ||
def : GINodeEquiv<G_FIST, X86fp_to_mem>; |
Uh oh!
There was an error while loading. Please reload this page.