{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/594","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/594/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/594/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/594/events","html_url":"https://github.com/dotnet/coreclr/issues/594","id":65071085,"number":594,"title":"Coreclr has missing FPREG entries causing the build to fail on FreeBSD","user":{"login":"josteink","id":411338,"avatar_url":"https://avatars.githubusercontent.com/u/411338?v=3","gravatar_id":"","url":"https://api.github.com/users/josteink","html_url":"https://github.com/josteink","followers_url":"https://api.github.com/users/josteink/followers","following_url":"https://api.github.com/users/josteink/following{/other_user}","gists_url":"https://api.github.com/users/josteink/gists{/gist_id}","starred_url":"https://api.github.com/users/josteink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josteink/subscriptions","organizations_url":"https://api.github.com/users/josteink/orgs","repos_url":"https://api.github.com/users/josteink/repos","events_url":"https://api.github.com/users/josteink/events{/privacy}","received_events_url":"https://api.github.com/users/josteink/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/coreclr/labels/FreeBSD","name":"FreeBSD","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-29T15:38:42Z","updated_at":"2015-04-11T10:14:30Z","closed_at":null,"body":"I'm creating a separate issue/bug for this, because I'd like it to get some scrutiny.\r\n\r\nI did hack a little bit at this myself, but I literally have zero experience doing direct FPU-programming. While I've fixed the related compiler-warnings and errors, I can in no way guarantee that the following code is correct:\r\n\r\n````c++\r\n// from x86/fpu.h: struct __envxmm64\r\n#define FPREG_ControlWord(uc)   (((savefpu*)((uc)->uc_mcontext.mc_fpstate))->sv_env.en_cw)\r\n#define FPREG_StatusWord(uc)    (((savefpu*)((uc)->uc_mcontext.mc_fpstate))->sv_env.en_sw)\r\n#define FPREG_TagWord(uc)       (((savefpu*)((uc)->uc_mcontext.mc_fpstate))->sv_env.en_tw)\r\n#define FPREG_ErrorOffset(uc)   (((savefpu*)((uc)->uc_mcontext.mc_fpstate))->sv_env.en_rip)                 // *(DWORD*)&((uc)->__fpregs_mem.rdp)\r\n#define FPREG_ErrorSelector(uc) *((WORD*) &(((savefpu*)((uc)->uc_mcontext.mc_fpstate))->sv_env.en_rip) + 2) // *(((WORD*)&((uc)->__fpregs_mem.rip)) + 2)\r\n#define FPREG_DataOffset(uc)    (((savefpu*)((uc)->uc_mcontext.mc_fpstate))->sv_env.en_rdp)                 // *(DWORD*)&((uc)->__fpregs_mem.rdp)\r\n#define FPREG_DataSelector(uc)  *((WORD*) &(((savefpu*)((uc)->uc_mcontext.mc_fpstate))->sv_env.en_rdp) + 2) // *(((WORD*)&((uc)->__fpregs_mem.rdp)) + 2)\r\n#define FPREG_MxCsr(uc)         (((savefpu*)((uc)->uc_mcontext.mc_fpstate))->sv_env.en_mxcsr)\r\n#define FPREG_MxCsr_Mask(uc)    (((savefpu*)((uc)->uc_mcontext.mc_fpstate))->sv_env.en_mxcsr_mask)\r\n````\r\n\r\n(From https://github.com/josteink/coreclr/commit/3dab47d18a16742ce618cea8d996cfc861e7bccc )\r\n\r\nEspecially [these lines](https://github.com/josteink/coreclr/blob/3dab47d18a16742ce618cea8d996cfc861e7bccc/src/pal/src/arch/i386/context.cpp#L143-L146) where the original code I based it on had lots of pointer-magic going on, I have no idea if are translated correctly.\r\n\r\nAny feedback or assistance on this issue would be appreciated."},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/91820241","html_url":"https://github.com/dotnet/coreclr/issues/594#issuecomment-91820241","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/594","id":91820241,"user":{"login":"josteink","id":411338,"avatar_url":"https://avatars.githubusercontent.com/u/411338?v=3","gravatar_id":"","url":"https://api.github.com/users/josteink","html_url":"https://github.com/josteink","followers_url":"https://api.github.com/users/josteink/followers","following_url":"https://api.github.com/users/josteink/following{/other_user}","gists_url":"https://api.github.com/users/josteink/gists{/gist_id}","starred_url":"https://api.github.com/users/josteink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josteink/subscriptions","organizations_url":"https://api.github.com/users/josteink/orgs","repos_url":"https://api.github.com/users/josteink/repos","events_url":"https://api.github.com/users/josteink/events{/privacy}","received_events_url":"https://api.github.com/users/josteink/received_events","type":"User","site_admin":false},"created_at":"2015-04-11T10:14:30Z","updated_at":"2015-04-11T10:14:30Z","body":"With that PR merged, we have 10 out of 11 registers worked out. Only 1 left to go. I've given it a try, but I don't really feel like I'm making any headway.\r\n\r\nAnyone else care to have a look at this? @ajensenwaud ? @kangaroo ? @janhenke ?"}}