Commit Graph

54 Commits

Author SHA1 Message Date
Kazushi (Jam) Marukawa 447efdb52b [VE] Minimum MC layer for VE (2/4)
Remove unnecessary EncoderMethod and DecoderMethod which cause errors in
supporting MC layer.

Differential Revision: https://reviews.llvm.org/D79544
2020-05-07 13:21:37 +02:00
Kazushi (Jam) Marukawa 6999ffcc39 [VE] Implements minimum MC layer for VE (1/4)
Summary:
Correct instruction bitfield addresses to generate machine code correctly.  Also
add some variables to represent all instructions correctly and change default
values to use registers by default.

Differential Revision: https://reviews.llvm.org/D79539
2020-05-07 13:10:36 +02:00
Simon Moll 1e89f36c98 [VE][NFC] formatting VEISD enum 2020-05-04 09:50:27 +02:00
Kazushi (Jam) Marukawa 3c80478d73 [VE] Update branch instructions
Summary:
Changing all mnemonic to match assembly instructions to simplify mnemonic
naming rules. This time update all branch instructions.  This also change
to use %s10 register consistently.

Differential Revision: https://reviews.llvm.org/D78889
2020-04-28 09:41:01 +02:00
Kazushi (Jam) Marukawa 0314e8980f [VE] Support floating point immediate values
Summary:
Add simm7fp/mimmfp to represent floating point immediate values.
Also clean multiclasses to define floating point arithmetic instructions
to handle simm7fp/mimmfp operands.  Also add several regression tests
for new operands.

Differential Revision: https://reviews.llvm.org/D78887
2020-04-28 09:36:10 +02:00
Kazushi (Jam) Marukawa 9aa6792729 [VE] Update floating-point arithmetic instructions
Summary:
Changing all mnemonic to match assembly instructions to simplify mnemonic
naming rules. This time update all floating-point arithmetic instructions.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D78768
2020-04-24 11:11:44 +02:00
Kazushi (Jam) Marukawa a6ef471919 [VE] Update shift operation instructions
Summary:
Changing all mnemonic to match assembly instructions to simplify mnemonic
naming rules. This time update all shift operation instructions.  This also
corrects instruction's operation kinds.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D78468
2020-04-22 09:10:10 +02:00
Kazushi (Jam) Marukawa ba4162c1c4 [VE] Add alternative names to registers
Summary:
VE uses identical names "%s0-63" to all generic registers.  Change to use
alternative name mechanism among all generic registers instead of hard-
coding them.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D78174
2020-04-22 09:07:42 +02:00
Kazushi (Jam) Marukawa d8816261a6 [VE] Create a TargetInfo header. NFC
Summary:
Move the declarations of getThe<Name>Target() functions into a new header in
TargetInfo and make users of these functions include this new header in
order to follow other architectures.

Differential Revision: https://reviews.llvm.org/D78543
2020-04-21 11:42:17 +02:00
Kazushi (Jam) Marukawa 48d64f5654 [VE] Update logical operation instructions
Summary:
Changing all mnemonic to match assembly instructions to simplify mnemonic
naming rules. This time update all fixed-point arithmetic instructions.
This also corrects bswp operand type.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D78177
2020-04-16 14:35:53 +02:00
Kazushi (Jam) Marukawa 7a7f223042 [VE] Update integer arithmetic instructions
Summary:
Changing all mnemonic to match assembly instructions to simplify mnemonic
naming rules.  This time update all fixed-point arithmetic instructions.
This also corrects smax/smin code generations.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D77856
2020-04-15 09:47:51 +02:00
Kazushi (Jam) Marukawa 37db04dda6 [VE] Remove unnecessary iz pattern
Summary:
This iz pattern is a special pattern of im pattern.  This im pattern
has been supported by https://reviews.llvm.org/D77769, so removing
iz pattern as a continuous patch.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D77770
2020-04-14 08:56:55 +02:00
Fangrui Song d1a677cd33 [VE] Adapt D77995 CallSite removal 2020-04-13 19:54:49 -07:00
Fangrui Song d2e5157c1f [MC] Add UseIntegratedAssembler = false. NFC 2020-04-11 10:13:49 -07:00
Kazushi (Jam) Marukawa 015dee1ac8 [VE] Support (m)0 and (m)1 operands
Summary:
VE has special operands to represent 0b000...000111...111 (`(m)0`) and
0b111...111000...000 (`(m)1`) bit sequences.  This patch supports those
operands not only in machine instructions but also in DAG lowering.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D77769
2020-04-09 18:09:00 +02:00
Jay Foad 9c7bd94ce8 Fix typo in comment 2020-04-09 10:36:00 +01:00
Kazushi (Jam) Marukawa aa034867f1 [VE] Simplify definitions of uimm6 and simm7
Summary: To prepare continuous changes, simplify uimm6 and simm7 operands.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D77700
2020-04-08 09:53:42 +02:00
Fangrui Song 624654fd64 [VE] Migrate to the getMachineMemOperand overload using llvm::Align
Just delete the deprecated overload because nothing uses it.
2020-04-07 16:04:54 -07:00
Fangrui Song 2f8fb4d1cd [VE] Adapt aa26dd9858 and 2481f26ac3 2020-04-07 15:45:19 -07:00
Kazushi (Jam) Marukawa e981a46a77 [VE] Update lea/load/store instructions
Summary:
Modify lea/load/store instructions to accept `disp(index, base)`
style addressing mode (called ASX format).  Also, uniform the
number of DAG nodes to have 3 operands for this ASX format
instructions, and update selectADDR functions to lower
appropriate MI.

Reviewers: arsenm, simoll, k-ishizaka

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D76822
2020-04-06 11:49:46 +02:00
Fangrui Song b3cc5dcef0 [MCInstPrinter] Add parameter `Address` to MCInstPrinter::printAliasInstr. NFC
Follow-up of D72172.
2020-03-27 00:03:32 -07:00
Kazushi (Jam) Marukawa 28a42dd1b9 [VE] Change name of enum to CondCode
Summary: Change enum name for condition codes from CondCodes to CondCode.

Reviewers: arsenm, simoll, k-ishizaka

Reviewed By: arsenm

Subscribers: wdng, hiraditya, llvm-commits

Tags: #llvm, #ve

Differential Revision: https://reviews.llvm.org/D76747
2020-03-25 09:20:05 +01:00
Fangrui Song df4cc35efd [VE] Fix -Wunused-private-field after D72598 and -Wdeprecated-declarations after D76348 2020-03-20 15:06:58 -07:00
Kazushi (Jam) Marukawa 6bbbead7be [VE] Move VEInstPrinter.cpp and VEInstPrinter.h into MCTargetDesc
Summary:
Move them into MCTargetDesc to follow other architectures (a263aa2).

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D76270
2020-03-17 11:33:54 +01:00
Simon Moll c8e1081da6 [VE][nfc] Use RRIm for RRINDm, remove the latter
Summary:
De-duplicate isel instruction classes by using RRIm for RRINDm. The latter
becomes obsolete.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D76063
2020-03-12 15:38:07 +01:00
Kazushi (Jam) Marukawa 3dabad1af3 [VE] Target-specific bit size for sjljehprepare
Summary:
This patch extends the TargetMachine to let targets specify the integer size
used by the sjljehprepare pass. This is 64bit for the VE target and otherwise
defaults to 32bit for all targets, which was hard-wired before.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D71337
2020-03-10 17:51:16 +01:00
Simon Moll 635034f193 [VE][fix] missing include 2020-02-22 11:00:59 +01:00
Francis Visoiu Mistrih a32d539798 [Target] Remove libObject dependency in lib/Target
This removes a couple useless includes and the dependency of X86Desc on Object,
which was useless as well.
2020-02-21 14:52:31 -08:00
Kazushi (Jam) Marukawa 5526786a56 [VE] TLS codegen
Summary:
Codegen and tests for thread-local storage.
This implements only the general dynamic model due to limitations in nld 2.26.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D74718
2020-02-18 16:09:12 +01:00
Kazushi (Jam) Marukawa 60431bd728 [VE] Support for PIC (global data and calls)
Summary: Support for PIC with tests for global variables and function calls.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D74536
2020-02-14 09:50:02 +01:00
Fangrui Song bcd24b2d43 [AsmPrinter][MCStreamer] De-capitalize EmitInstruction and EmitCFI* 2020-02-13 22:08:55 -08:00
Kazushi (Jam) Marukawa 42a16dacda [VE] Bit operator isel
Summary: Isel and tests for bswap,brev,ctpop,ctlz,ctty,rotl,rotr

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D74304
2020-02-12 09:02:13 +01:00
Kazushi (Jam) Marukawa 3ed12232b0 [VE] half fptrunc+store&load+fpext
Summary:
fp16 (half) load+fpext and fptrunc+store isel legalization and tests.
Also, ExternalSymbolSDNode operand printing (tested by fp16 lowering).

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D73899
2020-02-04 17:16:09 +01:00
Kazushi (Jam) Marukawa be9fe6aa8b [VE] (fp)trunc+store & load+(fp)ext isel
Summary: load+sext/zext/fpext and (fp)trunc+store isel legalization and tests

Reviewers: arsenm, craig.topper, rengolin, k-ishizaka

Reviewed By: arsenm

Subscribers: merge_guards_bot, wdng, hiraditya, llvm-commits

Tags: #ve, #llvm

Differential Revision: https://reviews.llvm.org/D73774
2020-02-03 16:55:44 +01:00
Kazushi (Jam) Marukawa 07c9f7574d [VE] vaarg functions callers and callees
Summary: Isel patterns and tests for vaarg functions as callers and callees.

Reviewers: arsenm, rengolin, k-ishizaka

Subscribers: merge_guards_bot, wdng, hiraditya, llvm-commits

Tags: #ve, #llvm

Differential Revision: https://reviews.llvm.org/D73710
2020-02-03 16:26:44 +01:00
Simon Moll 24215fec9a [NFC][VE] format VEInstrInfo 2020-02-03 14:25:49 +01:00
Kazushi (Jam) Marukawa fef80a2946 [VE] (conditional) branch modification & isel patterns
Summary:
InstInfo for branch modification, (conditional) branch isel patterns and tests.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D73632
2020-01-29 17:40:57 +01:00
Kazushi (Jam) Marukawa 0bec0e7151 [VE] udiv/sdiv/urem/srem/mul isel patterns
Summary:
udiv/sdiv/urem/srem/mul integer isel patterns and tests.
Pretend for now that integer division were always cheap in HW.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D73623
2020-01-29 15:59:50 +01:00
Kazushi (Jam) Marukawa 6b587ee23c [VE] Isel patterns for fp32/64 and i32/64 conversion
Summary:
fp32/64 <> signed/unsigned i32/64 conversion isel patterns and tests

(This patch depends on `fsub` implemented by https://reviews.llvm.org/D73540 )

Reviewers: arsenm, craig.topper, rengolin, k-ishizaka

Reviewed By: arsenm

Subscribers: merge_guards_bot, wdng, hiraditya, llvm-commits

Tags: #ve, #llvm

Differential Revision: https://reviews.llvm.org/D73544
2020-01-29 14:10:22 +01:00
Kazushi (Jam) Marukawa f6bb58542a [VE] fp32/64 fadd/fsub/fdiv/fmul isel patterns
Summary: fp32/64 fadd/fsub/fdiv/fmul isel patterns and tests.

Reviewers: arsenm, craig.topper, rengolin, k-ishizaka

Subscribers: merge_guards_bot, wdng, hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D73540
2020-01-29 11:00:56 +01:00
Simon Moll 93bbe7b2b5 [VE][fix] (more) explicit StringRef to std::string 2020-01-29 10:46:59 +01:00
Simon Moll d53840ad39 [VE][fix] Explicit StringRef to std::string conversion
Adapt to changes of "[ADT] Make StringRef's std::string conversion
operator explicit" (777180a32).
2020-01-29 10:34:28 +01:00
Kazushi (Jam) Marukawa 92600c2ec8 [VE] call isel with stack passing
Summary:
Function calls and stack-passing of function arguments.
Custom lowering, isel patterns and tests.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D73461
2020-01-28 10:55:47 +01:00
Kazushi (Jam) Marukawa 422dfea577 [VE] enable unaligned load/store isel
Summary: Enable unaligned load/store isel for iN and fp32/64 and tests.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D73448
2020-01-28 09:53:37 +01:00
Kazushi (Jam) Marukawa 0fca35c652 [VE] global variable isel patterns
Summary: Asm expr fixups, isel patterns and tests for global variables addresses.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D73355
2020-01-24 17:35:14 +01:00
Kazushi (Jam) Marukawa 08ebd8c79e [VE] aligned load/store isel patterns
Summary:
Aligned load/store isel patterns and tests for
i1/i8/16/32/64 (including extension and truncation) and fp32/64.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D73276
2020-01-24 15:16:54 +01:00
Kazushi (Jam) Marukawa 784204fd7e [VE] add, sub, left/right shift isel patterns
Summary: Add, sub, left/right shift isel patterns and tests for i32/i64 and fp32/fp64.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D73207
2020-01-23 16:00:37 +01:00
Simon Moll 9187073f3e [VE][NFC] re-write RR* isel class using null_frag
Summary: Re-write RR* using null_frag to avoid duplication in upcoming patches.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D73259
2020-01-23 15:17:45 +01:00
Kazushi (Jam) Marukawa 83b67526d5 [VE] select and selectcc patterns
Summary: select and selectcc isel patterns and tests for i32/i64 and fp32/fp64.
Includes optimized selectcc patterns for fmin/fmax/maxs/mins.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D73195
2020-01-22 16:30:38 +01:00
Kazushi (Jam) Marukawa dc69265eea [VE] setcc isel patterns
Summary: SETCC isel patterns and tests for i32/64 and fp32/64 comparison

Reviewers: arsenm, rengolin, craig.topper, k-ishizaka

Reviewed By: arsenm

Subscribers: merge_guards_bot, wdng, hiraditya, llvm-commits

Tags: #ve, #llvm

Differential Revision: https://reviews.llvm.org/D73171
2020-01-22 15:45:57 +01:00