16 Commits

Author SHA1 Message Date
Chen Zheng
6a930e8891 1: use class instead of MVT
2: minor fix for the comments
2023-01-05 07:53:59 +00:00
Chen Zheng
ac93a4e77d [PowerPC][GISel]fcmp support
This patch also includes:
1: CRRegBank support
2: Some workarounds in PPC table gen for anyext/setcc patterns
   selection.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D140878
2023-01-05 07:45:29 +00:00
Kai Nacke
110340c687 [PowerPC][GIsel] Materialize i64 constants.
Adds support for i64 constant. It uses the same pattern-based
approach as in SDAG (see PPCISelDAGToDAG::selectI64ImmDirect(),
PPCISelDAGToDAG::selectI64Imm()). It does not support the
prefixed instructions.

Reviewed By: arsenm, tschuett

Differential Revision: https://reviews.llvm.org/D140119
2022-12-15 21:22:58 +00:00
Chen Zheng
d7ee19d163 [PowerPC][GISel] add the missing verify option - NFC 2022-12-12 12:59:27 +00:00
Chen Zheng
b41d22db18 [PowerPC][GISel] support 32 bit load/store
Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D135535
2022-12-12 12:52:44 +00:00
Chen Zheng
503a935d89 [PowerPC][GISel] support 64 bit load/store
Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D134792
2022-12-12 12:20:54 +00:00
Chen Zheng
0a9b1c59f0 [PowerPC][GISel]support for float point and integer convertion
Add support for fptosi,fptoui,sitofp,uitofp

For now only handle 64 bit integer to make it does not depend on
any other patches. 32 bit integer needs handling for G_SEXT/G_ZEXT.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D139174
2022-12-04 22:21:57 -05:00
Chen Zheng
d9143ce3fd [PowerPC][GISel]add support for float point arithmetic operations
Add global isel support for G_FADD, G_FSUB, G_FMUL, G_FDIV.

Reviewed By: Kai, nemanjai, arsenm, amyk

Differential Revision: https://reviews.llvm.org/D132942
2022-11-22 03:00:27 -05:00
Kai Nacke
2b1e895afb [PowerPC] Add support for G_ADD and G_SUB.
Extends the global isel implementation to support G_ADD and G_SUB.

Reviewed By: arsenm, amyk

Differential Revision: https://reviews.llvm.org/D128106
2022-11-21 23:35:17 +00:00
Kai Nacke
be4a1dfbf9 [PowerPC] Extend GlobalISel implementation to emit and/or/xor.
Adds some more code to GlobalISel to enable instruction selection for and/or/xor.

- Makes G_IMPLICIT_DEF, G_CONSTANT, G_AND, G_OR, G_XOR legal for 64bit register size.
- Implement lowerReturn in CallLowering
- Provides mapping of the operands to register banks.
- Adds register info to G_COPY operands.

The utility functions are all only implemented so far to support this use case.
Especially the functions in PPCGenRegisterBankInfo.def are too simple for
general use.

Reviewed By: nemanjai, shchenz, amyk

Differential Revision: https://reviews.llvm.org/D127530
2022-11-21 20:08:20 +00:00
Kai Nacke
427fb35192 [PPC] Opaque pointer migration, part 1.
The LIT test cases were migrated with the script provided by
Nikita Popov. Due to the size of the change it is split into
several parts.

Reviewed By: nemanja, amyk, nikic, PowerPC

Differential Revision: https://reviews.llvm.org/D135470
2022-10-11 17:24:06 +00:00
Kai Nacke
42f7364fcb [GISel] Check useLoadStackGuardNode() before generating LOAD_STACK_GUARD
When lowering llvm::stackprotect intrinsic, the SDAG implementation
checks useLoadStackGuardNode() to either create a LOAD_STACK_GUARD or use
the first argument of the intrinsic. This check is not present in the
IRTranslator, which results in always generating a LOAD_STACK_GUARD even
if the target does not support it.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D129505
2022-07-12 11:44:42 -04:00
Anshil Gandhi
1c5ff0b03f [PowerPC] [GlobalISel] Implementation of formal arguments lowering in the IRTranslator for the PPC backend
Differential Revision: https://reviews.llvm.org/D99812
2021-06-02 16:46:39 -06:00
Anshil Gandhi
3e5ddb83e3 Revert "Differential Revision: https://reviews.llvm.org/D99812"
This reverts commit c729f2a48a6ef6b20554494c5630082c89c3680c.
2021-06-02 16:36:00 -06:00
Anshil Gandhi
c729f2a48a Differential Revision: https://reviews.llvm.org/D99812 2021-06-02 14:09:52 -06:00
Kit Barton
009cd4e491 [PPC][GlobalISel] Add initial GlobalIsel infrastructure
This adds the initial GlobalISel skeleton for PowerPC. It can only run
ir-translator and legalizer for `ret void`.

This is largely based on the initial GlobalISel patch for RISCV
(https://reviews.llvm.org/D65219).

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D83100
2020-09-10 11:58:01 -05:00