Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: src/IceTargetLoweringMIPS32.h

Issue 2123723002: SubZero: legalize for f32/f64 constants in MIPS32 (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Changed as suggested Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/IceTargetLoweringMIPS32.h
diff --git a/src/IceTargetLoweringMIPS32.h b/src/IceTargetLoweringMIPS32.h
index 96f055446f1d6706e2e61a477c2a5a67a3804600..7c9c656359d93db901b03f433307a64230b3501d 100644
--- a/src/IceTargetLoweringMIPS32.h
+++ b/src/IceTargetLoweringMIPS32.h
@@ -35,7 +35,11 @@ public:
static void staticInit(GlobalContext *Ctx);
static bool shouldBePooled(const Constant *C) {
- (void)C;
+ if (auto *ConstDouble = llvm::dyn_cast<ConstantDouble>(C)) {
+ return !Utils::isPositiveZero(ConstDouble->getValue());
+ }
+ if (llvm::isa<ConstantFloat>(C))
+ return true;
return false;
}
static std::unique_ptr<::Ice::TargetLowering> create(Cfg *Func) {
@@ -230,20 +234,20 @@ public:
Context.insert<InstMIPS32Divu>(Dest, Src0, Src1);
}
- void _ldc1(Variable *Value, OperandMIPS32Mem *Mem) {
- Context.insert<InstMIPS32Ldc1>(Value, Mem);
+ void _ldc1(Variable *Value, OperandMIPS32Mem *Mem, RelocOp Reloc = RO_No) {
+ Context.insert<InstMIPS32Ldc1>(Value, Mem, Reloc);
}
void _lw(Variable *Value, OperandMIPS32Mem *Mem) {
Context.insert<InstMIPS32Lw>(Value, Mem);
}
- void _lwc1(Variable *Value, OperandMIPS32Mem *Mem) {
- Context.insert<InstMIPS32Lwc1>(Value, Mem);
+ void _lwc1(Variable *Value, OperandMIPS32Mem *Mem, RelocOp Reloc = RO_No) {
+ Context.insert<InstMIPS32Lwc1>(Value, Mem, Reloc);
}
- void _lui(Variable *Dest, uint32_t Imm) {
- Context.insert<InstMIPS32Lui>(Dest, Imm);
+ void _lui(Variable *Dest, Operand *Src, RelocOp Reloc = RO_No) {
+ Context.insert<InstMIPS32Lui>(Dest, Src, Reloc);
}
void _mov(Variable *Dest, Operand *Src0) {

Powered by Google App Engine
This is Rietveld 408576698