[Sim] Patch to sim/common/cgen-ops.h

Ben Elliston bje@redhat.com
Sun Dec 3 20:02:00 GMT 2000


FYI, I am commiting the following patch:

2000-12-04  Ben Elliston  <bje@redhat.com>

	* cgen-ops.h (SUBWORDSIQI): Mask off top bits.
	(SUBWORDSIUQI): Likewise.
	(SUBWORDDIHI): Likewise.
	(SUBWORDDIQI): New function.

*** cgen-ops.h	2000/11/19 22:31:55	1.17
--- cgen-ops.h	2000/12/04 03:59:06
***************
*** 323,343 ****
  SUBWORDSIQI (SI in, int byte)
  {
    assert (byte >= 0 && byte <= 3);
!   return (UQI) (in >> (8 * (3 - byte)));
  }
  
  SEMOPS_INLINE UQI
  SUBWORDSIUQI (SI in, int byte)
  {
    assert (byte >= 0 && byte <= 3);
!   return (UQI) (in >> (8 * (3 - byte)));
  }
  
  SEMOPS_INLINE HI
  SUBWORDDIHI (DI in, int word)
  {
    assert (word >= 0 && word <= 3);
!   return (UHI) (in >> (16 * (3 - word)));
  }
  
  SEMOPS_INLINE HI
--- 323,350 ----
  SUBWORDSIQI (SI in, int byte)
  {
    assert (byte >= 0 && byte <= 3);
!   return (UQI) (in >> (8 * (3 - byte))) & 0xFF;
  }
  
  SEMOPS_INLINE UQI
  SUBWORDSIUQI (SI in, int byte)
  {
    assert (byte >= 0 && byte <= 3);
!   return (UQI) (in >> (8 * (3 - byte))) & 0xFF;
  }
  
+ SEMOPS_INLINE QI
+ SUBWORDDIQI (DI in, int byte)
+ {
+   assert (byte >= 0 && byte <= 7);
+   return (UQI) (in >> (8 * (7 - byte))) & 0xFF;
+ }
+ 
  SEMOPS_INLINE HI
  SUBWORDDIHI (DI in, int word)
  {
    assert (word >= 0 && word <= 3);
!   return (UHI) (in >> (16 * (3 - word))) & 0xFFFF;
  }
  
  SEMOPS_INLINE HI
***************
*** 450,455 ****
--- 457,463 ----
  SI SUBWORDSFSI (SF);
  SF SUBWORDSISF (SI);
  DF SUBWORDDIDF (DI);
+ QI SUBWORDDIQI (DI, int);
  HI SUBWORDDIHI (DI, int);
  SI SUBWORDDISI (DI, int);
  SI SUBWORDDFSI (DF, int);


More information about the Gdb-patches mailing list