Changeset 459 for trunk/user/sort/sort.c


Ignore:
Timestamp:
Aug 13, 2018, 1:43:20 PM (3 years ago)
Author:
alain
Message:

Introduce the math library, to support the floating point
data used by the multi-thread fft application.
Fix several bugs regarding the FPU context save/restore.
Introduce support for the %f format in printf.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/user/sort/sort.c

    r457 r459  
    2626#include <pthread.h>
    2727#include <almosmkh.h>
     28#include <hal_macros.h>
    2829
    2930#define ARRAY_LENGTH        0x400    // 1024 values
     
    3334#define DISPLAY_ARRAY       0
    3435#define INTERACTIVE_MODE    0
    35 
    36 ///////////////////////////////////////////////////////
    37 // macros for fixed format cxy <=> (x,y) translation
    38 // TODO these macros are only for TSAR architecture...
    39 ///////////////////////////////////////////////////////
    40 
    41 #define CXY_FROM_XY( x , y )  ((x<<4) + y)
    42 
    43 #define X_FROM_CXY( cxy )     ((cxy>>4) & 0xF)
    44 
    45 #define Y_FROM_CXY( cxy )     (cxy & 0xF)
    4636
    4737/////////////////////////////////////////////////////////////
     
    239229    // get core coordinates and user index for the main thread
    240230    get_core( &main_cxy , & main_lid );
    241     main_x   = X_FROM_CXY( main_cxy );
    242     main_y   = Y_FROM_CXY( main_cxy );
     231    main_x   = HAL_X_FROM_CXY( main_cxy );
     232    main_y   = HAL_Y_FROM_CXY( main_cxy );
    243233    main_uid = (((main_x * y_size) + main_y) * ncores) + main_lid;
    244234
     
    308298                // set thread attributes for all threads
    309299                attr[thread_uid].attributes = PT_ATTR_CLUSTER_DEFINED | PT_ATTR_CORE_DEFINED;
    310                 attr[thread_uid].cxy        = CXY_FROM_XY( x , y );
     300                attr[thread_uid].cxy        = HAL_CXY_FROM_XY( x , y );
    311301                attr[thread_uid].lid        = lid;
    312302
Note: See TracChangeset for help on using the changeset viewer.