{"action":"created","issue":{"url":"https://api.github.com/repos/avr-llvm/llvm/issues/62","labels_url":"https://api.github.com/repos/avr-llvm/llvm/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/avr-llvm/llvm/issues/62/comments","events_url":"https://api.github.com/repos/avr-llvm/llvm/issues/62/events","html_url":"https://github.com/avr-llvm/llvm/issues/62","id":60327259,"number":62,"title":"Support postincrement/predecrement instructions","user":{"login":"dylanmckay","id":7722159,"avatar_url":"https://avatars.githubusercontent.com/u/7722159?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanmckay","html_url":"https://github.com/dylanmckay","followers_url":"https://api.github.com/users/dylanmckay/followers","following_url":"https://api.github.com/users/dylanmckay/following{/other_user}","gists_url":"https://api.github.com/users/dylanmckay/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanmckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanmckay/subscriptions","organizations_url":"https://api.github.com/users/dylanmckay/orgs","repos_url":"https://api.github.com/users/dylanmckay/repos","events_url":"https://api.github.com/users/dylanmckay/events{/privacy}","received_events_url":"https://api.github.com/users/dylanmckay/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/avr-llvm/llvm/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-09T11:00:05Z","updated_at":"2015-03-20T02:36:58Z","closed_at":null,"body":"The LLVM AsmParser does not take into account tokens such as `+` on operands as being a part of the instruction itself.\r\n\r\nFor example, this is the definition for `ST P+, Rr`:\r\n\r\n``` cpp\r\n// ST P+, Rr\r\n// Stores the value of Rr into the location addressed by pointer P.\r\n// Post increments P.\r\nlet Constraints = \"$ptrreg = $base_wb,@earlyclobber $base_wb\" in\r\ndef STPtrPiRr : FSTLDPtrPiReg<0b1,\r\n                              (outs LDSTPtrReg:$base_wb),\r\n                              (ins LDSTPtrReg:$ptrreg, GPR8:$reg, i8imm:$offs),\r\n                              \"st\\t$ptrreg +, $reg\",\r\n                              [(set i16:$base_wb,\r\n                              (post_store GPR8:$reg, i16:$ptrreg, imm:$offs))]>;\r\n```\r\n\r\nWe put the `+` suffix on the first operand, but LLVM does not handle it correctly.\r\n\r\nInstead, when parsing operands, we hit an \"unexpected token\" error.\r\n\r\nWe either need to patch the `AsmParser` to handle non-variable tokens like these as part of the instruction definition (and hopefully upstream!).\r\n\r\nEither that or we could hack AVRAsmParser by manually handling all of the cases where this applies, and then passing control to the tablegen'd instruction parsing routines if this doesn't apply.\r\n\r\n`STD P+q, Rd` is another offending example -- the `+` should be a part of instruction matching, but it isn't handled correctly. "},"comment":{"url":"https://api.github.com/repos/avr-llvm/llvm/issues/comments/83860727","html_url":"https://github.com/avr-llvm/llvm/issues/62#issuecomment-83860727","issue_url":"https://api.github.com/repos/avr-llvm/llvm/issues/62","id":83860727,"user":{"login":"dylanmckay","id":7722159,"avatar_url":"https://avatars.githubusercontent.com/u/7722159?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanmckay","html_url":"https://github.com/dylanmckay","followers_url":"https://api.github.com/users/dylanmckay/followers","following_url":"https://api.github.com/users/dylanmckay/following{/other_user}","gists_url":"https://api.github.com/users/dylanmckay/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanmckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanmckay/subscriptions","organizations_url":"https://api.github.com/users/dylanmckay/orgs","repos_url":"https://api.github.com/users/dylanmckay/repos","events_url":"https://api.github.com/users/dylanmckay/events{/privacy}","received_events_url":"https://api.github.com/users/dylanmckay/received_events","type":"User","site_admin":false},"created_at":"2015-03-20T02:36:58Z","updated_at":"2015-03-20T02:36:58Z","body":"In commit 7798c7b, the preincrement/posdecrement parsing support was fixed.\r\n\r\nThe `reg+imm` operand kind (as in `STD P+q, Rd`) does not work currently."}}