Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
llvm-epi-0.8
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Roger Ferrer
llvm-epi-0.8
Commits
dce6f66c
Commit
dce6f66c
authored
15 years ago
by
Bruno Cardoso Lopes
Browse files
Options
Downloads
Patches
Plain Diff
Add proper emission of load/store double to stack slots for mips1 targets!
llvm-svn: 89821
parent
4f5d0907
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/lib/Target/Mips/MipsInstrInfo.cpp
+43
-21
43 additions, 21 deletions
llvm/lib/Target/Mips/MipsInstrInfo.cpp
with
43 additions
and
21 deletions
llvm/lib/Target/Mips/MipsInstrInfo.cpp
+
43
−
21
View file @
dce6f66c
...
@@ -200,22 +200,33 @@ void MipsInstrInfo::
...
@@ -200,22 +200,33 @@ void MipsInstrInfo::
storeRegToStackSlot
(
MachineBasicBlock
&
MBB
,
MachineBasicBlock
::
iterator
I
,
storeRegToStackSlot
(
MachineBasicBlock
&
MBB
,
MachineBasicBlock
::
iterator
I
,
unsigned
SrcReg
,
bool
isKill
,
int
FI
,
unsigned
SrcReg
,
bool
isKill
,
int
FI
,
const
TargetRegisterClass
*
RC
)
const
{
const
TargetRegisterClass
*
RC
)
const
{
unsigned
Opc
;
DebugLoc
DL
=
DebugLoc
::
getUnknownLoc
();
DebugLoc
DL
=
DebugLoc
::
getUnknownLoc
();
if
(
I
!=
MBB
.
end
())
DL
=
I
->
getDebugLoc
();
if
(
I
!=
MBB
.
end
())
DL
=
I
->
getDebugLoc
();
if
(
RC
==
Mips
::
CPURegsRegisterClass
)
if
(
RC
==
Mips
::
CPURegsRegisterClass
)
Opc
=
Mips
::
SW
;
BuildMI
(
MBB
,
I
,
DL
,
get
(
Mips
::
SW
)).
addReg
(
SrcReg
,
getKillRegState
(
isKill
))
.
addImm
(
0
).
addFrameIndex
(
FI
);
else
if
(
RC
==
Mips
::
FGR32RegisterClass
)
else
if
(
RC
==
Mips
::
FGR32RegisterClass
)
Opc
=
Mips
::
SWC1
;
BuildMI
(
MBB
,
I
,
DL
,
get
(
Mips
::
SWC1
)).
addReg
(
SrcReg
,
getKillRegState
(
isKill
))
else
{
assert
(
RC
==
Mips
::
AFGR64RegisterClass
);
Opc
=
Mips
::
SDC1
;
}
BuildMI
(
MBB
,
I
,
DL
,
get
(
Opc
)).
addReg
(
SrcReg
,
getKillRegState
(
isKill
))
.
addImm
(
0
).
addFrameIndex
(
FI
);
.
addImm
(
0
).
addFrameIndex
(
FI
);
else
if
(
RC
==
Mips
::
AFGR64RegisterClass
)
{
if
(
!
TM
.
getSubtarget
<
MipsSubtarget
>
().
isMips1
())
{
BuildMI
(
MBB
,
I
,
DL
,
get
(
Mips
::
SDC1
))
.
addReg
(
SrcReg
,
getKillRegState
(
isKill
))
.
addImm
(
0
).
addFrameIndex
(
FI
);
}
else
{
const
TargetRegisterInfo
*
TRI
=
MBB
.
getParent
()
->
getTarget
().
getRegisterInfo
();
const
unsigned
*
SubSet
=
TRI
->
getSubRegisters
(
SrcReg
);
BuildMI
(
MBB
,
I
,
DL
,
get
(
Mips
::
SWC1
))
.
addReg
(
SubSet
[
0
],
getKillRegState
(
isKill
))
.
addImm
(
0
).
addFrameIndex
(
FI
);
BuildMI
(
MBB
,
I
,
DL
,
get
(
Mips
::
SWC1
))
.
addReg
(
SubSet
[
1
],
getKillRegState
(
isKill
))
.
addImm
(
4
).
addFrameIndex
(
FI
);
}
}
else
llvm_unreachable
(
"Register class not handled!"
);
}
}
void
MipsInstrInfo
::
void
MipsInstrInfo
::
...
@@ -223,19 +234,27 @@ loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
...
@@ -223,19 +234,27 @@ loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
unsigned
DestReg
,
int
FI
,
unsigned
DestReg
,
int
FI
,
const
TargetRegisterClass
*
RC
)
const
const
TargetRegisterClass
*
RC
)
const
{
{
unsigned
Opc
;
if
(
RC
==
Mips
::
CPURegsRegisterClass
)
Opc
=
Mips
::
LW
;
else
if
(
RC
==
Mips
::
FGR32RegisterClass
)
Opc
=
Mips
::
LWC1
;
else
{
assert
(
RC
==
Mips
::
AFGR64RegisterClass
);
Opc
=
Mips
::
LDC1
;
}
DebugLoc
DL
=
DebugLoc
::
getUnknownLoc
();
DebugLoc
DL
=
DebugLoc
::
getUnknownLoc
();
if
(
I
!=
MBB
.
end
())
DL
=
I
->
getDebugLoc
();
if
(
I
!=
MBB
.
end
())
DL
=
I
->
getDebugLoc
();
BuildMI
(
MBB
,
I
,
DL
,
get
(
Opc
),
DestReg
).
addImm
(
0
).
addFrameIndex
(
FI
);
if
(
RC
==
Mips
::
CPURegsRegisterClass
)
BuildMI
(
MBB
,
I
,
DL
,
get
(
Mips
::
LW
),
DestReg
).
addImm
(
0
).
addFrameIndex
(
FI
);
else
if
(
RC
==
Mips
::
FGR32RegisterClass
)
BuildMI
(
MBB
,
I
,
DL
,
get
(
Mips
::
LWC1
),
DestReg
).
addImm
(
0
).
addFrameIndex
(
FI
);
else
if
(
RC
==
Mips
::
AFGR64RegisterClass
)
{
if
(
!
TM
.
getSubtarget
<
MipsSubtarget
>
().
isMips1
())
{
BuildMI
(
MBB
,
I
,
DL
,
get
(
Mips
::
LDC1
),
DestReg
).
addImm
(
0
).
addFrameIndex
(
FI
);
}
else
{
const
TargetRegisterInfo
*
TRI
=
MBB
.
getParent
()
->
getTarget
().
getRegisterInfo
();
const
unsigned
*
SubSet
=
TRI
->
getSubRegisters
(
DestReg
);
BuildMI
(
MBB
,
I
,
DL
,
get
(
Mips
::
LWC1
),
SubSet
[
0
])
.
addImm
(
0
).
addFrameIndex
(
FI
);
BuildMI
(
MBB
,
I
,
DL
,
get
(
Mips
::
LWC1
),
SubSet
[
1
])
.
addImm
(
4
).
addFrameIndex
(
FI
);
}
}
else
llvm_unreachable
(
"Register class not handled!"
);
}
}
MachineInstr
*
MipsInstrInfo
::
MachineInstr
*
MipsInstrInfo
::
...
@@ -278,11 +297,14 @@ foldMemoryOperandImpl(MachineFunction &MF,
...
@@ -278,11 +297,14 @@ foldMemoryOperandImpl(MachineFunction &MF,
const
TargetRegisterClass
const
TargetRegisterClass
*
RC
=
RI
.
getRegClass
(
MI
->
getOperand
(
0
).
getReg
());
*
RC
=
RI
.
getRegClass
(
MI
->
getOperand
(
0
).
getReg
());
unsigned
StoreOpc
,
LoadOpc
;
unsigned
StoreOpc
,
LoadOpc
;
bool
IsMips1
=
TM
.
getSubtarget
<
MipsSubtarget
>
().
isMips1
();
if
(
RC
==
Mips
::
FGR32RegisterClass
)
{
if
(
RC
==
Mips
::
FGR32RegisterClass
)
{
LoadOpc
=
Mips
::
LWC1
;
StoreOpc
=
Mips
::
SWC1
;
LoadOpc
=
Mips
::
LWC1
;
StoreOpc
=
Mips
::
SWC1
;
}
else
{
}
else
{
assert
(
RC
==
Mips
::
AFGR64RegisterClass
);
assert
(
RC
==
Mips
::
AFGR64RegisterClass
);
// Mips1 doesn't have ldc/sdc instructions.
if
(
IsMips1
)
break
;
LoadOpc
=
Mips
::
LDC1
;
StoreOpc
=
Mips
::
SDC1
;
LoadOpc
=
Mips
::
LDC1
;
StoreOpc
=
Mips
::
SDC1
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment