Changeset a9b657a for src/libcfa


Ignore:
Timestamp:
Mar 10, 2017, 11:01:31 AM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
dc0557d
Parents:
c857ad3 (diff), 149d297 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

Location:
src/libcfa
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/libcfa/concurrency/CtxSwitch-i386.S

    rc857ad3 ra9b657a  
    5252        movl 4(%esp),%eax
    5353
     54        // Save floating & SSE control words on the stack.
     55
     56        sub    $8,%esp
     57        stmxcsr 0(%esp)         // 4 bytes
     58        fnstcw  4(%esp)         // 2 bytes
     59
    5460        // Save volatile registers on the stack.
    5561
     
    6975        // argument is now at 8 + 12 = 20(%esp)
    7076
    71         movl 20(%esp),%eax
     77        movl 28(%esp),%eax
    7278
    7379        // Load new context from the "to" area.
     
    8187        popl %edi
    8288        popl %ebx
     89
     90        // Load floating & SSE control words from the stack.
     91
     92        fldcw   4(%esp)
     93        ldmxcsr 0(%esp)
     94        add    $8,%esp
    8395
    8496        // Return to thread.
  • TabularUnified src/libcfa/concurrency/CtxSwitch-x86_64.S

    rc857ad3 ra9b657a  
    4747CtxSwitch:
    4848
    49         // Save volatile registers on the stack.
     49        // Save floating & SSE control words on the stack.
    5050
    5151        subq   $8,%rsp
    5252        stmxcsr 0(%rsp)         // 4 bytes
    5353        fnstcw  4(%rsp)         // 2 bytes
     54
     55        // Save volatile registers on the stack.
     56
    5457        pushq %r15
    5558        pushq %r14
     
    7578        popq %r14
    7679        popq %r15
     80
     81        // Load floating & SSE control words from the stack.
     82
    7783        fldcw   4(%rsp)
    7884        ldmxcsr 0(%rsp)
    79         addq $8,%rsp
     85        addq   $8,%rsp
    8086
    8187        // Return to thread.
  • TabularUnified src/libcfa/concurrency/invoke.c

    rc857ad3 ra9b657a  
    9191        struct FakeStack {
    9292            void *fixedRegisters[3];                    // fixed registers ebx, edi, esi (popped on 1st uSwitch, values unimportant)
    93             void *rturn;                                      // where to go on return from uSwitch
     93            uint32_t mxcr;                              // SSE Status and Control bits (control bits are preserved across function calls)
     94            uint16_t fcw;                               // X97 FPU control word (preserved across function calls)
     95            void *rturn;                                // where to go on return from uSwitch
    9496            void *dummyReturn;                          // fake return compiler would have pushed on call to uInvoke
    9597            void *argument[3];                          // for 16-byte ABI, 16-byte alignment starts here
     
    108110      struct FakeStack {
    109111            void *fixedRegisters[5];                    // fixed registers rbx, r12, r13, r14, r15
    110             uint32_t mxcr;                                  // SSE Status and Control bits (control bits are preserved across function calls)
    111             uint16_t fcw;                                   // X97 FPU control word (preserved across function calls)
    112             void *rturn;                                      // where to go on return from uSwitch
     112            uint32_t mxcr;                              // SSE Status and Control bits (control bits are preserved across function calls)
     113            uint16_t fcw;                               // X97 FPU control word (preserved across function calls)
     114            void *rturn;                                // where to go on return from uSwitch
    113115            void *dummyReturn;                          // NULL return address to provide proper alignment
    114116      };
  • TabularUnified src/libcfa/fstream

    rc857ad3 ra9b657a  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Apr 28 08:08:04 2016
    13 // Update Count     : 88
     12// Last Modified On : Tue Mar  7 14:48:08 2017
     13// Update Count     : 91
    1414//
    1515
     
    2323        void *file;
    2424        _Bool sepDefault;
    25         int sepOnOff;                                                                           // FIX ME: type should be _Bool
     25        _Bool sepOnOff;
    2626        char separator[separateSize];
    2727}; // ofstream
     
    3232void sepReset( ofstream * );
    3333void sepReset( ofstream *, _Bool );
     34const char * sepGet( ofstream * );
    3435void sepSet( ofstream *, const char * );
    35 const char * sepGet( ofstream * );
    3636_Bool sepDisable( ofstream * );
    3737_Bool sepEnable( ofstream * );
     38
    3839int fail( ofstream * );
    3940int flush( ofstream * );
  • TabularUnified src/libcfa/fstream.c

    rc857ad3 ra9b657a  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 15 13:35:29 2016
    13 // Update Count     : 188
     12// Last Modified On : Tue Mar  7 14:48:09 2017
     13// Update Count     : 192
    1414//
    1515
     
    2121#include <stdarg.h>                                                                             // varargs
    2222#include <string.h>                                                                             // strlen
     23#include <stdbool.h>                                                                    // true/false
    2324#include <float.h>                                                                              // DBL_DIG, LDBL_DIG
    2425#include <complex.h>                                                                    // creal, cimag
     
    3233void sepReset( ofstream * os ) { os->sepOnOff = os->sepDefault; }
    3334void sepReset( ofstream * os, _Bool reset ) { os->sepDefault = reset; os->sepOnOff = os->sepDefault; }
     35const char * sepGet( ofstream * os ) { return &(os->separator[0]); }
     36
    3437void sepSet( ofstream * os, const char * s ) {
    3538        strncpy( &(os->separator[0]), s, separateSize - 1 );
    3639        os->separator[separateSize - 1] = '\0';
    3740} // sepSet
    38 const char * sepGet( ofstream * os ) { return &(os->separator[0]); }
     41
    3942_Bool sepDisable( ofstream *os ) {
    4043        _Bool temp = os->sepDefault;
    41         os->sepDefault = 0;
     44        os->sepDefault = false;
    4245        sepReset( os );
    4346        return temp;
    4447} // sepDisable
     48
    4549_Bool sepEnable( ofstream *os ) {
    4650        _Bool temp = os->sepDefault;
    47         os->sepDefault = 1;
     51        os->sepDefault = true;
    4852        sepReset( os );
    4953        return temp;
Note: See TracChangeset for help on using the changeset viewer.