nouveau: Drop C++03 compat code
Mesa as a whole requires C++14 nowadays, so this isn't needed any more. Reviewed-by: David Heidelberg <david.heidelberg@collabora.com> Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17307>
This commit is contained in:
@@ -47,7 +47,6 @@ files_libnouveau_codegen = files(
|
|||||||
'nv50_ir_target_nv50.h',
|
'nv50_ir_target_nv50.h',
|
||||||
'nv50_ir_util.cpp',
|
'nv50_ir_util.cpp',
|
||||||
'nv50_ir_util.h',
|
'nv50_ir_util.h',
|
||||||
'unordered_set.h',
|
|
||||||
'nv50_ir_emit_gv100.cpp',
|
'nv50_ir_emit_gv100.cpp',
|
||||||
'nv50_ir_emit_gv100.h',
|
'nv50_ir_emit_gv100.h',
|
||||||
'nv50_ir_emit_gk110.cpp',
|
'nv50_ir_emit_gk110.cpp',
|
||||||
|
@@ -28,9 +28,9 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <unordered_set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "unordered_set.h"
|
|
||||||
#include "nv50_ir_util.h"
|
#include "nv50_ir_util.h"
|
||||||
#include "nv50_ir_graph.h"
|
#include "nv50_ir_graph.h"
|
||||||
|
|
||||||
@@ -751,10 +751,10 @@ public:
|
|||||||
|
|
||||||
static inline Value *get(Iterator&);
|
static inline Value *get(Iterator&);
|
||||||
|
|
||||||
unordered_set<ValueRef *> uses;
|
std::unordered_set<ValueRef *> uses;
|
||||||
std::list<ValueDef *> defs;
|
std::list<ValueDef *> defs;
|
||||||
typedef unordered_set<ValueRef *>::iterator UseIterator;
|
typedef std::unordered_set<ValueRef *>::iterator UseIterator;
|
||||||
typedef unordered_set<ValueRef *>::const_iterator UseCIterator;
|
typedef std::unordered_set<ValueRef *>::const_iterator UseCIterator;
|
||||||
typedef std::list<ValueDef *>::iterator DefIterator;
|
typedef std::list<ValueDef *>::iterator DefIterator;
|
||||||
typedef std::list<ValueDef *>::const_iterator DefCIterator;
|
typedef std::list<ValueDef *>::const_iterator DefCIterator;
|
||||||
|
|
||||||
|
@@ -34,25 +34,13 @@
|
|||||||
#include "nv50_ir_util.h"
|
#include "nv50_ir_util.h"
|
||||||
#include "tgsi/tgsi_from_mesa.h"
|
#include "tgsi/tgsi_from_mesa.h"
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#else
|
|
||||||
#include <tr1/unordered_map>
|
|
||||||
#endif
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
|
||||||
using std::hash;
|
|
||||||
using std::unordered_map;
|
|
||||||
#else
|
|
||||||
using std::tr1::hash;
|
|
||||||
using std::tr1::unordered_map;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace nv50_ir;
|
using namespace nv50_ir;
|
||||||
|
|
||||||
int
|
int
|
||||||
@@ -85,9 +73,9 @@ public:
|
|||||||
bool run();
|
bool run();
|
||||||
private:
|
private:
|
||||||
typedef std::vector<LValue*> LValues;
|
typedef std::vector<LValue*> LValues;
|
||||||
typedef unordered_map<unsigned, LValues> NirDefMap;
|
typedef std::unordered_map<unsigned, LValues> NirDefMap;
|
||||||
typedef unordered_map<unsigned, nir_load_const_instr*> ImmediateMap;
|
typedef std::unordered_map<unsigned, nir_load_const_instr*> ImmediateMap;
|
||||||
typedef unordered_map<unsigned, BasicBlock*> NirBlockMap;
|
typedef std::unordered_map<unsigned, BasicBlock*> NirBlockMap;
|
||||||
|
|
||||||
CacheMode convert(enum gl_access_qualifier);
|
CacheMode convert(enum gl_access_qualifier);
|
||||||
TexTarget convert(glsl_sampler_dim, bool isArray, bool isShadow);
|
TexTarget convert(glsl_sampler_dim, bool isArray, bool isShadow);
|
||||||
|
@@ -437,7 +437,7 @@ NVC0LegalizePostRA::findFirstUses(
|
|||||||
int minGPR = texi->def(0).rep()->reg.data.id;
|
int minGPR = texi->def(0).rep()->reg.data.id;
|
||||||
int maxGPR = minGPR + texi->def(0).rep()->reg.size / 4 - 1;
|
int maxGPR = minGPR + texi->def(0).rep()->reg.size / 4 - 1;
|
||||||
|
|
||||||
unordered_set<const BasicBlock *> visited;
|
std::unordered_set<const BasicBlock *> visited;
|
||||||
findFirstUsesBB(minGPR, maxGPR, texi->next, texi, uses, visited);
|
findFirstUsesBB(minGPR, maxGPR, texi->next, texi, uses, visited);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -445,7 +445,7 @@ void
|
|||||||
NVC0LegalizePostRA::findFirstUsesBB(
|
NVC0LegalizePostRA::findFirstUsesBB(
|
||||||
int minGPR, int maxGPR, Instruction *start,
|
int minGPR, int maxGPR, Instruction *start,
|
||||||
const Instruction *texi, std::list<TexUse> &uses,
|
const Instruction *texi, std::list<TexUse> &uses,
|
||||||
unordered_set<const BasicBlock *> &visited)
|
std::unordered_set<const BasicBlock *> &visited)
|
||||||
{
|
{
|
||||||
const BasicBlock *bb = start->bb;
|
const BasicBlock *bb = start->bb;
|
||||||
|
|
||||||
|
@@ -109,7 +109,7 @@ private:
|
|||||||
void findFirstUses(Instruction *texi, std::list<TexUse> &uses);
|
void findFirstUses(Instruction *texi, std::list<TexUse> &uses);
|
||||||
void findFirstUsesBB(int minGPR, int maxGPR, Instruction *start,
|
void findFirstUsesBB(int minGPR, int maxGPR, Instruction *start,
|
||||||
const Instruction *texi, std::list<TexUse> &uses,
|
const Instruction *texi, std::list<TexUse> &uses,
|
||||||
unordered_set<const BasicBlock *> &visited);
|
std::unordered_set<const BasicBlock *> &visited);
|
||||||
void addTexUse(std::list<TexUse>&, Instruction *, const Instruction *);
|
void addTexUse(std::list<TexUse>&, Instruction *, const Instruction *);
|
||||||
const Instruction *recurseDef(const Instruction *);
|
const Instruction *recurseDef(const Instruction *);
|
||||||
|
|
||||||
|
@@ -26,22 +26,10 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#if __cplusplus >= 201103L
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#else
|
|
||||||
#include <tr1/unordered_map>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace nv50_ir {
|
namespace nv50_ir {
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
|
||||||
using std::hash;
|
|
||||||
using std::unordered_map;
|
|
||||||
#else
|
|
||||||
using std::tr1::hash;
|
|
||||||
using std::tr1::unordered_map;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MAX_REGISTER_FILE_SIZE 256
|
#define MAX_REGISTER_FILE_SIZE 256
|
||||||
|
|
||||||
class RegisterSet
|
class RegisterSet
|
||||||
@@ -410,12 +398,12 @@ RegAlloc::PhiMovesPass::needNewElseBlock(BasicBlock *b, BasicBlock *p)
|
|||||||
|
|
||||||
struct PhiMapHash {
|
struct PhiMapHash {
|
||||||
size_t operator()(const std::pair<Instruction *, BasicBlock *>& val) const {
|
size_t operator()(const std::pair<Instruction *, BasicBlock *>& val) const {
|
||||||
return hash<Instruction*>()(val.first) * 31 +
|
return std::hash<Instruction*>()(val.first) * 31 +
|
||||||
hash<BasicBlock*>()(val.second);
|
std::hash<BasicBlock*>()(val.second);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef unordered_map<
|
typedef std::unordered_map<
|
||||||
std::pair<Instruction *, BasicBlock *>, Value *, PhiMapHash> PhiMap;
|
std::pair<Instruction *, BasicBlock *>, Value *, PhiMapHash> PhiMap;
|
||||||
|
|
||||||
// Critical edges need to be split up so that work can be inserted along
|
// Critical edges need to be split up so that work can be inserted along
|
||||||
@@ -1837,7 +1825,7 @@ SpillCodeInserter::run(const std::list<ValuePair>& lst)
|
|||||||
// Keep track of which instructions to delete later. Deleting them
|
// Keep track of which instructions to delete later. Deleting them
|
||||||
// inside the loop is unsafe since a single instruction may have
|
// inside the loop is unsafe since a single instruction may have
|
||||||
// multiple destinations that all need to be spilled (like OP_SPLIT).
|
// multiple destinations that all need to be spilled (like OP_SPLIT).
|
||||||
unordered_set<Instruction *> to_del;
|
std::unordered_set<Instruction *> to_del;
|
||||||
|
|
||||||
std::list<ValueDef *> &defs = mergedDefs(lval);
|
std::list<ValueDef *> &defs = mergedDefs(lval);
|
||||||
for (Value::DefIterator d = defs.begin(); d != defs.end();
|
for (Value::DefIterator d = defs.begin(); d != defs.end();
|
||||||
@@ -1887,7 +1875,7 @@ SpillCodeInserter::run(const std::list<ValuePair>& lst)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unordered_set<Instruction *>::const_iterator it = to_del.begin();
|
for (std::unordered_set<Instruction *>::const_iterator it = to_del.begin();
|
||||||
it != to_del.end(); ++it) {
|
it != to_del.end(); ++it) {
|
||||||
mergedDefs.removeDefsOfInstruction(*it);
|
mergedDefs.removeDefsOfInstruction(*it);
|
||||||
delete_Instruction(func->getProgram(), *it);
|
delete_Instruction(func->getProgram(), *it);
|
||||||
|
@@ -94,11 +94,7 @@ public:
|
|||||||
virtual void reset() { assert(0); } // only for graph iterators
|
virtual void reset() { assert(0); } // only for graph iterators
|
||||||
};
|
};
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
|
||||||
typedef std::unique_ptr<Iterator> IteratorRef;
|
typedef std::unique_ptr<Iterator> IteratorRef;
|
||||||
#else
|
|
||||||
typedef std::auto_ptr<Iterator> IteratorRef;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class ManipIterator : public Iterator
|
class ManipIterator : public Iterator
|
||||||
{
|
{
|
||||||
|
@@ -1,20 +0,0 @@
|
|||||||
#ifndef __NV50_UNORDERED_SET_H__
|
|
||||||
#define __NV50_UNORDERED_SET_H__
|
|
||||||
|
|
||||||
#if (__cplusplus >= 201103L)
|
|
||||||
#include <unordered_set>
|
|
||||||
#else
|
|
||||||
#include <tr1/unordered_set>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace nv50_ir {
|
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
|
||||||
using std::unordered_set;
|
|
||||||
#else
|
|
||||||
using std::tr1::unordered_set;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace nv50_ir
|
|
||||||
|
|
||||||
#endif // __NV50_UNORDERED_SET_H__
|
|
Reference in New Issue
Block a user