break;
}
+ // return immediately and spin if there is no one to yield to
v3_yield(local_core,-1);
}
int ret = 0;
- if ((vm_info->run_state != VM_RUNNING) ||
+ if ((vm_info->run_state != VM_RUNNING) &&
(vm_info->run_state != VM_SIMULATING)) {
return 0;
}
struct v3_barrier * barrier = &(vm_info->barrier);
- if ((vm_info->run_state != VM_RUNNING) ||
+ if ((vm_info->run_state != VM_RUNNING) &&
(vm_info->run_state != VM_SIMULATING)) {
return 0;
}
if (barrier->active == 0) {
return 0;
}
+#ifndef V3_CONFIG_FP_SWITCH
+ v3_get_fp_state(core); // snapshot FP state now
+#else
+# ifdef V3_CONFIG_LAZY_FP_SWITCH
+ v3_get_fp_state(core); // snapshot FP state now regardless of lazy eval
+# endif
+#endif
V3_Print(core->vm_info, core, "Core %d waiting at barrier\n", core->vcpu_id);
// wait for cpu bit to clear
while (v3_bitmap_check(&(barrier->cpu_map), core->vcpu_id)) {
+ // Barrier wait will spin if there is no competing work
v3_yield(core,-1);
}
+#ifndef V3_CONFIG_FP_SWITCH
+ core->fp_state.need_restore=1; // restore FP on next entry
+#else
+# ifdef V3_CONFIG_LAZY_FP_SWITCH
+ core->fp_state.need_restore=1; // restore FP on next entry
+# endif
+#endif
+
return 0;
}