mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-12 05:56:25 +00:00
For extended loads of type i1 to i8, we will need to at least one byte from memory.
The change in the .td file is to mark the side effects of mov insn. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74768 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6a3a1ba97e
commit
1d2e6ed1ef
@ -841,12 +841,16 @@ SDValue PIC16TargetLowering::ExpandLoad(SDNode *N, SelectionDAG &DAG) {
|
|||||||
// i.e. without any extension
|
// i.e. without any extension
|
||||||
MVT MemVT = LD->getMemoryVT();
|
MVT MemVT = LD->getMemoryVT();
|
||||||
unsigned MemBytes = MemVT.getSizeInBits() / 8;
|
unsigned MemBytes = MemVT.getSizeInBits() / 8;
|
||||||
|
// if MVT::i1 is extended to MVT::i8 then MemBytes will be zero
|
||||||
|
// So set it to one
|
||||||
|
if (MemBytes == 0) MemBytes = 1;
|
||||||
|
|
||||||
unsigned ExtdBytes = VT.getSizeInBits() / 8;
|
unsigned ExtdBytes = VT.getSizeInBits() / 8;
|
||||||
Offset = DAG.getConstant(LoadOffset, MVT::i8);
|
Offset = DAG.getConstant(LoadOffset, MVT::i8);
|
||||||
|
|
||||||
Tys = DAG.getVTList(MVT::i8, MVT::Other);
|
Tys = DAG.getVTList(MVT::i8, MVT::Other);
|
||||||
// For MemBytes generate PIC16Load with proper offset
|
// For MemBytes generate PIC16Load with proper offset
|
||||||
for (iter=0; iter<MemBytes; ++iter) {
|
for (iter=0; iter < MemBytes; ++iter) {
|
||||||
// Add the pointer offset if any
|
// Add the pointer offset if any
|
||||||
Offset = DAG.getConstant(iter + LoadOffset, MVT::i8);
|
Offset = DAG.getConstant(iter + LoadOffset, MVT::i8);
|
||||||
Load = DAG.getNode(PIC16ISD::PIC16Load, dl, Tys, Chain, PtrLo, PtrHi,
|
Load = DAG.getNode(PIC16ISD::PIC16Load, dl, Tys, Chain, PtrLo, PtrHi,
|
||||||
|
@ -299,7 +299,7 @@ def store_indirect :
|
|||||||
// Direct load.
|
// Direct load.
|
||||||
// Input Operands are: ptrlo = GA, offset = offset, ptrhi = banksel.
|
// Input Operands are: ptrlo = GA, offset = offset, ptrhi = banksel.
|
||||||
// Output: dst = W
|
// Output: dst = W
|
||||||
let mayLoad = 1 in
|
let Defs = [STATUS], mayLoad = 1 in
|
||||||
class MOVF_INSN<bits<6> OpCode, SDNode OpNodeSrc, SDNode Op>:
|
class MOVF_INSN<bits<6> OpCode, SDNode OpNodeSrc, SDNode Op>:
|
||||||
ByteFormat<0, (outs GPR:$dst),
|
ByteFormat<0, (outs GPR:$dst),
|
||||||
(ins i8imm:$offset, i8mem:$ptrlo, i8imm:$ptrhi),
|
(ins i8imm:$offset, i8mem:$ptrlo, i8imm:$ptrhi),
|
||||||
|
Loading…
Reference in New Issue
Block a user