Changeset 8565a42 in mainline for uspace/app/tester/float


Ignore:
Timestamp:
2018-03-02T20:34:50Z (8 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1a81f69, d5e5fd1
Parents:
3061bc1 (diff), 34e1206 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:34:50)
git-committer:
GitHub <noreply@…> (2018-03-02 20:34:50)
Message:

Remove all trailing whitespace, everywhere.

See individual commit messages for details.

Location:
uspace/app/tester/float
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/float/float1.c

    r3061bc1 r8565a42  
    5252                double e = 0;
    5353                double f = 1;
    54                
     54
    5555                for (double d = 1; e != le; d *= f, f += 1) {
    5656                        le = e;
    5757                        e = e + 1 / d;
    5858                }
    59                
     59
    6060                if ((uint32_t) (e * PRECISION) != E_10E8) {
    6161                        atomic_inc(&threads_fault);
     
    6363                }
    6464        }
    65        
     65
    6666        atomic_inc(&threads_finished);
    6767}
     
    7070{
    7171        atomic_count_t total = 0;
    72        
     72
    7373        atomic_set(&threads_finished, 0);
    7474        atomic_set(&threads_fault, 0);
    75        
     75
    7676        TPRINTF("Creating threads");
    7777        for (unsigned int i = 0; i < THREADS; i++) {
     
    8080                        break;
    8181                }
    82                
     82
    8383                TPRINTF(".");
    8484                total++;
    8585        }
    86        
     86
    8787        TPRINTF("\n");
    88        
     88
    8989        while (atomic_get(&threads_finished) < total) {
    9090                TPRINTF("Threads left: %" PRIua "\n",
     
    9292                thread_sleep(1);
    9393        }
    94        
     94
    9595        if (atomic_get(&threads_fault) == 0)
    9696                return NULL;
    97        
     97
    9898        return "Test failed";
    9999}
  • uspace/app/tester/float/softfloat1.c

    r3061bc1 r8565a42  
    100100        if (a < b)
    101101                return -1;
    102        
     102
    103103        if (a > b)
    104104                return 1;
    105        
     105
    106106        return 0;
    107107}
     
    111111        if (a < b)
    112112                return -1;
    113        
     113
    114114        if (a > b)
    115115                return 1;
    116        
     116
    117117        return 0;
    118118}
     
    122122{
    123123        uint_to_double_op_t op = (uint_to_double_op_t) f;
    124        
     124
    125125        double c;
    126126        double sc;
    127127        op(uop_a[i], &c, &sc);
    128        
     128
    129129        *pic = (cmptype_t) (c * PRECISION);
    130130        *pisc = (cmptype_t) (sc * PRECISION);
     
    135135{
    136136        double_to_uint_op_t op = (double_to_uint_op_t) f;
    137        
     137
    138138        unsigned int c;
    139139        unsigned int sc;
    140140        op(dop_a[i], &c, &sc);
    141        
     141
    142142        *pic = (cmptype_t) c;
    143143        *pisc = (cmptype_t) sc;
     
    148148{
    149149        float_binary_op_t op = (float_binary_op_t) f;
    150        
     150
    151151        float c;
    152152        float sc;
    153153        op(fop_a[i], fop_a[j], &c, &sc);
    154        
     154
    155155        *pic = (cmptype_t) (c * PRECISION);
    156156        *pisc = (cmptype_t) (sc * PRECISION);
     
    161161{
    162162        float_cmp_op_t op = (float_cmp_op_t) f;
    163        
     163
    164164        op(dop_a[i], dop_a[j], pis, piss);
    165165}
     
    169169{
    170170        double_binary_op_t op = (double_binary_op_t) f;
    171        
     171
    172172        double c;
    173173        double sc;
    174174        op(dop_a[i], dop_a[j], &c, &sc);
    175        
     175
    176176        *pic = (cmptype_t) (c * PRECISION);
    177177        *pisc = (cmptype_t) (sc * PRECISION);
     
    182182{
    183183        double_cmp_op_t op = (double_cmp_op_t) f;
    184        
     184
    185185        op(dop_a[i], dop_a[j], pis, piss);
    186186}
     
    189189{
    190190        bool correct = true;
    191        
     191
    192192        for (unsigned int i = 0; i < OPERANDS; i++) {
    193193                cmptype_t ic;
    194194                cmptype_t isc;
    195                
     195
    196196                template(f, i, &ic, &isc);
    197197                cmptype_t diff = ic - isc;
    198                
     198
    199199                if (diff != 0) {
    200200                        TPRINTF("i=%u ic=%" PRIdCMPTYPE " isc=%" PRIdCMPTYPE "\n",
     
    203203                }
    204204        }
    205        
     205
    206206        return correct;
    207207}
     
    210210{
    211211        bool correct = true;
    212        
     212
    213213        for (unsigned int i = 0; i < OPERANDS; i++) {
    214214                for (unsigned int j = 0; j < OPERANDS; j++) {
    215215                        cmptype_t ic;
    216216                        cmptype_t isc;
    217                        
     217
    218218                        template(f, i, j, &ic, &isc);
    219219                        cmptype_t diff = ic - isc;
    220                        
     220
    221221                        if (diff != 0) {
    222222                                TPRINTF("i=%u, j=%u ic=%" PRIdCMPTYPE
     
    226226                }
    227227        }
    228        
     228
    229229        return correct;
    230230}
     
    275275                return;
    276276        }
    277        
     277
    278278        *pc = a / b;
    279279        *psc = div_float(a, b);
     
    284284{
    285285        *pis = fcmp(a, b);
    286        
     286
    287287        if (is_float_lt(a, b) == -1)
    288288                *piss = -1;
     
    320320                return;
    321321        }
    322        
     322
    323323        *pc = a / b;
    324324        *psc = div_double(a, b);
     
    329329{
    330330        *pis = dcmp(a, b);
    331        
     331
    332332        if (is_double_lt(a, b) == -1)
    333333                *piss = -1;
     
    343343{
    344344        bool err = false;
    345        
     345
    346346        if (!test_template_binary(float_template_binary, float_add_operator)) {
    347347                err = true;
    348348                TPRINTF("%s\n", "Float addition failed");
    349349        }
    350        
     350
    351351        if (!test_template_binary(float_template_binary, float_sub_operator)) {
    352352                err = true;
    353353                TPRINTF("%s\n", "Float addition failed");
    354354        }
    355        
     355
    356356        if (!test_template_binary(float_template_binary, float_mul_operator)) {
    357357                err = true;
    358358                TPRINTF("%s\n", "Float multiplication failed");
    359359        }
    360        
     360
    361361        if (!test_template_binary(float_template_binary, float_div_operator)) {
    362362                err = true;
    363363                TPRINTF("%s\n", "Float division failed");
    364364        }
    365        
     365
    366366        if (!test_template_binary(float_compare_template, float_cmp_operator)) {
    367367                err = true;
    368368                TPRINTF("%s\n", "Float comparison failed");
    369369        }
    370        
     370
    371371        if (!test_template_binary(double_template_binary, double_add_operator)) {
    372372                err = true;
    373373                TPRINTF("%s\n", "Double addition failed");
    374374        }
    375        
     375
    376376        if (!test_template_binary(double_template_binary, double_sub_operator)) {
    377377                err = true;
    378378                TPRINTF("%s\n", "Double addition failed");
    379379        }
    380        
     380
    381381        if (!test_template_binary(double_template_binary, double_mul_operator)) {
    382382                err = true;
    383383                TPRINTF("%s\n", "Double multiplication failed");
    384384        }
    385        
     385
    386386        if (!test_template_binary(double_template_binary, double_div_operator)) {
    387387                err = true;
    388388                TPRINTF("%s\n", "Double division failed");
    389389        }
    390        
     390
    391391        if (!test_template_binary(double_compare_template, double_cmp_operator)) {
    392392                err = true;
    393393                TPRINTF("%s\n", "Double comparison failed");
    394394        }
    395        
     395
    396396        if (!test_template_unary(uint_to_double_template,
    397397            uint_to_double_operator)) {
     
    399399                TPRINTF("%s\n", "Conversion from unsigned int to double failed");
    400400        }
    401        
     401
    402402        if (!test_template_unary(double_to_uint_template,
    403403            double_to_uint_operator)) {
     
    405405                TPRINTF("%s\n", "Conversion from double to unsigned int failed");
    406406        }
    407        
     407
    408408        if (!test_template_unary(double_to_uint_template,
    409409            double_to_int_operator)) {
     
    411411                TPRINTF("%s\n", "Conversion from double to signed int failed");
    412412        }
    413        
     413
    414414        if (err)
    415415                return "Software floating point imprecision";
    416        
     416
    417417        return NULL;
    418418}
Note: See TracChangeset for help on using the changeset viewer.