Mercurial > hg > truffle
comparison src/share/vm/opto/memnode.hpp @ 624:337400e7a5dd
6797305: Add LoadUB and LoadUI opcode class
Summary: Add a LoadUB (unsigned byte) and LoadUI (unsigned int) opcode class so we have these load optimizations in the first place and do not need to handle them in the matcher.
Reviewed-by: never, kvn
author | twisti |
---|---|
date | Mon, 09 Mar 2009 03:17:11 -0700 |
parents | 98cb887364d3 |
children | 7bb995fbd3c0 |
comparison
equal
deleted
inserted
replaced
623:9adddb8c0fc8 | 624:337400e7a5dd |
---|---|
1 /* | 1 /* |
2 * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. | 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
205 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | 205 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
206 virtual int store_Opcode() const { return Op_StoreB; } | 206 virtual int store_Opcode() const { return Op_StoreB; } |
207 virtual BasicType memory_type() const { return T_BYTE; } | 207 virtual BasicType memory_type() const { return T_BYTE; } |
208 }; | 208 }; |
209 | 209 |
210 //------------------------------LoadUBNode------------------------------------- | |
211 // Load a unsigned byte (8bits unsigned) from memory | |
212 class LoadUBNode : public LoadNode { | |
213 public: | |
214 LoadUBNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt* ti = TypeInt::UBYTE ) | |
215 : LoadNode(c, mem, adr, at, ti) {} | |
216 virtual int Opcode() const; | |
217 virtual uint ideal_reg() const { return Op_RegI; } | |
218 virtual Node* Ideal(PhaseGVN *phase, bool can_reshape); | |
219 virtual int store_Opcode() const { return Op_StoreB; } | |
220 virtual BasicType memory_type() const { return T_BYTE; } | |
221 }; | |
222 | |
210 //------------------------------LoadUSNode------------------------------------- | 223 //------------------------------LoadUSNode------------------------------------- |
211 // Load an unsigned short/char (16bits unsigned) from memory | 224 // Load an unsigned short/char (16bits unsigned) from memory |
212 class LoadUSNode : public LoadNode { | 225 class LoadUSNode : public LoadNode { |
213 public: | 226 public: |
214 LoadUSNode( Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti = TypeInt::CHAR ) | 227 LoadUSNode( Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti = TypeInt::CHAR ) |
228 : LoadNode(c,mem,adr,at,ti) {} | 241 : LoadNode(c,mem,adr,at,ti) {} |
229 virtual int Opcode() const; | 242 virtual int Opcode() const; |
230 virtual uint ideal_reg() const { return Op_RegI; } | 243 virtual uint ideal_reg() const { return Op_RegI; } |
231 virtual int store_Opcode() const { return Op_StoreI; } | 244 virtual int store_Opcode() const { return Op_StoreI; } |
232 virtual BasicType memory_type() const { return T_INT; } | 245 virtual BasicType memory_type() const { return T_INT; } |
246 }; | |
247 | |
248 //------------------------------LoadUI2LNode----------------------------------- | |
249 // Load an unsigned integer into long from memory | |
250 class LoadUI2LNode : public LoadNode { | |
251 public: | |
252 LoadUI2LNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeLong* t = TypeLong::UINT) | |
253 : LoadNode(c, mem, adr, at, t) {} | |
254 virtual int Opcode() const; | |
255 virtual uint ideal_reg() const { return Op_RegL; } | |
256 virtual int store_Opcode() const { return Op_StoreL; } | |
257 virtual BasicType memory_type() const { return T_LONG; } | |
233 }; | 258 }; |
234 | 259 |
235 //------------------------------LoadRangeNode---------------------------------- | 260 //------------------------------LoadRangeNode---------------------------------- |
236 // Load an array length from the array | 261 // Load an array length from the array |
237 class LoadRangeNode : public LoadINode { | 262 class LoadRangeNode : public LoadINode { |