Changeset 14222


Ignore:
Timestamp:
Aug 26, 2010, 3:23:35 PM (9 years ago)
Author:
gb
Message:

Don't "naturally" align a record field if the field type's natural
alignment is greater than the word size (unless the ftd has a
:natural-alignment attribute.)

The ARM always aligns fields on natural boundaries; PPC32 and X8632
don't. (In other words, this has been wrong for years.)

If we ever support (SIMD) vector types, this'll have to be revisited.

Location:
trunk/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/ARM/arm-backend.lisp

    r14171 r14222  
    286286                                         :signed-char t
    287287                                         :struct-by-value t
     288                                         :natural-alignment t
    288289                                         :prepend-underscore nil)
    289290                           :ff-call-expand-function
     
    301302                           :attributes '(:bits-per-word  32
    302303                                         :signed-char nil
     304                                         :natural-alignment t
    303305                                         :struct-by-value t)
    304306                           :ff-call-expand-function
  • trunk/source/lib/foreign-types.lisp

    r14171 r14222  
    10951095           (first-field-p t)
    10961096           (attributes (ftd-attributes *target-ftd*))
    1097            (poweropen-alignment (getf attributes :poweropen-alignment)))
    1098          
     1097           (poweropen-alignment (getf attributes :poweropen-alignment))
     1098           (bits-per-word (getf attributes :bits-per-word))
     1099           (use-natural-alignment (getf attributes :natural-alignment)))
     1100       
    10991101      (dolist (field fields)
    11001102        (destructuring-bind (var type &optional bits) field
     
    11111113                                    natural-alignment)
    11121114                                  (min 32 natural-alignment))
    1113                                 natural-alignment)))
     1115                                (if use-natural-alignment
     1116                                  natural-alignment
     1117                                  (min bits-per-word natural-alignment)))))
    11141118                 (parsed-field
    11151119                  (make-foreign-record-field :type field-type
Note: See TracChangeset for help on using the changeset viewer.