{"action":"created","issue":{"url":"https://api.github.com/repos/ldc-developers/ldc/issues/1482","repository_url":"https://api.github.com/repos/ldc-developers/ldc","labels_url":"https://api.github.com/repos/ldc-developers/ldc/issues/1482/labels{/name}","comments_url":"https://api.github.com/repos/ldc-developers/ldc/issues/1482/comments","events_url":"https://api.github.com/repos/ldc-developers/ldc/issues/1482/events","html_url":"https://github.com/ldc-developers/ldc/issues/1482","id":154008946,"number":1482,"title":"operations on integer SIMD vectors","user":{"login":"9il","id":845083,"avatar_url":"https://avatars.githubusercontent.com/u/845083?v=3","gravatar_id":"","url":"https://api.github.com/users/9il","html_url":"https://github.com/9il","followers_url":"https://api.github.com/users/9il/followers","following_url":"https://api.github.com/users/9il/following{/other_user}","gists_url":"https://api.github.com/users/9il/gists{/gist_id}","starred_url":"https://api.github.com/users/9il/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/9il/subscriptions","organizations_url":"https://api.github.com/users/9il/orgs","repos_url":"https://api.github.com/users/9il/repos","events_url":"https://api.github.com/users/9il/events{/privacy}","received_events_url":"https://api.github.com/users/9il/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-05-10T13:40:11Z","updated_at":"2016-05-12T11:37:16Z","closed_at":null,"body":"LDC allows to multiply  vectors composed of `ushort`, but `uint` and `ulong` are not allowed. AVX-512 has `vpmullq` and `vpaddq` instructions, which are supported in LLVM.\r\n\r\n---------\r\n```d\r\nvoid ok(ref __vector(ushort[16]) a)\r\n{\r\n    a = a * a;\r\n}\r\n```\r\n```asm\r\n\t.cfi_startproc\r\n\tvmovdqu16\t(%rdi), %ymm0\r\n\tvpmullw\t%ymm0, %ymm0, %ymm0\r\n\tvmovdqu16\t%ymm0, (%rdi)\r\n\tretq\r\n```\r\n---------\r\n```d\r\nvoid fail(ref __vector(ulong[4]) a)\r\n{\r\n    a = a * a;\r\n}\r\n```\r\n\r\n```\r\n  avx                   - Enable AVX instructions.\r\n  avx2                  - Enable AVX2 instructions.\r\n  avx512bw              - Enable AVX-512 Byte and Word Instructions.\r\n  avx512cd              - Enable AVX-512 Conflict Detection Instructions.\r\n  avx512dq              - Enable AVX-512 Doubleword and Quadword Instructions.\r\n  avx512er              - Enable AVX-512 Exponential and Reciprocal Instructions.\r\n  avx512f               - Enable AVX-512 instructions.\r\n  avx512pf              - Enable AVX-512 PreFetch Instructions.\r\n  avx512vl              - Enable AVX-512 Vector Length eXtensions.\r\n```"},"comment":{"url":"https://api.github.com/repos/ldc-developers/ldc/issues/comments/218732294","html_url":"https://github.com/ldc-developers/ldc/issues/1482#issuecomment-218732294","issue_url":"https://api.github.com/repos/ldc-developers/ldc/issues/1482","id":218732294,"user":{"login":"JohanEngelen","id":10983051,"avatar_url":"https://avatars.githubusercontent.com/u/10983051?v=3","gravatar_id":"","url":"https://api.github.com/users/JohanEngelen","html_url":"https://github.com/JohanEngelen","followers_url":"https://api.github.com/users/JohanEngelen/followers","following_url":"https://api.github.com/users/JohanEngelen/following{/other_user}","gists_url":"https://api.github.com/users/JohanEngelen/gists{/gist_id}","starred_url":"https://api.github.com/users/JohanEngelen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohanEngelen/subscriptions","organizations_url":"https://api.github.com/users/JohanEngelen/orgs","repos_url":"https://api.github.com/users/JohanEngelen/repos","events_url":"https://api.github.com/users/JohanEngelen/events{/privacy}","received_events_url":"https://api.github.com/users/JohanEngelen/received_events","type":"User","site_admin":false},"created_at":"2016-05-12T11:37:16Z","updated_at":"2016-05-12T11:37:16Z","body":"Btw, dlang.org provides a workaround for if the compiler does not support operations:\r\n```D\r\nfloat4 a,b;\r\nstatic if (__traits(compiles, a/b))\r\n    c = a / b;\r\nelse\r\n    c[] = a[] / b[];\r\n```\r\nDMD could do the rewriting itself, rather than having the programmer do it."}}