Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =====
- The below was generated from the thread in
- https://www.realworldtech.com/forum/?threadid=205288&curpostid=205288
- to make it easier to read it using the command line provided/suggested
- (Thanks!) by psychoslave @ https://news.ycombinator.com/item?id=30673056
- which was
- elinks 'https://www.realworldtech.com/forum/?threadid=205288' -dump | grep curpostid | sed -e 's/.*https/https/' | while read -r url ; do elinks -dump $url | awk '/By:/, /Previous/' | sed \$d ; done
- =====
- By: anonymou5 ([email protected]), March 9, 2022 3:58 am
- Room: [25]Moderated Discussions
- > What have the guys deciding the naming of these instructions have been
- smoking?
- Direct your feedback and contributions to https://lists.riscv.org/g/main
- to make it productive?
- By: Heikki Kultala ([email protected]), March 9, 2022
- 1:35 am
- Room: [25]Moderated Discussions
- There seem to be lots of really stupid instruction naming conventions on
- RISC-V:
- When they were proposing a select instruction to the BMI extension, they
- were going to call it "cmov"
- In the V-extension, they have an instruction named "vrgather".
- But that instruction is not a gather load instruction. This instructoin is
- just a shuffle instruction.
- What have the guys deciding the naming of these instructions have been
- smoking?
- [26]Next Post in Thread >
- Topic Posted By Date
- [27]RISC-V asm instruction name madness Heikki Kultala 2022/03/09
- 01:35 AM
- [28]RISC-V asm instruction name madness anonymou5 2022/03/09
- 03:58 AM
- [29]RISC-V asm instruction name madness -.- 2022/03/09
- 06:39 AM
- [30]RISC-V asm instruction name madness dmcq 2022/03/09
- 07:04 AM
- [31]RISC-V asm instruction name madness -.- 2022/03/09
- 06:52 PM
- [32]RISC-V asm instruction name madness Anon 2022/03/09
- 07:33 PM
- [33]RISC-V asm instruction name Jukka Larja 2022/03/10
- madness 08:55 AM
- [34]RISC-V asm instruction name dmcq 2022/03/10
- madness 10:32 AM
- [35]RISC-V asm instruction name -.- 2022/03/10
- madness 08:52 PM
- [36]RISC-V asm instruction name rwessel 2022/03/11
- madness 10:38 AM
- [37]More descriptive asm -.- 2022/03/11
- instruction names 09:22 PM
- [38]More descriptive asm dmcq 2022/03/12
- instruction names 01:58 AM
- [39]More descriptive asm dmcq 2022/03/12
- instruction names 01:42 PM
- [40]More descriptive asm -.- 2022/03/12
- instruction names 09:28 PM
- [41]More descriptive dmcq 2022/03/13
- asm instruction names 12:46 PM
- [42]More descriptive dmcq 2022/03/13
- asm instruction names 12:47 PM
- [43]RISC-V asm instruction name Anon 2022/03/10
- madness 09:35 PM
- [44]RISC-V asm instruction name Jukka Larja 2022/03/11
- madness 11:55 PM
- [45]RISC-V asm instruction name anonymou5 2022/03/12
- madness 02:43 AM
- [46]RISC-V asm instruction Jukka Larja 2022/03/13
- name madness 01:25 AM
- [47]RISC-V asm instruction name -.- 2022/03/10
- madness 08:47 PM
- [48]RISC-V asm instruction name Anon 2022/03/10
- madness 09:40 PM
- [49]RISC-V asm instruction name gallier2 2022/03/11
- madness 12:34 AM
- [50]RISC-V asm instruction name Tim 2022/03/11
- madness 11:56 AM
- [51]RISC-V asm instruction name Anon 2022/03/11
- madness 12:25 PM
- [52]RISC-V asm instruction Joern Engel 2022/03/11
- name madness 01:04 PM
- [53]Me, too (but ...) Mark Roulo 2022/03/11
- 12:26 PM
- [54]Me, too (but ...) David Hess 2022/03/12
- 11:39 AM
- [55]Me, too (but ...) Adrian 2022/03/12
- 12:01 PM
- [56]If APL and assembly Mark Roulo 2022/03/12
- language had a baby ... 07:12 PM
- [57]If APL and assembly Adrian 2022/03/13
- language had a baby ... 01:38 AM
- [58]If APL and Mark Roulo 2022/03/13
- assembly language had a baby ... 08:53 AM
- [59]If APL and Adrian 2022/03/13
- assembly language had a baby ... 10:57 AM
- [60]If APL and rwessel 2022/03/13
- assembly language had a baby ... 11:23 AM
- [61]If APL and Andrey 2022/03/14
- assembly language had a baby ... 01:42 AM
- [62]If APL and Anon 2022/03/14
- assembly language had a baby ... 01:57 AM
- [63]If APL Michael S 2022/03/14
- and assembly language had a baby ... 04:07 AM
- [64]Me, too (but ...) Michael S 2022/03/13
- 08:14 AM
- [65]Me, too (but ...) Michael S 2022/03/13
- 08:27 AM
- [66]Me, too (but ...) Adrian 2022/03/13
- 10:29 AM
- [67]Me, too (but ...) David Hess 2022/03/13
- 02:54 PM
- [68]Me, too (but ...) Michael S 2022/03/13
- 03:09 PM
- [69]Me, too (but ...) Andrey 2022/03/14
- 01:27 AM
- [70]Me, too (but ...) Michael S 2022/03/14
- 03:08 AM
- [71]Me, too (but Andrey 2022/03/14
- ...) 05:36 AM
- [72]Me, too (but rwessel 2022/03/14
- ...) 06:32 AM
- [73]Me, too (but Jukka Larja 2022/03/14
- ...) 07:10 AM
- [74]RISC-V asm instruction name Adrian 2022/03/11
- madness 01:06 PM
- [75]RISC-V asm instruction name Andrey 2022/03/11
- madness 04:01 PM
- [76]RISC-V asm instruction Adrian 2022/03/12
- name madness 02:24 AM
- [77]RISC-V asm instruction name anon2 2022/03/11
- madness 05:37 PM
- [78]RISC-V asm instruction name rwessel 2022/03/11
- madness 07:44 PM
- [79]RISC-V asm instruction name madness Heikki Kultala 2022/03/09
- 11:31 PM
- [80]RISC-V asm instruction name madness Adrian 2022/03/10
- 07:33 AM
- [81]RISC-V asm instruction name madness anonymou5 2022/03/10
- 12:59 PM
- [82]RISC-V asm instruction name rwessel 2022/03/11
- madness 10:42 AM
- [83]RISC-V asm instruction name Anon 2022/03/11
- madness 11:44 AM
- [84]RISC-V asm instruction name Adrian 2022/03/11
- madness 01:45 PM
- [85]RISC-V asm instruction name Anon 2022/03/11
- madness 02:33 PM
- [86]RISC-V asm instruction Andrey 2022/03/11
- name madness 04:09 PM
- [87]RISC-V asm instruction Adrian 2022/03/12
- name madness 02:41 AM
- [88]RISC-V asm Andrey 2022/03/12
- instruction name madness 04:57 AM
- [89]RISC-V asm Anon 2022/03/12
- instruction name madness 05:01 AM
- [90]RISC-V asm rwessel 2022/03/12
- instruction name madness 07:12 AM
- [91]RISC-V asm Anon 2022/03/12
- instruction name madness 01:50 PM
- [92]RISC-V asm Adrian 2022/03/12
- instruction name madness 05:50 AM
- [93]RISC-V asm instruction name madness Linus Torvalds 2022/03/10
- 01:25 PM
- [94]RISC-V asm instruction name Ian Ameline 2022/03/10
- madness 03:34 PM
- [95]RISC-V asm instruction name gallier2 2022/03/11
- madness 12:42 AM
- [96]RISC-V asm instruction name konrad.schwarz 2022/03/11
- madness 05:26 AM
- [97]RISC-V asm instruction name konrad.schwarz 2022/03/11
- madness 05:31 AM
- [98]RISC-V asm instruction name Adrian 2022/03/11
- madness 06:25 AM
- [99]RISC-V asm instruction name cqwrteur 2022/03/11
- madness 12:57 PM
- [100]RISC-V asm instruction name Linus Torvalds 2022/03/11
- madness 01:28 PM
- This Post has been deleted
- [101]numeric direction hobold 2022/03/11
- 05:29 PM
- [102]numeric direction RIIR 2022/03/11
- 08:19 PM
- [103]numeric direction anonymou5 2022/03/12
- 02:48 AM
- [104]RISC-V asm instruction name Konrad Schwarz 2022/03/12
- madness 02:31 AM
- [105]RISC-V asm instruction rwessel 2022/03/12
- name madness 07:04 AM
- [106]RISC-V asm instruction name dmcq 2022/03/12
- madness 12:18 PM
- [107]RISC-V asm instruction name ** 2022/03/12
- madness 02:20 PM
- [108]The most clueless post of Heikki Kultala 2022/03/13
- the year 2022 12:28 AM
- [109]RISC-V asm instruction name Joern Engel 2022/03/13
- madness 12:08 AM
- [110]big endian crap Heikki Kultala 2022/03/13
- 12:31 AM
- [111]big endian crap Anne O. Nymous 2022/03/13
- 03:40 AM
- [112]big endian crap dmcq 2022/03/13
- 02:30 PM
- [113]RISC-V asm instruction gallier2 2022/03/14
- name madness 08:09 AM
- [114]RISC-V asm instruction name madness -.- 2022/03/10
- 09:00 PM
- [115]RISC-V asm instruction name Anon 2022/03/10
- madness 09:42 PM
- [116]RISC-V asm instruction name Heikki Kultala 2022/03/10
- madness 10:59 PM
- [117]RISC-V asm instruction name -.- 2022/03/11
- madness 01:21 AM
- [118]RISC-V asm instruction name rwessel 2022/03/11
- madness 10:56 AM
- [119]RISC-V asm instruction name Anon 2022/03/11
- madness 12:07 PM
- [120]RISC-V asm instruction name -.- 2022/03/11
- madness 09:29 PM
- [121]RISC-V asm instruction name madness Andrey 2022/03/10
- 09:55 AM
- [122]Why not both? Matt Sayler 2022/03/10
- 02:56 PM
- [123]Why not both? Andrey 2022/03/10
- 06:01 PM
- [124]Why not both? Matt Sayler 2022/03/11
- 10:10 AM
- [125]RISC-V asm instruction name madness -.- 2022/03/10
- 09:03 PM
- [126]RISC-V asm instruction name Andrey 2022/03/11
- madness 04:01 AM
- [127]Vector ISA and LVI sr 2022/03/09
- 12:26 PM
- Reply to this Topic
- Name: [128]_____________________
- Email: [129]_____________________
- Topic: [130]_____________________
- [131][ ] No Text
- [132]
- _________________________________________
- _________________________________________
- _________________________________________
- _________________________________________
- _________________________________________
- _________________________________________
- _________________________________________
- _________________________________________
- Body: _________________________________________
- _________________________________________
- _________________________________________
- _________________________________________
- _________________________________________
- _________________________________________
- _________________________________________
- _________________________________________
- _________________________________________
- _________________________________________
- _________________________________________
- _________________________________________
- How do you spell avocado? [133]_____________________
- [134][ Post ] [135][ Preview ]
- Editor's Picks
- [136]PhysX87: Software Deficiency
- By [137]David Kanter
- [138]Intel's Sandy Bridge Graphics Architecture
- By [139]David Kanter
- [140]The Spider and the Mountain
- By [141]Paul DeMone
- RWT on Twitter
- o Intel just released a fantastic history of the transistor, tracing the
- evolution of this marvelous technology. The...
- [142]https://t.co/emlyyFwOef [143]about 2 weeks ago
- o Happy New Year! May 2022 be even better than 2021. [144]about 2 months
- ago
- o [145]@TwitterSupport how can I disable notifications from
- recommendations? I have disabled all notifications and still g...
- [146]https://t.co/B0zaVgOU2u [147]about 4 months ago [148]in reply to
- TwitterSupport
- [149]@RWT
- o [150]About Us
- o [151]Contact Us
- o [152]Reprints
- o [153]Advertise at RWT
- o [154]Write for Us
- o [155]Privacy Policy
- o [156]Forum Guidelines
- o [157]Membership
- o [158]TOS
- Copyright (c) 1996-2022 [159]Real World Tech . All Rights Reserved .
- Insert/edit link
- [160]Close
- Enter the destination URL
- URL [161]_____________________
- Link Text [162]_____________________
- [163][ ] Open link in a new tab
- Or link to existing content
- Search [164]_____________________
- No search term specified. Showing recent items. Search or use up and down
- arrow keys to select an item.
- [165]Cancel
- [166][ Add Link ]
- References
- Visible links
- 1. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205288
- 2. https://www.realworldtech.com/feed/
- 3. https://www.realworldtech.com/comments/feed/
- 4. https://www.realworldtech.com/forum/feed/
- 5. https://www.realworldtech.com/wp-json/
- 6. https://www.realworldtech.com/wp-json/wp/v2/pages/2048
- 7. https://www.realworldtech.com/?p=2048
- 8. https://www.realworldtech.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwww.realworldtech.com%2Fforum%2F
- 9. https://www.realworldtech.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwww.realworldtech.com%2Fforum%2F&format=xml
- 10. https://www.realworldtech.com/
- 11. https://www.realworldtech.com/wp-login.php?redirect_to=http%3A%2F%2Fwww.realworldtech.com%2Fforum%2F%3Fthreadid%3D205288%26curpostid%3D205288
- 12. https://www.realworldtech.com/category/cloud/
- 13. https://www.realworldtech.com/category/mobile/
- 14. https://www.realworldtech.com/category/graphics/
- 15. https://www.realworldtech.com/category/chips/
- 16. https://www.realworldtech.com/category/software/
- 17. https://www.realworldtech.com/cpu/
- 18. https://www.realworldtech.com/gpu/
- 19. https://www.realworldtech.com/semis/
- 20. https://www.realworldtech.com/strategy/
- 21. https://www.realworldtech.com/forum/
- 22. http://www.facebook.com/pages/Real-World-Tech/153534084681202
- 23. http://twitter.com/rwt
- 24. https://www.realworldtech.com/feed/rss/
- 25. https://www.realworldtech.com/forum/?roomid=1
- 26. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205290
- 27. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205288
- 28. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205290
- 29. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205292
- 30. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205293
- 31. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205306
- 32. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205308
- 33. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205311
- 34. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205313
- 35. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205324
- 36. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205341
- 37. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205362
- 38. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205365
- 39. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205380
- 40. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205384
- 41. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205397
- 42. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205398
- 43. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205327
- 44. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205364
- 45. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205369
- 46. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205388
- 47. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205323
- 48. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205328
- 49. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205332
- 50. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205345
- 51. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205347
- 52. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205350
- 53. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205348
- 54. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205377
- 55. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205378
- 56. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205383
- 57. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205389
- 58. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205393
- 59. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205395
- 60. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205396
- 61. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205404
- 62. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205405
- 63. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205408
- 64. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205391
- 65. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205392
- 66. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205394
- 67. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205400
- 68. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205401
- 69. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205403
- 70. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205406
- 71. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205409
- 72. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205410
- 73. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205411
- 74. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205351
- 75. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205356
- 76. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205366
- 77. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205359
- 78. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205360
- 79. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205309
- 80. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205310
- 81. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205314
- 82. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205342
- 83. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205344
- 84. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205354
- 85. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205355
- 86. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205357
- 87. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205368
- 88. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205372
- 89. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205373
- 90. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205376
- 91. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205381
- 92. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205374
- 93. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205315
- 94. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205319
- 95. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205333
- 96. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205336
- 97. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205337
- 98. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205338
- 99. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205349
- 100. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205352
- 101. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205358
- 102. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205361
- 103. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205370
- 104. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205367
- 105. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205375
- 106. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205379
- 107. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205382
- 108. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205386
- 109. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205385
- 110. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205387
- 111. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205390
- 112. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205399
- 113. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205412
- 114. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205325
- 115. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205329
- 116. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205330
- 117. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205334
- 118. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205343
- 119. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205346
- 120. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205363
- 121. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205312
- 122. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205318
- 123. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205321
- 124. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205339
- 125. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205326
- 126. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205335
- 127. https://www.realworldtech.com/forum/?threadid=205288&curpostid=205301
- 136. https://www.realworldtech.com/physx87/
- 137. https://www.realworldtech.com/author/dkanter/
- 138. https://www.realworldtech.com/sandy-bridge-gpu/
- 139. https://www.realworldtech.com/author/dkanter/
- 140. https://www.realworldtech.com/ev8-mckinley/
- 141. https://www.realworldtech.com/author/pdemone/
- 142. https://t.co/emlyyFwOef
- 143. http://twitter.com/rwt/statuses/1496298024695476225
- 144. http://twitter.com/rwt/statuses/1477220413696462850
- 145. http://twitter.com/TwitterSupport
- 146. https://t.co/B0zaVgOU2u
- 147. http://twitter.com/rwt/statuses/1458138609295380482
- 148. http://twitter.com/TwitterSupport/statuses/
- 149. Follow @RWT
- http://twitter.com/RWT
- 150. https://www.realworldtech.com/about/
- 151. https://www.realworldtech.com/contact/
- 152. https://www.realworldtech.com/reprints/
- 153. https://www.realworldtech.com/advertise/
- 154. https://www.realworldtech.com/write-for-rwt/
- 155. https://www.realworldtech.com/privacy-policy/
- 156. https://www.realworldtech.com/forum-guidelines/
- 157. https://www.realworldtech.com/membership/
- 158. https://www.realworldtech.com/user-agreement/
- By: anonymou5 ([email protected]), March 9, 2022 3:58 am
- Room: [25]Moderated Discussions
- > What have the guys deciding the naming of these instructions have been
- smoking?
- Direct your feedback and contributions to https://lists.riscv.org/g/main
- to make it productive?
- By: -.- ([email protected]), March 9, 2022 6:39 am
- Room: [25]Moderated Discussions
- Plenty of weird names in many assembly dialects, to be honest.
- PALIGNR in x86 or EXT in AArch64 aren't obvious unless you already know
- what the instruction does.
- Perhaps it's time to move away from compact assembly instruction names?
- I'd say the number of people writing assembly is relatively small compared
- to the number of people reading it, and being less compact could help
- beginners understand the code more easily.
- We're no longer stuck with technology where long names are problematic. We
- aren't using 80 character wide screens any more.
- Why not make opcode names longer and more descriptive? You could always
- keep a more compact version to cater to the few assembly writers without
- autocomplete.
- I just don't see why assembly syntax today still has to follow the design
- principles of ~50 years ago.
- By: dmcq ([email protected]), March 9, 2022 7:04 am
- Room: [25]Moderated Discussions
- -.- ([email protected]) on March 9, 2022 5:39 am wrote:
- > Plenty of weird names in many assembly dialects, to be honest.
- > PALIGNR in x86 or EXT in AArch64 aren't obvious unless you already know
- what the instruction does.
- >
- > Perhaps it's time to move away from compact assembly instruction names?
- I'd say the number
- > of people writing assembly is relatively small compared to the number of
- people reading
- > it, and being less compact could help beginners understand the code more
- easily.
- > We're no longer stuck with technology where long names are problematic.
- > We aren't using 80 character wide screens any more.
- > Why not make opcode names longer and more descriptive? You could always
- keep a
- > more compact version to cater to the few assembly writers without
- autocomplete.
- >
- > I just don't see why assembly syntax today still has to follow the
- design principles of ~50 years ago.
- Well I can see the point of an assembly language support which described
- the instructions when you clicked on them and helped with fields and did
- some other checking. However I don't think making the names longer would
- help, they'd just make them longer to read. Their function is either
- obvious or needs a lookup and a paragrapph to explain.
- By: -.- ([email protected]), March 9, 2022 6:52 pm
- Room: [25]Moderated Discussions
- dmcq ([email protected]) on March 9, 2022 6:04 am wrote:
- > Their function is either obvious or needs a lookup and a paragrapph to
- explain.
- Yes, some will require explanation, but I disagree that simple instruction
- names are always obvious.
- For example, let's take the AArch64 instruction UXTB. Let's say you have
- some assembly experience, but haven't seen that instruction before. Is
- what it does obvious? Would you even be able to roughly guess as to what
- it might do?
- On the other hand, if it were called "EXTEND_U8" or perhaps
- "ZERO_EXTEND_BYTE" or whatever. Maybe it might still not be clear what it
- exactly does, but I'd imagine it'd give much more of a clue regarding its
- functionality, without the need to consult the manual.
- I also don't see if being so much of a hassle to read either.
- It can also help cases where you have looked up the instruction in the
- past, but don't see it often enough to remember what it does all the time.
- Perhaps you've seen "BSL" before, but "BIT_SELECT" is likely going to
- stick in your memory better.
- With ISAs having thousands of instructions nowadays, there's bound to be
- instructions you haven't seen or don't remember clearly.
- By: Anon ([email protected]), March 9, 2022 7:33 pm
- Room: [25]Moderated Discussions
- -.- ([email protected]) on March 9, 2022 5:52 pm wrote:
- > With ISAs having thousands of instructions nowadays, there's bound
- > to be instructions you haven't seen or don't remember clearly.
- Yeah, but most instructions are just variations and ISAs usually have a
- standard way to describe the variations, even when the ISA is a mess like
- x86, ADDPS, the "P" means packed, for more or less a thousand
- instructions, the last "S" means single, I see no point in writing the
- full meaning of those suffixes, the start of the instruction, which
- contains the actual instrcution name, usually get a good share of letters
- to describe it, like INSERTPS.
- By: Jukka Larja ([email protected]), March 10, 2022 8:55
- am
- Room: [25]Moderated Discussions
- Anon ([email protected]) on March 9, 2022 6:33 pm wrote:
- > -.- ([email protected]) on March 9, 2022 5:52 pm wrote:
- > > With ISAs having thousands of instructions nowadays, there's bound
- > > to be instructions you haven't seen or don't remember clearly.
- >
- > Yeah, but most instructions are just variations and ISAs usually have a
- standard way to describe
- > the variations, even when the ISA is a mess like x86, ADDPS, the "P"
- means packed, for more
- > or less a thousand instructions, the last "S" means single, I see no
- point in writing the
- > full meaning of those suffixes, the start of the instruction, which
- contains the actual instrcution
- > name, usually get a good share of letters to describe it, like INSERTPS.
- ADDPS is a perfect example of simple instruction name that I can't easily
- read, while addPackedSingle (or ADDPACKEDSINGLE or ADD_PACKED_SINGLE or
- whatever you fancy) would be easy. After years of reading assembly, I
- don't still don't really like it, because I constantly have to concentrate
- on stupid trivialities like this. Having more letters in instruction names
- would be a huge benefit for readability.
- (I'm not trying to say everyone has this problem, or that majority has it,
- or even that many people have it, but I do. I don't expect ever to learn
- to read assembly fluently. I've had enough practice to know my limits.)
- -JLarja
- By: dmcq ([email protected]), March 10, 2022 10:32 am
- Room: [25]Moderated Discussions
- Jukka Larja ([email protected]) on March 10, 2022 7:55
- am wrote:
- > Anon ([email protected]) on March 9, 2022 6:33 pm wrote:
- > > -.- ([email protected]) on March 9, 2022 5:52 pm wrote:
- > > > With ISAs having thousands of instructions nowadays, there's bound
- > > > to be instructions you haven't seen or don't remember clearly.
- > >
- > > Yeah, but most instructions are just variations and ISAs usually have
- a standard way to describe
- > > the variations, even when the ISA is a mess like x86, ADDPS, the "P"
- means packed, for more
- > > or less a thousand instructions, the last "S" means single, I see no
- point in writing the
- > > full meaning of those suffixes, the start of the instruction, which
- contains the actual instrcution
- > > name, usually get a good share of letters to describe it, like
- INSERTPS.
- >
- > ADDPS is a perfect example of simple instruction name that I can't
- easily read, while addPackedSingle
- > (or ADDPACKEDSINGLE or ADD_PACKED_SINGLE or whatever you fancy) would be
- easy. After years of reading
- > assembly, I don't still don't really like it, because I constantly have
- to concentrate on stupid trivialities
- > like this. Having more letters in instruction names would be a huge
- benefit for readability.
- >
- > (I'm not trying to say everyone has this problem, or that majority has
- it,
- > or even that many people have it, but I do. I don't expect ever to learn
- > to read assembly fluently. I've had enough practice to know my limits.)
- >
- > -JLarja
- It would be far better to have a good editor I think that describes what's
- under the cursor rather than having big long dscriptions everywhere
- written into the text. I've used probably in the order of twenty different
- assembly languages and the main problem I've found is special restrictions
- in arguments and different register orders and knowing what constants are
- allowed.
- By: -.- ([email protected]), March 10, 2022 8:52 pm
- Room: [25]Moderated Discussions
- dmcq ([email protected]) on March 10, 2022 9:32 am wrote:
- > It would be far better to have a good editor I think that describes
- what's under the cursor rather
- > than having big long dscriptions everywhere written into the text.
- That's certainly helpful, but the problem is that it's not really
- universal. Assembly instructions can appear in various places, from forum
- posts and email discussions to webpage articles and console outputs.
- Expecting assembly hints to be implemented everywhere seems unrealistic.
- Yes, more descriptive opcodes won't magically address all complexities,
- but I think it's at least a step in the right direction.
- By: rwessel ([email protected]), March 11, 2022 10:38 am
- Room: [25]Moderated Discussions
- -.- ([email protected]) on March 10, 2022 7:52 pm wrote:
- > dmcq ([email protected]) on March 10, 2022 9:32 am wrote:
- > > It would be far better to have a good editor I think that describes
- what's under the cursor rather
- > > than having big long dscriptions everywhere written into the text.
- >
- > That's certainly helpful, but the problem is that it's not really
- universal. Assembly instructions
- > can appear in various places, from forum posts and email discussions to
- webpage articles and console
- > outputs. Expecting assembly hints to be implemented everywhere seems
- unrealistic.
- >
- > Yes, more descriptive opcodes won't magically address all complexities,
- > but I think it's at least a step in the right direction.
- It's a tradeoff. I write rather more assembler than the vast majority of
- programmers*, but I'm going to be annoyed if you turn assembler into Cobol
- - especially since assembler tends to be pretty bulky to begin with. The
- terse mnemonics are usually the least of the issues with writing assembler
- (although they're certainly of source of negative clarity for the
- inexperienced).
- Many uses wouldn't care about wordier mnemonics. Things that generate
- assembler, like compiler back ends, for example.
- So the question are the few of us still writing assembler enough of an
- audience to care about? On the flip side, are the dilettantes** enough
- reason to change? Although the way these things usually end up, we're more
- likely to end up with both sets of mnemonics (or whatever we call the
- wordier versions) in programs...
- *Since the vast majority of programmers don't write any, that's actually
- not much of a claim...
- **And I don't mean that *too* derogatorily ;-)
- By: -.- ([email protected]), March 11, 2022 9:22 pm
- Room: [25]Moderated Discussions
- rwessel ([email protected]) on March 11, 2022 9:38 am wrote:
- > It's a tradeoff. I write rather more assembler than the vast majority of
- programmers*, but I'm
- > going to be annoyed if you turn assembler into Cobol - especially since
- assembler tends to be pretty
- > bulky to begin with. The terse mnemonics are usually the least of the
- issues with writing assembler
- I like to believe that programmers aren't writing any serious code in
- Windows Notepad, or that data entry is the bottleneck of programming.
- Many code editors these days support (possibly adaptive) auto-complete, so
- I'd expect a good assembly coding tool to have something similar (along
- with operand hints, inline syntax checking etc). I'd imagine that longer
- instructions shouldn't matter too much if they can just be auto-completed
- for you, though admittedly, there may be some overall downside to those
- who code a lot of assembly.
- By: dmcq ([email protected]), March 12, 2022 1:58 am
- Room: [25]Moderated Discussions
- -.- ([email protected]) on March 11, 2022 8:22 pm wrote:
- > rwessel ([email protected]) on March 11, 2022 9:38 am wrote:
- > > It's a tradeoff. I write rather more assembler than the vast majority
- of programmers*, but I'm
- > > going to be annoyed if you turn assembler into Cobol - especially
- since assembler tends to be pretty
- > > bulky to begin with. The terse mnemonics are usually the least of the
- issues with writing assembler
- >
- > I like to believe that programmers aren't writing any serious code in
- > Windows Notepad, or that data entry is the bottleneck of programming.
- >
- > Many code editors these days support (possibly adaptive) auto-complete,
- so I'd expect a good assembly
- > coding tool to have something similar (along with operand hints, inline
- syntax checking etc). I'd
- > imagine that longer instructions shouldn't matter too much if they can
- just be auto-completed for
- > you, though admittedly, there may be some overall downside to those who
- code a lot of assembly.
- A big problem with longer names would be that the operands would be either
- poitioned higgeldy piggeldy to the right or if space is always allowed for
- he biggest instruction most would have the operands far away.
- By: dmcq ([email protected]), March 12, 2022 1:42 pm
- Room: [25]Moderated Discussions
- dmcq ([email protected]) on March 12, 2022 12:58 am wrote:
- > -.- ([email protected]) on March 11, 2022 8:22 pm wrote:
- > > rwessel ([email protected]) on March 11, 2022 9:38 am
- wrote:
- > > > It's a tradeoff. I write rather more assembler than the vast
- majority of programmers*, but I'm
- > > > going to be annoyed if you turn assembler into Cobol - especially
- since assembler tends to be pretty
- > > > bulky to begin with. The terse mnemonics are usually the least of
- the issues with writing assembler
- > >
- > > I like to believe that programmers aren't writing any serious code in
- > > Windows Notepad, or that data entry is the bottleneck of programming.
- > >
- > > Many code editors these days support (possibly adaptive)
- auto-complete, so I'd expect a good assembly
- > > coding tool to have something similar (along with operand hints,
- inline syntax checking etc). I'd
- > > imagine that longer instructions shouldn't matter too much if they can
- just be auto-completed for
- > > you, though admittedly, there may be some overall downside to those
- who code a lot of assembly.
- >
- > A big problem with longer names would be that the operands would be
- either poitioned higgeldy piggeldy to
- > the right or if space is always allowed for he biggest instruction most
- would have the operands far away.
- This is related to tht assembler programming tends to be sort of two
- dimensional. One wants to looks at a numbe rof previous and following
- instructions and operands rather than having a unique state one should be
- at like in a C pprogram when one writes some eexpression.
- By: -.- ([email protected]), March 12, 2022 9:28 pm
- Room: [25]Moderated Discussions
- dmcq ([email protected]) on March 12, 2022 12:58 am wrote:
- > A big problem with longer names would be that the operands would be
- either poitioned higgeldy piggeldy to
- > the right or if space is always allowed for he biggest instruction most
- would have the operands far away.
- For your first assertion, many ISAs already have variable length
- instruction names, so you either accept "higgeldy piggeldy" or your line
- up the operands with spaces.
- As for your second, "big problem" and "far away" are subjective.
- Regardless, I think there's a number of solutions that could be adopted,
- e.g.:
- - add enough space for most instructions to be aligned, and let that rare
- extra-long instruction be unaligned
- - the above, but put operands on an indented new line instead of being
- unaligned
- - right-align the instruction name, instead of left alignment (your editor
- could help position things here, instead of trying to manually figure out
- the correct spacing each time)
- Allowing for longer names doesn't mean names should try and fit an entire
- paragraph in them - it's just about being a little less cryptic about what
- the instruction does.
- By: dmcq ([email protected]), March 13, 2022 12:46 pm
- Room: [25]Moderated Discussions
- -.- ([email protected]) on March 12, 2022 9:28 pm wrote:
- > dmcq ([email protected]) on March 12, 2022 12:58 am wrote:
- > > A big problem with longer names would be that the operands would be
- either poitioned higgeldy piggeldy to
- > > the right or if space is always allowed for he biggest instruction
- most would have the operands far away.
- >
- > For your first assertion, many ISAs already have variable length
- instruction names,
- > so you either accept "higgeldy piggeldy" or your line up the operands
- with spaces.
- >
- > As for your second, "big problem" and "far away" are subjective.
- Regardless,
- > I think there's a number of solutions that could be adopted, e.g.:
- >
- > - add enough space for most instructions to be aligned,
- > and let that rare extra-long instruction be unaligned
- > - the above, but put operands on an indented new line instead of being
- unaligned
- > - right-align the instruction name, instead of left alignment (your
- editor could help position
- > things here, instead of trying to manually figure out the correct
- spacing each time)
- >
- > Allowing for longer names doesn't mean names should try and fit an
- entire paragraph in
- > them - it's just about being a little less cryptic about what the
- instruction does.
- Her is a little ARM instruction sequence for example
- movs mm, mm
- umullne tmp, mm, n, mm
- subne n, n, mm
- addne n, mm, n, lsr #1
- mov n, n, lsr sh
- with words in and aligning except for the longest
- move.s mm, mm
- unsigned_multiply_long.ne tmp, mm, n, mm
- subtract.ne n, n, mm
- add.ne n, mm, n, lsr #1
- move n, n, lsr sh
- this breaks the 2d nature where oe wishes to look at uses of the registrs
- in nearby instructions and might want to rename them or move instructions
- around. This also puts in a larger space between the common instructions
- and thir operands.
- putting onto a new line
- move.s mm, mm
- unsigned_multiply_long.ne
- tmp, mm, n, mm
- subtract.ne n, n, mm
- add.ne n, mm, n, lsr #1
- move n, n, lsr sh
- this breaks up the registers with the ends of long instructions and moves
- the operands further apart
- right aligning the instruction
- move.s mm, mm
- unsigned_multiply_long.ne tmp, mm, n, mm
- subtract.ne n, n, mm
- add.ne n, mm, n, lsr #1
- move n, n, lsr sh
- at least the operands are kept well organized but the operations re mad
- more difficult to scan down.
- Perhaps I could get used to one of these but who figures out exactly how
- much toinclude in the names? Would it be okay to say sub instead of
- subtract? For instand umull doesn't actually multiply two longs - it
- multiplies two 32 bit registers n and mm above treated as unsigned into
- two registers, the low part which is temp above and the high part in mm.
- SO perhaps multply_unsigned_extending_to_long might be a better name even
- if longer. Though anyone who'd been working on this would be fed up of
- that long name after a while as assembler can take a while to get just
- right.
- By: dmcq ([email protected]), March 13, 2022 12:47 pm
- Room: [25]Moderated Discussions
- dmcq ([email protected]) on March 13, 2022 12:46 pm wrote:
- > -.- ([email protected]) on March 12, 2022 9:28 pm wrote:
- > > dmcq ([email protected]) on March 12, 2022 12:58 am wrote:
- > > > A big problem with longer names would be that the operands would be
- either poitioned higgeldy piggeldy to
- > > > the right or if space is always allowed for he biggest instruction
- most would have the operands far away.
- > >
- > > For your first assertion, many ISAs already have variable length
- instruction names,
- > > so you either accept "higgeldy piggeldy" or your line up the operands
- with spaces.
- > >
- > > As for your second, "big problem" and "far away" are subjective.
- Regardless,
- > > I think there's a number of solutions that could be adopted, e.g.:
- > >
- > > - add enough space for most instructions to be aligned,
- > > and let that rare extra-long instruction be unaligned
- > > - the above, but put operands on an indented new line instead of being
- unaligned
- > > - right-align the instruction name, instead of left alignment (your
- editor could help position
- > > things here, instead of trying to manually figure out the correct
- spacing each time)
- > >
- > > Allowing for longer names doesn't mean names should try and fit an
- entire paragraph in
- > > them - it's just about being a little less cryptic about what the
- instruction does.
- >
- > Her is a little ARM instruction sequence for example
- > movs mm, mm
- > umullne tmp, mm, n, mm
- > subne n, n, mm
- > addne n, mm, n, lsr #1
- > mov n, n, lsr sh
- >
- > with words in and aligning except for the longest
- > move.s mm, mm
- > unsigned_multiply_long.ne tmp, mm, n, mm
- > subtract.ne n, n, mm
- > add.ne n, mm, n, lsr #1
- > move n, n, lsr sh
- > this breaks the 2d nature where oe wishes to look at uses of the
- registrs in nearby
- > instructions and might want to rename them or move instructions around.
- This also
- > puts in a larger space between the common instructions and thir
- operands.
- >
- > putting onto a new line
- > move.s mm, mm
- > unsigned_multiply_long.ne
- > tmp, mm, n, mm
- > subtract.ne n, n, mm
- > add.ne n, mm, n, lsr #1
- > move n, n, lsr sh
- > this breaks up the registers with the ends of long instructions and
- moves the operands further apart
- >
- > right aligning the instruction
- > move.s mm, mm
- > unsigned_multiply_long.ne tmp, mm, n, mm
- > subtract.ne n, n, mm
- > add.ne n, mm, n, lsr #1
- > move n, n, lsr sh
- > at least the operands are kept well organized but the operations re mad
- more difficult to scan down.
- >
- > Perhaps I could get used to one of these but who figures out exactly how
- much toinclude in the names?
- > Would it be okay to say sub instead of subtract? For instand umull
- doesn't actually multiply two
- > longs - it multiplies two 32 bit registers n and mm above treated as
- unsigned into two registers,
- > the low part which is temp above and the high part in mm. SO perhaps
- multply_unsigned_extending_to_long
- > might be a better name even if longer. Though anyone who'd been working
- on this would be fed up
- > of that long name after a while as assembler can take a while to get
- just right.
- By the way microcode can have a number of instructions per line
- By: Anon ([email protected]), March 10, 2022 9:35 pm
- Room: [25]Moderated Discussions
- Jukka Larja ([email protected]) on March 10, 2022 7:55
- am wrote:
- > ADDPS is a perfect example of simple instruction name that I can't
- easily read, while addPackedSingle
- > (or ADDPACKEDSINGLE or ADD_PACKED_SINGLE or whatever you fancy) would be
- easy. After years of reading
- > assembly, I don't still don't really like it, because I constantly have
- to concentrate on stupid trivialities
- > like this. Having more letters in instruction names would be a huge
- benefit for readability.
- >
- > (I'm not trying to say everyone has this problem, or that majority has
- it,
- > or even that many people have it, but I do. I don't expect ever to learn
- > to read assembly fluently. I've had enough practice to know my limits.)
- >
- > -JLarja
- I don't know how often you read assembly or how long is the code you read,
- but come on, imagine a piece of code with 100 instructions, all of them
- followed by a prefix, having all of them were followed by _PACKED_SINGLE
- is far more annoying than a simple PS, even if it is a prefix you don't
- know you only have to look up once for that 100 instructions sequence.
- By: Jukka Larja ([email protected]), March 11, 2022
- 11:55 pm
- Room: [25]Moderated Discussions
- Anon ([email protected]) on March 10, 2022 8:35 pm wrote:
- > Jukka Larja ([email protected]) on March 10, 2022 7:55
- am wrote:
- > > ADDPS is a perfect example of simple instruction name that I can't
- easily read, while addPackedSingle
- > > (or ADDPACKEDSINGLE or ADD_PACKED_SINGLE or whatever you fancy) would
- be easy. After years of reading
- > > assembly, I don't still don't really like it, because I
- > > constantly have to concentrate on stupid trivialities
- > > like this. Having more letters in instruction names would be a huge
- benefit for readability.
- > >
- > > (I'm not trying to say everyone has this problem, or that majority has
- it,
- > > or even that many people have it, but I do. I don't expect ever to
- learn
- > > to read assembly fluently. I've had enough practice to know my
- limits.)
- > >
- > > -JLarja
- >
- > I don't know how often you read assembly or how long is the code you
- read, but come on, imagine
- > a piece of code with 100 instructions, all of them followed by a prefix,
- having all of them
- > were followed by _PACKED_SINGLE is far more annoying than a simple PS,
- even if it is a prefix
- > you don't know you only have to look up once for that 100 instructions
- sequence.
- It's not about knowing what PS means (that's a separate problem, one which
- good editor or relatively simple PDF file can solve). It's about me not
- seeing if it's PS or SS written on screen. Overly short words are simply
- hard to read. Same goes for short variable and function names. No one
- suggest that variable or function names should be limited to 3-6
- characters, because that would be insane. Why is it sane to limit
- assembler mnemonics?
- -JLarja
- By: anonymou5 ([email protected]), March 12, 2022 2:43 am
- Room: [25]Moderated Discussions
- Jukka Larja ([email protected]) on March 11, 2022 10:55
- pm wrote:
- > It's not about knowing what PS means (that's a separate problem, one
- which good editor or
- > relatively simple PDF file can solve). It's about me not seeing if it's
- PS or SS written
- > on screen. Overly short words are simply hard to read. Same goes for
- short variable and
- > function names. No one suggest that variable or function names should be
- limited to 3-6
- > characters, because that would be insane. Why is it sane to limit
- assembler mnemonics?
- uhm... still not seeing you over in the RISC-V universe
- but hey... keep whining down the /dev/null device here
- By: Jukka Larja ([email protected]), March 13, 2022 1:25
- am
- Room: [25]Moderated Discussions
- anonymou5 ([email protected]) on March 12, 2022 1:43 am wrote:
- > Jukka Larja ([email protected]) on March 11, 2022
- 10:55 pm wrote:
- > > It's not about knowing what PS means (that's a separate problem, one
- which good editor or
- > > relatively simple PDF file can solve). It's about me not seeing if
- it's PS or SS written
- > > on screen. Overly short words are simply hard to read. Same goes for
- short variable and
- > > function names. No one suggest that variable or function names should
- be limited to 3-6
- > > characters, because that would be insane. Why is it sane to limit
- assembler mnemonics?
- >
- > uhm... still not seeing you over in the RISC-V universe
- >
- > but hey... keep whining down the /dev/null device here
- What? I have no association with RISC V. If I was to make a drive-by
- complaint there about anything, I would likely just annoy people there
- trying to get something useful done. At worst someone would do exactly the
- opposite than what that idiot n00b blathered about.
- I was commenting in general about assembler tradition that I find
- unsuitable for modern world (as far as I'm aware, the problem is
- universal, but I only see x64 and ARM64 these days and have passing
- familiarity with MIPS and PowerPC).
- -JLarja
- By: -.- ([email protected]), March 10, 2022 8:47 pm
- Room: [25]Moderated Discussions
- Anon ([email protected]) on March 9, 2022 6:33 pm wrote:
- > Yeah, but most instructions are just variations and ISAs usually have a
- standard way to describe
- > the variations, even when the ISA is a mess like x86, ADDPS, the "P"
- means packed, for more
- > or less a thousand instructions, the last "S" means single, I see no
- point in writing the
- > full meaning of those suffixes, the start of the instruction, which
- contains the actual instrcution
- > name, usually get a good share of letters to describe it, like INSERTPS.
- I think 'add' is quite well established, so more descriptive opcodes
- wouldn't really help much here - it's more beneficial for less obvious
- instructions.
- Even so, I doubt 'ADD_PS' would've been that much of an ask, to separate
- the operation from the type, or better still, 'ADD_PF32' or 'ADD_P_F32'
- (since they use 'packed' instead of 'vector' mnemonic). Being more
- consistent (what you refer to as the 'standard way') could also help (e.g.
- don't switch between ordering/formatting like ADDPS for float32, but PADDD
- for int32).
- Expanding the name doesn't mean contractions aren't allowed, it's just
- that a lot of instructions are almost deliberately named to appear
- cryptic.
- As for your other example, INSERTPS isn't too bad, whilst the integer
- equivalent, PINSRD, is what I'd say falls into the 'less obvious'
- category.
- By: Anon ([email protected]), March 10, 2022 9:40 pm
- Room: [25]Moderated Discussions
- -.- ([email protected]) on March 10, 2022 7:47 pm wrote:
- > I think 'add' is quite well established, so more descriptive opcodes
- wouldn't
- > really help much here - it's more beneficial for less obvious
- instructions.
- > Even so, I doubt 'ADD_PS' would've been that much of an ask, to separate
- the operation from the
- > type, or better still, 'ADD_PF32' or 'ADD_P_F32' (since they use
- 'packed' instead of 'vector'
- > mnemonic). Being more consistent (what you refer to as the 'standard
- way') could also help (e.g.
- > don't switch between ordering/formatting like ADDPS for float32, but
- PADDD for int32).
- I agree, others use a dot as separator.
- > As for your other example, INSERTPS isn't too bad, whilst the integer
- equivalent,
- > PINSRD, is what I'd say falls into the 'less obvious' category.
- I agree, MMX was the first SIMD extension, I think Intel only realized the
- dumb naming convention after it.
- By: gallier2 ([email protected]), March 11, 2022 12:34 am
- Room: [25]Moderated Discussions
- -.- ([email protected]) on March 10, 2022 7:47 pm wrote:
- > Anon ([email protected]) on March 9, 2022 6:33 pm wrote:
- > > Yeah, but most instructions are just variations and ISAs usually have
- a standard way to describe
- > > the variations, even when the ISA is a mess like x86, ADDPS, the "P"
- means packed, for more
- > > or less a thousand instructions, the last "S" means single, I see no
- point in writing the
- > > full meaning of those suffixes, the start of the instruction, which
- contains the actual instrcution
- > > name, usually get a good share of letters to describe it, like
- INSERTPS.
- >
- > I think 'add' is quite well established, so more descriptive opcodes
- wouldn't
- A on the TMS-9900 :-)
- > really help much here - it's more beneficial for less obvious
- instructions.
- > Even so, I doubt 'ADD_PS' would've been that much of an ask, to separate
- the operation from the
- > type, or better still, 'ADD_PF32' or 'ADD_P_F32' (since they use
- 'packed' instead of 'vector'
- > mnemonic). Being more consistent (what you refer to as the 'standard
- way') could also help (e.g.
- > don't switch between ordering/formatting like ADDPS for float32, but
- PADDD for int32).
- >
- > Expanding the name doesn't mean contractions aren't allowed, it's just
- that
- > a lot of instructions are almost deliberately named to appear cryptic.
- >
- > As for your other example, INSERTPS isn't too bad, whilst the integer
- equivalent,
- > PINSRD, is what I'd say falls into the 'less obvious' category.
- By: Tim ([email protected]), March 11, 2022 11:56 am
- Room: [25]Moderated Discussions
- I always wanted my assembly (and I have written a fair amount, although
- not much lately) to be
- closer to a high level language. Instead of
- ADD R1,R2
- Which could be "add r1 to r2", or "add R2 to R1" depending on the
- assembler, just write:
- R1 += R2
- For a load:
- R1 = [R1+offset]
- and so on.
- For the more complex things (add packed single), a simple algebraic
- statement is not going
- to work, so make it a function call like syntax:
- R1 = add_packed_single(R1, R2)
- Of course there are limitations on what is semantically allowed, but if
- somebody wants to write:
- R3 = add_packed_single(R1, R2)
- The assembler *could* be smart enough to move R1 to R3 first, then do the
- add.
- The result is something that is still as efficient and low level as
- assembler (still pretty
- much one instruction per statement), but readable by programmers that are
- familiar with C like
- languages.
- By: Anon ([email protected]), March 11, 2022 12:25 pm
- Room: [25]Moderated Discussions
- Tim ([email protected]) on March 11, 2022 10:56 am wrote:
- > I always wanted my assembly (and I have written a fair amount, although
- not much lately) to be
- > closer to a high level language. Instead of
- >
- > ADD R1,R2
- >
- > Which could be "add r1 to r2", or "add R2 to R1" depending on the
- assembler, just write:
- >
- > R1 += R2
- >
- > For a load:
- >
- > R1 = [R1+offset]
- >
- > and so on.
- >
- > For the more complex things (add packed single), a simple algebraic
- statement is not going
- > to work, so make it a function call like syntax:
- >
- > R1 = add_packed_single(R1, R2)
- >
- > Of course there are limitations on what is semantically allowed, but if
- somebody wants to write:
- >
- > R3 = add_packed_single(R1, R2)
- >
- > The assembler *could* be smart enough to move R1 to R3 first, then do
- the add.
- >
- > The result is something that is still as efficient and low level as
- assembler (still pretty
- > much one instruction per statement), but readable by programmers that
- are familiar with C like
- > languages.
- You are not the first to thing about it.
- IBM have HLAsm, there was a hobby HLA for x86 but, as far as I know, isn't
- supported anymore, Microsoft have Macro Assembler which is quite powerful,
- I have seem people write macros that expand things like R1 = R2 * R3 + R4
- * R5 - R6 into assembly instructions, and macros that help OOP, but no
- macro library is much used.
- The problem is that nobody uses assembly to do things that compilers do so
- well, so expanding a math expression may looks cool but is not that
- usefull, assembly usually is used when there is a need for many
- instructions that the compiler can't emit, and often when intrinsics
- aren't an option, in those cases macro libraries add complexity without
- giving much help in the solution.
- By: Joern Engel ([email protected]), March 11, 2022 1:04
- pm
- Room: [25]Moderated Discussions
- Anon ([email protected]) on March 11, 2022 11:25 am wrote:
- >
- > The problem is that nobody uses assembly to do things that compilers do
- so well, so expanding a
- > math expression may looks cool but is not that usefull, assembly usually
- is used when there is
- > a need for many instructions that the compiler can't emit, and often
- when intrinsics aren't an
- > option, in those cases macro libraries add complexity without giving
- much help in the solution.
- And in my experience, when you need close to all available registers and
- compilers generate a pig's breakfast. On x86 that happens fairly often if
- you need 8 accumulators for some compute kernel, plus some pointers, loop
- counters, etc. Usually that still fits in the available 16 registers. But
- compilers tend to need more registers than humans would and start spilling
- onto the stack. And then they make bad decisions and spill hot variables
- while keeping cold variables in registers. In a recent example,
- compiler-generated code was 60% larger and 60% slower than necessary.
- It is fairly rare that a) this happens and b) it matters enough to replace
- the compiler-generated code with hand-written assembly. But it does come
- up from time to time.
- By: Mark Roulo ([email protected]), March 11, 2022 12:26 pm
- Room: [25]Moderated Discussions
- Tim ([email protected]) on March 11, 2022 10:56 am wrote:
- > I always wanted my assembly (and I have written a fair amount, although
- not much lately) to be
- > closer to a high level language. Instead of
- >
- > ADD R1,R2
- >
- > Which could be "add r1 to r2", or "add R2 to R1" depending on the
- assembler, just write:
- >
- > R1 += R2
- >
- > For a load:
- >
- > R1 = [R1+offset]
- >
- > and so on.
- >
- > For the more complex things (add packed single), a simple algebraic
- statement is not going
- > to work, so make it a function call like syntax:
- >
- > R1 = add_packed_single(R1, R2)
- >
- > Of course there are limitations on what is semantically allowed, but if
- somebody wants to write:
- >
- > R3 = add_packed_single(R1, R2)
- >
- > The assembler *could* be smart enough to move R1 to R3 first, then do
- the add.
- >
- > The result is something that is still as efficient and low level as
- assembler (still pretty
- > much one instruction per statement), but readable by programmers that
- are familiar with C like
- > languages.
- Me, too!
- But I read assembly (and rarely at that) but I don't *write* it.
- Maybe there are good reasons that we don't get this (other than
- "historically, we haven't done this")? The obvious problem might be that
- many instructions don't have good mappings to higher level constructs. As
- an example, the x86 test instruction seems to:
- *) do a bitwise and (not a problem), and
- *) set the ZF flag resister to the result (0 or 1)
- *) set the SF flag resister to the value of the sign bit (0 or 1)
- *) set the PF flag register to the parity of the result
- *) clear the CF flag register
- So we can't do: r1 = r2 and r3
- I expect that ARM instructions aren't as annoying as this, but maybe there
- are enough of these sorts of cases that the simplification you (and I)
- want doesn't really help very much?
- By: David Hess ([email protected]), March 12, 2022 11:39 am
- Room: [25]Moderated Discussions
- Mark Roulo ([email protected]) on March 11, 2022 11:26 am
- wrote:
- > Tim ([email protected]) on March 11, 2022 10:56 am wrote:
- > > I always wanted my assembly (and I have written a fair amount,
- although not much lately) to be
- > > closer to a high level language. Instead of
- > >
- > > ADD R1,R2
- > >
- > > Which could be "add r1 to r2", or "add R2 to R1" depending on the
- assembler, just write:
- > >
- > > R1 += R2
- > >
- > > For a load:
- > >
- > > R1 = [R1+offset]
- > >
- > > and so on.
- > >
- > > For the more complex things (add packed single), a simple algebraic
- statement is not going
- > > to work, so make it a function call like syntax:
- > >
- > > R1 = add_packed_single(R1, R2)
- > >
- > > Of course there are limitations on what is semantically allowed, but
- if somebody wants to write:
- > >
- > > R3 = add_packed_single(R1, R2)
- > >
- > > The assembler *could* be smart enough to move R1 to R3 first, then do
- the add.
- > >
- > > The result is something that is still as efficient and low level as
- assembler (still pretty
- > > much one instruction per statement), but readable by programmers that
- are familiar with C like
- > > languages.
- >
- > Me, too!
- >
- > But I read assembly (and rarely at that) but I don't *write* it.
- >
- > Maybe there are good reasons that we don't get this (other than
- "historically, we haven't
- > done this")? The obvious problem might be that many instructions don't
- have good mappings
- > to higher level constructs. As an example, the x86 test instruction
- seems to:
- > *) do a bitwise and (not a problem), and
- > *) set the ZF flag resister to the result (0 or 1)
- > *) set the SF flag resister to the value of the sign bit (0 or 1)
- > *) set the PF flag register to the parity of the result
- > *) clear the CF flag register
- >
- > So we can't do: r1 = r2 and r3
- >
- > I expect that ARM instructions aren't as annoying as this, but maybe
- there are enough of these
- > sorts of cases that the simplification you (and I) want doesn't really
- help very much?
- Even ADD usually has a variation which includes carry, and assuming the
- ADD width from the operands is not always unambiguous. Even x86 assembly
- required an extra notation to handle that, while 8080 did not. I do not
- remember now how Z80 handled it; Z80 used different mnemonics than 8080
- and must have determined context like x86.
- Macro assemblers solved these problems long ago but perhaps not in the way
- modern programmers are used to. From my perspective of an assembly
- programmer, I could list similar problems with C notation, and in the past
- some non-standard specialized C compilers addressed issues like this.
- By: Adrian ([email protected]), March 12, 2022 12:01 pm
- Room: [25]Moderated Discussions
- David Hess ([email protected]) on March 12, 2022 10:39 am
- wrote:
- >
- > Even ADD usually has a variation which includes carry, and assuming the
- ADD width from
- > the operands is not always unambiguous. Even x86 assembly required an
- extra notation
- > to handle that, while 8080 did not. I do not remember now how Z80
- handled it; Z80
- > used different mnemonics than 8080 and must have determined context like
- x86.
- >
- > Macro assemblers solved these problems long ago but perhaps not in the
- way modern programmers are
- > used to. From my perspective of an assembly programmer, I could list
- similar problems with C notation,
- > and in the past some non-standard specialized C compilers addressed
- issues like this.
- >
- In an assembly language that does not use the traditional assembly
- instruction format, but it uses expressions, like e.g. in C, you need more
- operators, to cover all the operations that are possible between operands
- of a given type.
- Those operators may use keywords, like the mnemonics of a traditional
- language, e.g. ADD and ADC, or, in a programming language that accepts
- Unicode source files, like any modern programming language should, in my
- opinion, then there are plenty of symbols available for operators, e.g.
- one could use "+" for ADD and "+" in a circle for ADC.
- Actually such a notation is not new, it was used in the documentation of
- various CPUs, in the past.
- By: Mark Roulo ([email protected]), March 12, 2022 7:12 pm
- Room: [25]Moderated Discussions
- Adrian ([email protected]) on March 12, 2022 11:01 am wrote:
- > Those operators may use keywords, like the mnemonics of a traditional
- language, e.g.
- > ADD and ADC, or, in a programming language that accepts Unicode source
- files, like any
- > modern programming language should, in my opinion, then
- there are plenty of symbols available
- > for operators, e.g. one could use "+" for ADD and "+" in a circle for
- ADC.
- >
- > Actually such a notation is not new, it was used in the documentation
- of various CPUs, in the past.
- >
- If APL and assembly language had a baby ...
- By: Adrian ([email protected]), March 13, 2022 1:38 am
- Room: [25]Moderated Discussions
- Mark Roulo ([email protected]) on March 12, 2022 6:12 pm wrote:
- > Adrian ([email protected]) on March 12, 2022 11:01 am wrote:
- > > Those operators may use keywords, like the mnemonics of a traditional
- language, e.g.
- > > ADD and ADC, or, in a programming language that accepts Unicode source
- files, like any
- > > modern programming language should, in my opinion, then
- there are plenty of symbols available
- > > for operators, e.g. one could use "+" for ADD and "+" in a circle
- for ADC.
- > >
- > > Actually such a notation is not new, it was used in the
- documentation of various CPUs, in the past.
- > >
- >
- > If APL and assembly language had a baby ...
- >
- >
- I assume that you allude to "A formal description of SYSTEM/360",
- created at IBM in 1964 by Falkoff, Iverson & Sussenguth, which can be
- considered as such a baby (even if it predates both the first computer
- implementation of APL, APL360, and the coining of the acronym APL for
- the Iverson notation).
- By: Mark Roulo ([email protected]), March 13, 2022 8:53 am
- Room: [25]Moderated Discussions
- Adrian ([email protected]) on March 13, 2022 1:38 am wrote:
- > Mark Roulo ([email protected]) on March 12, 2022 6:12 pm
- wrote:
- > > Adrian ([email protected]) on March 12, 2022 11:01 am wrote:
- > > > Those operators may use keywords, like the mnemonics of a
- traditional language, e.g.
- > > > ADD and ADC, or, in a programming language that accepts Unicode
- source files, like any
- > > > modern programming language should, in my opinion, then
- there are plenty of symbols available
- > > > for operators, e.g. one could use "+" for ADD and "+" in a circle
- for ADC.
- > > >
- > > > Actually such a notation is not new, it was used in the
- documentation of various CPUs, in the past.
- > > >
- > >
- > > If APL and assembly language had a baby ...
- > >
- > >
- >
- >
- > I assume that you allude to "A formal description of SYSTEM/360",
- created at IBM in 1964 by Falkoff,
- > Iverson & Sussenguth, which can be considered as such a baby (even if
- it predates both the first computer
- > implementation of APL, APL360, and the coining of the acronym APL for
- the Iverson notation).
- >
- I was referring to how I would view things if (an) assembly language
- began to use Unicode extensively (for example a '+' inside a circle
- to indicate add-with-carry).
- By: Adrian ([email protected]), March 13, 2022 10:57 am
- Room: [25]Moderated Discussions
- Mark Roulo ([email protected]) on March 13, 2022 8:53 am wrote:
- > Adrian ([email protected]) on March 13, 2022 1:38 am wrote:
- > > Mark Roulo ([email protected]) on March 12, 2022 6:12 pm
- wrote:
- > > > Adrian ([email protected]) on March 12, 2022 11:01 am wrote:
- > > > > Those operators may use keywords, like the mnemonics of a
- traditional language, e.g.
- > > > > ADD and ADC, or, in a programming language that accepts Unicode
- source files, like any
- > > > > modern programming language should, in my opinion, then
- there are plenty of symbols available
- > > > > for operators, e.g. one could use "+" for ADD and "+" in a
- circle for ADC.
- > > > >
- > > > > Actually such a notation is not new, it was used in the
- documentation of various CPUs, in the past.
- > > > >
- > > >
- > > > If APL and assembly language had a baby ...
- > > >
- > > >
- > >
- > >
- > > I assume that you allude to "A formal description of SYSTEM/360",
- created at IBM in 1964 by Falkoff,
- > > Iverson & Sussenguth, which can be considered as such a baby (even
- if it predates both the first computer
- > > implementation of APL, APL360, and the coining of the acronym APL
- for the Iverson notation).
- > >
- >
- > I was referring to how I would view things if (an) assembly language
- > began to use Unicode extensively (for example a '+' inside a circle
- > to indicate add-with-carry).
- >
- >
- Even if Unicode did not exist in 1964, this exactly what that formal
- description of IBM System/360 was.
- It was a method to write any IBM System/360 program, which used an
- APL-based language, which was written with a large number of different
- symbolic operators that had an unambiguous meaning.
- In order to be able to describe in detail the semantics of the
- System/360 ISA and the behavior of its peripherals, the APL operators
- were used for a lower level than the assembly language. They
- corresponded with the microinstructions of an ideal machine, which would
- interpret the System/360 instructions.
- Nevertheless, it would have been trivial to extend that APL notation to
- write directly any assembly language program, instead of the equivalent
- microprogram.
- However, IBM has always been extremely reluctant to provide on its
- products character sets with enough characters. Therefore an assembly
- language notation with a large number of symbols was OK in a research
- project, but it would have never been approved for a commercial product.
- By: rwessel ([email protected]), March 13, 2022 11:23 am
- Room: [25]Moderated Discussions
- Adrian ([email protected]) on March 13, 2022 10:57 am wrote:
- > Mark Roulo ([email protected]) on March 13, 2022 8:53 am
- wrote:
- > > Adrian ([email protected]) on March 13, 2022 1:38 am wrote:
- > > > Mark Roulo ([email protected]) on March 12, 2022 6:12 pm
- wrote:
- > > > > Adrian ([email protected]) on March 12, 2022 11:01 am wrote:
- > > > > > Those operators may use keywords, like the mnemonics of a
- traditional language, e.g.
- > > > > > ADD and ADC, or, in a programming language that accepts Unicode
- source files, like any
- > > > > > modern programming language should, in my opinion, then
- there are plenty of symbols available
- > > > > > for operators, e.g. one could use "+" for ADD and "+" in a
- circle for ADC.
- > > > > >
- > > > > > Actually such a notation is not new, it was used in the
- documentation of various CPUs, in the past.
- > > > > >
- > > > >
- > > > > If APL and assembly language had a baby ...
- > > > >
- > > > >
- > > >
- > > >
- > > > I assume that you allude to "A formal description of SYSTEM/360",
- created at IBM in 1964 by Falkoff,
- > > > Iverson & Sussenguth, which can be considered as such a baby (even
- if it predates both the first computer
- > > > implementation of APL, APL360, and the coining of the acronym APL
- for the Iverson notation).
- > > >
- > >
- > > I was referring to how I would view things if (an) assembly language
- > > began to use Unicode extensively (for example a '+' inside a circle
- > > to indicate add-with-carry).
- > >
- > >
- >
- >
- > Even if Unicode did not exist in 1964, this exactly what that formal
- description of IBM System/360 was.
- >
- > It was a method to write any IBM System/360 program, which used an
- APL-based language, which was
- > written with a large number of different symbolic operators that had
- an unambiguous meaning.
- >
- > In order to be able to describe in detail the semantics of the
- System/360 ISA and the behavior of its
- > peripherals, the APL operators were used for a lower level than the
- assembly language. They corresponded
- > with the microinstructions of an ideal machine, which would interpret
- the System/360 instructions.
- >
- > Nevertheless, it would have been trivial to extend that APL notation
- to write directly
- > any assembly language program, instead of the equivalent microprogram.
- >
- > However, IBM has always been extremely reluctant to provide on its
- products character sets with
- > enough characters. Therefore an assembly language notation with a
- large number of symbols was
- > OK in a research project, but it would have never been approved for a
- commercial product.
- I'm not sure that's quite fair. At the time, expanded character sets
- tended to be costly - slower print trains, more costly character
- generators on early terminals, etc. And much programming took place on
- devices designed for "normal" data (eg. keypunches), and were limited to
- character sets provided by that hardware. Programming really being a
- secondary task - these expensive devices being intended for data
- progress. That was hardly unique to IBM, and many systems pre-360 used
- 6-bit characters most of the time. While IBM (unfortunately) ended up
- with EBCDIC for S/360, it's not like ASCII really moved the needle all
- that far, providing only 95 printable characters.
- IBM would have happily sold you a TN train* for your 1403 printer, and
- then you'd get not only lower case letters but a bunch of new
- punctuation marks, but than your 1403 will run at less than half speed.
- *120 different printable characters (plus space).
- By: Andrey ([email protected]), March 14, 2022 1:42 am
- Room: [25]Moderated Discussions
- Adrian ([email protected]) on March 13, 2022 10:57 am wrote:
- > Mark Roulo ([email protected]) on March 13, 2022 8:53 am
- wrote:
- > > Adrian ([email protected]) on March 13, 2022 1:38 am wrote:
- > > > Mark Roulo ([email protected]) on March 12, 2022 6:12 pm
- wrote:
- > > > > Adrian ([email protected]) on March 12, 2022 11:01 am wrote:
- > > > > > Those operators may use keywords, like the mnemonics of a
- traditional language, e.g.
- > > > > > ADD and ADC, or, in a programming language that accepts Unicode
- source files, like any
- > > > > > modern programming language should, in my opinion, then
- there are plenty of symbols available
- > > > > > for operators, e.g. one could use "+" for ADD and "+" in a
- circle for ADC.
- > > > > >
- > > > > > Actually such a notation is not new, it was used in the
- documentation of various CPUs, in the past.
- > > > > >
- > > > >
- > > > > If APL and assembly language had a baby ...
- > > > >
- > > > >
- > > >
- > > >
- > > > I assume that you allude to "A formal description of SYSTEM/360",
- created at IBM in 1964 by Falkoff,
- > > > Iverson & Sussenguth, which can be considered as such a baby (even
- if it predates both the first computer
- > > > implementation of APL, APL360, and the coining of the acronym APL
- for the Iverson notation).
- > > >
- > >
- > > I was referring to how I would view things if (an) assembly language
- > > began to use Unicode extensively (for example a '+' inside a circle
- > > to indicate add-with-carry).
- > >
- > >
- >
- >
- > Even if Unicode did not exist in 1964, this exactly what that formal
- description of IBM System/360 was.
- >
- > It was a method to write any IBM System/360 program, which used an
- APL-based language, which was
- > written with a large number of different symbolic operators that had
- an unambiguous meaning.
- >
- > In order to be able to describe in detail the semantics of the
- System/360 ISA and the behavior of its
- > peripherals, the APL operators were used for a lower level than the
- assembly language. They corresponded
- > with the microinstructions of an ideal machine, which would interpret
- the System/360 instructions.
- >
- > Nevertheless, it would have been trivial to extend that APL notation
- to write directly
- > any assembly language program, instead of the equivalent microprogram.
- >
- > However, IBM has always been extremely reluctant to provide on its
- products character sets with
- > enough characters. Therefore an assembly language notation with a
- large number of symbols was
- > OK in a research project, but it would have never been approved for a
- commercial product.
- Even today, inputting Unicode characters outside ASCII and possibly one
- national character set is a pain (and national characters typically
- require switching keyboard layout, so they are also a pain, just a bit
- less of a pain compared to opening some app to insert a special
- character or using a compose sequence, or switching keyboard to a third
- layer layout). Even ignoring the minimum bar for the system that is
- capable to support programming with Unicode operations (the system would
- have to support Unicode, there must be software or hardware support for
- inputting non-ASCII characters), the amount of effort to input these
- characters (on a conventional system with a PC keyboard) would be
- unacceptable.
- Then there is an issue of character discernability. This is not an issue
- with something like a plus in a circle, but there are plenty of
- different Unicode characters that look the same or alike. This is a huge
- source of ambiguity and code obfuscation, both benign and malicious.
- I strongly believe that programming languages should limit their code
- character sets to ASCII (that is, Unicode may be supported in comments
- and string literals, but not for operators, names, delimiters or
- non-string literals).
- By: Anon ([email protected]), March 14, 2022 1:57 am
- Room: [25]Moderated Discussions
- Andrey ([email protected]) on March 14, 2022 1:42 am
- wrote:
- > Even today, inputting Unicode characters outside ASCII and possibly one
- national character set is a pain
- > (and national characters typically require switching keyboard layout, so
- they are also a pain, just a
- > bit less of a pain compared to opening some app to insert a special
- character or using a compose sequence,
- > or switching keyboard to a third layer layout). Even ignoring the
- minimum bar for the system that is
- > capable to support programming with Unicode operations (the system would
- have to support Unicode, there
- > must be software or hardware support for inputting non-ASCII
- characters), the amount of effort to input
- > these characters (on a conventional system with a PC keyboard) would be
- unacceptable.
- >
- > Then there is an issue of character discernability. This is not an issue
- with something like
- > a plus in a circle, but there are plenty of different Unicode characters
- that look the same or
- > alike. This is a huge source of ambiguity and code obfuscation, both
- benign and malicious.
- >
- > I strongly believe that programming languages should limit their code
- character
- > sets to ASCII (that is, Unicode may be supported in comments and string
- literals,
- > but not for operators, names, delimiters or non-string literals).
- >
- I guess CJK writters already had and solved some of those problems, I am
- not sure APL (and anyone else thinking about including more unicode
- characters) programmers are a big enough group for someone to solve their
- problem too.
- By: Michael S ([email protected]), March 14, 2022 4:07
- am
- Room: [25]Moderated Discussions
- Anon ([email protected]) on March 14, 2022 1:57 am wrote:
- > Andrey ([email protected]) on March 14, 2022 1:42 am
- wrote:
- > > Even today, inputting Unicode characters outside ASCII and possibly
- one national character set is a pain
- > > (and national characters typically require switching keyboard layout,
- so they are also a pain, just a
- > > bit less of a pain compared to opening some app to insert a special
- character or using a compose sequence,
- > > or switching keyboard to a third layer layout). Even ignoring the
- minimum bar for the system that is
- > > capable to support programming with Unicode operations (the system
- would have to support Unicode, there
- > > must be software or hardware support for inputting non-ASCII
- characters), the amount of effort to input
- > > these characters (on a conventional system with a PC keyboard) would
- be unacceptable.
- > >
- > > Then there is an issue of character discernability. This is not an
- issue with something like
- > > a plus in a circle, but there are plenty of different Unicode
- characters that look the same or
- > > alike. This is a huge source of ambiguity and code obfuscation, both
- benign and malicious.
- > >
- > > I strongly believe that programming languages should limit their code
- character
- > > sets to ASCII (that is, Unicode may be supported in comments and
- string literals,
- > > but not for operators, names, delimiters or non-string literals).
- > >
- >
- > I guess CJK writters already had and solved some of those problems, I am
- not
- > sure APL (and anyone else thinking about including more unicode
- characters)
- > programmers are a big enough group for someone to solve their problem
- too.
- C - yes.
- But J (Hiragana) and K (Hangul) fall under "one national character set".
- May be, they are no the most prestigious forms of writing J and K, but I
- would think that they are most widely used on computers.
- BTW, at home I have a keyboard marked with three character sets. It's pain
- to use for one of them (hard to concentrate), but o.k. for the other two.
- The fact that I am closer to blind typing on the those other two sets
- certainly helps.
- By: Michael S ([email protected]), March 13, 2022 8:14
- am
- Room: [25]Moderated Discussions
- Adrian ([email protected]) on March 12, 2022 12:01 pm wrote:
- > David Hess ([email protected]) on March 12, 2022 10:39 am
- wrote:
- > >
- > > Even ADD usually has a variation which includes carry, and assuming
- the ADD width from
- > > the operands is not always unambiguous. Even x86 assembly required an
- extra notation
- > > to handle that, while 8080 did not. I do not remember now how Z80
- handled it; Z80
- > > used different mnemonics than 8080 and must have determined context
- like x86.
- > >
- > > Macro assemblers solved these problems long ago but perhaps not in the
- way modern programmers are
- > > used to. From my perspective of an assembly programmer, I could list
- similar problems with C notation,
- > > and in the past some non-standard specialized C compilers addressed
- issues like this.
- > >
- >
- >
- > In an assembly language that does not use the traditional assembly
- instruction
- > format, but it uses expressions, like e.g. in C, you need more
- operators, to cover
- > all the operations that are possible between operands of a given type.
- >
- > Those operators may use keywords, like the mnemonics of a traditional
- language, e.g.
- > ADD and ADC, or, in a programming language that accepts Unicode source
- files, like any
- > modern programming language should, in my opinion, then there are plenty
- of symbols available
- > for operators, e.g. one could use "+" for ADD and "+" in a circle for
- ADC.
- >
- > Actually such a notation is not new, it was used in the documentation of
- various CPUs, in the past.
- >
- What's wrong with "R1=R2+R3+CarryFlag" ?
- By: Michael S ([email protected]), March 13, 2022 8:27
- am
- Room: [25]Moderated Discussions
- Michael S ([email protected]) on March 13, 2022 8:14 am
- wrote:
- > Adrian ([email protected]) on March 12, 2022 12:01 pm wrote:
- > > David Hess ([email protected]) on March 12, 2022 10:39
- am wrote:
- > > >
- > > > Even ADD usually has a variation which includes carry, and assuming
- the ADD width from
- > > > the operands is not always unambiguous. Even x86 assembly required
- an extra notation
- > > > to handle that, while 8080 did not. I do not remember now how Z80
- handled it; Z80
- > > > used different mnemonics than 8080 and must have determined context
- like x86.
- > > >
- > > > Macro assemblers solved these problems long ago but perhaps not in
- the way modern programmers are
- > > > used to. From my perspective of an assembly programmer, I could list
- similar problems with C notation,
- > > > and in the past some non-standard specialized C compilers addressed
- issues like this.
- > > >
- > >
- > >
- > > In an assembly language that does not use the traditional assembly
- instruction
- > > format, but it uses expressions, like e.g. in C, you need more
- operators, to cover
- > > all the operations that are possible between operands of a given type.
- > >
- > > Those operators may use keywords, like the mnemonics of a traditional
- language, e.g.
- > > ADD and ADC, or, in a programming language that accepts Unicode source
- files, like any
- > > modern programming language should, in my opinion, then there are
- plenty of symbols available
- > > for operators, e.g. one could use "+" for ADD and "+" in a circle for
- ADC.
- > >
- > > Actually such a notation is not new, it was used in the documentation
- of various CPUs, in the past.
- > >
- >
- > What's wrong with "R1=R2+R3+CarryFlag" ?
- >
- BTW, that almost exactly the syntax of ADI SHARC and TigerSHARC asm.
- Except that they use CI instead of CarryFlag.
- By: Adrian ([email protected]), March 13, 2022 10:29 am
- Room: [25]Moderated Discussions
- Michael S ([email protected]) on March 13, 2022 8:14 am
- wrote:
- > Adrian ([email protected]) on March 12, 2022 12:01 pm wrote:
- > > David Hess ([email protected]) on March 12, 2022 10:39
- am wrote:
- > > >
- > > > Even ADD usually has a variation which includes carry, and assuming
- the ADD width from
- > > > the operands is not always unambiguous. Even x86 assembly required
- an extra notation
- > > > to handle that, while 8080 did not. I do not remember now how Z80
- handled it; Z80
- > > > used different mnemonics than 8080 and must have determined context
- like x86.
- > > >
- > > > Macro assemblers solved these problems long ago but perhaps not in
- the way modern programmers are
- > > > used to. From my perspective of an assembly programmer, I could list
- similar problems with C notation,
- > > > and in the past some non-standard specialized C compilers addressed
- issues like this.
- > > >
- > >
- > >
- > > In an assembly language that does not use the traditional assembly
- instruction
- > > format, but it uses expressions, like e.g. in C, you need more
- operators, to cover
- > > all the operations that are possible between operands of a given type.
- > >
- > > Those operators may use keywords, like the mnemonics of a traditional
- language, e.g.
- > > ADD and ADC, or, in a programming language that accepts Unicode source
- files, like any
- > > modern programming language should, in my opinion, then there are
- plenty of symbols available
- > > for operators, e.g. one could use "+" for ADD and "+" in a circle for
- ADC.
- > >
- > > Actually such a notation is not new, it was used in the documentation
- of various CPUs, in the past.
- > >
- >
- > What's wrong with "R1=R2+R3+CarryFlag" ?
- >
- There is nothing wrong with it.
- It is one alternative.
- In any case, someone who designs a new assembly language must make a
- choice, but then that choice should be used always, in a consistent way,
- i.e. either the number of operators/mnemonics for the relevant operations
- should be doubled, or an explicit carry operand should be written, to be
- able to distinguish operations like ADD vs. ADC or ROL vs. RCL.
- By: David Hess ([email protected]), March 13, 2022 2:54 pm
- Room: [25]Moderated Discussions
- Michael S ([email protected]) on March 13, 2022 8:14 am
- wrote:
- >
- > What's wrong with "R1=R2+R3+CarryFlag" ?
- I have occasionally seen that, but I do not remember if any of the
- specialized C compilers used it.
- By: Michael S ([email protected]), March 13, 2022 3:09
- pm
- Room: [25]Moderated Discussions
- David Hess ([email protected]) on March 13, 2022 2:54 pm
- wrote:
- > Michael S ([email protected]) on March 13, 2022 8:14
- am wrote:
- > >
- > > What's wrong with "R1=R2+R3+CarryFlag" ?
- >
- > I have occasionally seen that, but I do not remember if any of the
- specialized C compilers used it.
- >
- That's asm, not a specialized C.
- See the followup.
- Or read page 478.
- [26]https://www.analog.com/media/en/dsp-documentation/processor-manuals/34605284816196ts201_pgr.pdf
- By: Andrey ([email protected]), March 14, 2022 1:27 am
- Room: [25]Moderated Discussions
- Michael S ([email protected]) on March 13, 2022 8:14 am
- wrote:
- > Adrian ([email protected]) on March 12, 2022 12:01 pm wrote:
- > > David Hess ([email protected]) on March 12, 2022 10:39
- am wrote:
- > > >
- > > > Even ADD usually has a variation which includes carry, and assuming
- the ADD width from
- > > > the operands is not always unambiguous. Even x86 assembly required
- an extra notation
- > > > to handle that, while 8080 did not. I do not remember now how Z80
- handled it; Z80
- > > > used different mnemonics than 8080 and must have determined context
- like x86.
- > > >
- > > > Macro assemblers solved these problems long ago but perhaps not in
- the way modern programmers are
- > > > used to. From my perspective of an assembly programmer, I could list
- similar problems with C notation,
- > > > and in the past some non-standard specialized C compilers addressed
- issues like this.
- > > >
- > >
- > >
- > > In an assembly language that does not use the traditional assembly
- instruction
- > > format, but it uses expressions, like e.g. in C, you need more
- operators, to cover
- > > all the operations that are possible between operands of a given type.
- > >
- > > Those operators may use keywords, like the mnemonics of a traditional
- language, e.g.
- > > ADD and ADC, or, in a programming language that accepts Unicode source
- files, like any
- > > modern programming language should, in my opinion, then there are
- plenty of symbols available
- > > for operators, e.g. one could use "+" for ADD and "+" in a circle for
- ADC.
- > >
- > > Actually such a notation is not new, it was used in the documentation
- of various CPUs, in the past.
- > >
- >
- > What's wrong with "R1=R2+R3+CarryFlag" ?
- The problem with it is I can see three operations in this notation, while
- there's supposed to be a single instruction for it. There is an ambiguity
- as to how this notation is translated into instructions, unless you
- hardcode in specification the correspondence between exact expressions and
- machine instructions. And at that point, how is it better than the
- instruction mnemonics we use today?
- Also, unless you put restrictions on the expressions and their
- interpretation, there is an ambiguity on the result of this expression.
- Integer addition is transitive, so should the compiler interpret it as
- "R1=(R2+R3)+CarryFlag" or "R1=R2+(R3+CarryFlag)"? If you put the
- requirement to interpret the expression left-to-right then what about
- "R1=CarryFlag+R2+R3"? Next you put the requirement that CarryFlag must go
- last, but then how is it better than "adc R2, R3, R1"? Also, if your
- target ISA does not support non-destructive instructions, you will have an
- ambiguity with "R1=R2+R3" as the compiler will have to either insert a
- move instruction or reject this expression, while this is naturally solved
- by instruction mnemonics, which would only support two operands.
- Instruction mnemonics are better because they are not ambiguous like that.
- From the programmer's perspective, they provide the minimum granularity of
- operations performed by the machine. This is not only important from the
- program interpretation standpoint, but also the definition of the program
- state at the point of interruption, and visibility of operation effects to
- other CPUs and devices.
- By: Michael S ([email protected]), March 14, 2022 3:08
- am
- Room: [25]Moderated Discussions
- Andrey ([email protected]) on March 14, 2022 1:27 am
- wrote:
- > Michael S ([email protected]) on March 13, 2022 8:14
- am wrote:
- > > Adrian ([email protected]) on March 12, 2022 12:01 pm wrote:
- > > > David Hess ([email protected]) on March 12, 2022
- 10:39 am wrote:
- > > > >
- > > > > Even ADD usually has a variation which includes carry, and
- assuming the ADD width from
- > > > > the operands is not always unambiguous. Even x86 assembly required
- an extra notation
- > > > > to handle that, while 8080 did not. I do not remember now how Z80
- handled it; Z80
- > > > > used different mnemonics than 8080 and must have determined
- context like x86.
- > > > >
- > > > > Macro assemblers solved these problems long ago but perhaps not in
- the way modern programmers are
- > > > > used to. From my perspective of an assembly programmer, I could
- list similar problems with C notation,
- > > > > and in the past some non-standard specialized C compilers
- addressed issues like this.
- > > > >
- > > >
- > > >
- > > > In an assembly language that does not use the traditional assembly
- instruction
- > > > format, but it uses expressions, like e.g. in C, you need more
- operators, to cover
- > > > all the operations that are possible between operands of a given
- type.
- > > >
- > > > Those operators may use keywords, like the mnemonics of a
- traditional language, e.g.
- > > > ADD and ADC, or, in a programming language that accepts Unicode
- source files, like any
- > > > modern programming language should, in my opinion, then there are
- plenty of symbols available
- > > > for operators, e.g. one could use "+" for ADD and "+" in a circle
- for ADC.
- > > >
- > > > Actually such a notation is not new, it was used in the
- documentation of various CPUs, in the past.
- > > >
- > >
- > > What's wrong with "R1=R2+R3+CarryFlag" ?
- >
- > The problem with it is I can see three operations in this notation,
- while there's supposed to be a
- > single instruction for it. There is an ambiguity as to how this notation
- is translated into instructions,
- > unless you hardcode in specification the correspondence between exact
- expressions and machine instructions.
- > And at that point, how is it better than the instruction mnemonics we
- use today?
- It's better because the meaning is easier to remember. Especially for
- casual reader.
- It's probably not better for asm programmer that write asm on particular
- ISA 200 hours per month.
- And it's marginally worse for antiquated compiler like gcc that goes
- through asm stage during compilation.
- >
- > Also, unless you put restrictions on the expressions and their
- interpretation, there is an ambiguity
- > on the result of this expression. Integer addition is transitive, so
- should the compiler interpret
- > it as "R1=(R2+R3)+CarryFlag" or "R1=R2+(R3+CarryFlag)"? If you put the
- requirement to interpret
- > the expression left-to-right then what about "R1=CarryFlag+R2+R3"? Next
- you put the requirement
- > that CarryFlag must go last, but then how is it better than "adc R2, R3,
- R1"? Also, if your target
- > ISA does not support non-destructive instructions, you will have an
- ambiguity with "R1=R2+R3" as
- > the compiler will have to either insert a move instruction or reject
- this expression, while this
- > is naturally solved by instruction mnemonics, which would only support
- two operands.
- >
- > Instruction mnemonics are better because they are not ambiguous like
- that. From the programmer's perspective,
- > they provide the minimum granularity of operations performed by the
- machine. This is not only important
- > from the program interpretation standpoint, but also the definition of
- the program state at the point
- > of interruption, and visibility of operation effects to other CPUs and
- devices.
- >
- You're thinking in terms of compiler while I am talking about assembler.
- Most of the things you mentioned above are just syntax errors that would
- produce [hopefully intelligible] error messages.
- And it's not a pure theory, "algebraic" assemblers exist in real world.
- For some architectures, e.g. for majority of Analog Devices families of
- DSPs, they are the only existing assemblers.
- As I said above, for heavy human users they are neither better nor worse
- than decent traditional asm, which is not surprising due to Perlis's
- observation #99, but for casual users, esp reader, they are non-trivially
- better.
- By: Andrey ([email protected]), March 14, 2022 5:36 am
- Room: [25]Moderated Discussions
- Michael S ([email protected]) on March 14, 2022 3:08 am
- wrote:
- > Andrey ([email protected]) on March 14, 2022 1:27 am
- wrote:
- > > Michael S ([email protected]) on March 13, 2022
- 8:14 am wrote:
- > > > Adrian ([email protected]) on March 12, 2022 12:01 pm wrote:
- > > > > David Hess ([email protected]) on March 12, 2022
- 10:39 am wrote:
- > > > > >
- > > > > > Even ADD usually has a variation which includes carry, and
- assuming the ADD width from
- > > > > > the operands is not always unambiguous. Even x86 assembly
- required an extra notation
- > > > > > to handle that, while 8080 did not. I do not remember now how
- Z80 handled it; Z80
- > > > > > used different mnemonics than 8080 and must have determined
- context like x86.
- > > > > >
- > > > > > Macro assemblers solved these problems long ago but perhaps not
- in the way modern programmers are
- > > > > > used to. From my perspective of an assembly programmer, I could
- list similar problems with C notation,
- > > > > > and in the past some non-standard specialized C compilers
- addressed issues like this.
- > > > > >
- > > > >
- > > > >
- > > > > In an assembly language that does not use the traditional assembly
- instruction
- > > > > format, but it uses expressions, like e.g. in C, you need more
- operators, to cover
- > > > > all the operations that are possible between operands of a given
- type.
- > > > >
- > > > > Those operators may use keywords, like the mnemonics of a
- traditional language, e.g.
- > > > > ADD and ADC, or, in a programming language that accepts Unicode
- source files, like any
- > > > > modern programming language should, in my opinion, then there are
- plenty of symbols available
- > > > > for operators, e.g. one could use "+" for ADD and "+" in a circle
- for ADC.
- > > > >
- > > > > Actually such a notation is not new, it was used in the
- documentation of various CPUs, in the past.
- > > > >
- > > >
- > > > What's wrong with "R1=R2+R3+CarryFlag" ?
- > >
- > > The problem with it is I can see three operations in this notation,
- while there's supposed to be a
- > > single instruction for it. There is an ambiguity as to how this
- notation is translated into instructions,
- > > unless you hardcode in specification the correspondence between exact
- expressions and machine instructions.
- > > And at that point, how is it better than the instruction mnemonics we
- use today?
- >
- > It's better because the meaning is easier to remember. Especially for
- casual reader.
- > It's probably not better for asm programmer that write asm on particular
- ISA 200 hours per month.
- > And it's marginally worse for antiquated compiler like gcc that goes
- through asm stage during compilation.
- >
- > >
- > > Also, unless you put restrictions on the expressions and their
- interpretation, there is an ambiguity
- > > on the result of this expression. Integer addition is transitive, so
- should the compiler interpret
- > > it as "R1=(R2+R3)+CarryFlag" or "R1=R2+(R3+CarryFlag)"? If you put the
- requirement to interpret
- > > the expression left-to-right then what about "R1=CarryFlag+R2+R3"?
- Next you put the requirement
- > > that CarryFlag must go last, but then how is it better than "adc R2,
- R3, R1"? Also, if your target
- > > ISA does not support non-destructive instructions, you will have an
- ambiguity with "R1=R2+R3" as
- > > the compiler will have to either insert a move instruction or reject
- this expression, while this
- > > is naturally solved by instruction mnemonics, which would only support
- two operands.
- > >
- > > Instruction mnemonics are better because they are not ambiguous
- > > like that. From the programmer's perspective,
- > > they provide the minimum granularity of operations performed by the
- machine. This is not only important
- > > from the program interpretation standpoint, but also the definition of
- the program state at the point
- > > of interruption, and visibility of operation effects to other CPUs and
- devices.
- > >
- >
- > You're thinking in terms of compiler while I am talking about assembler.
- Most of the things you mentioned
- > above are just syntax errors that would produce [hopefully intelligible]
- error messages.
- >
- > And it's not a pure theory, "algebraic" assemblers exist in real world.
- For some architectures,
- > e.g. for majority of Analog Devices families of DSPs, they are the only
- existing assemblers.
- > As I said above, for heavy human users they are neither better nor worse
- than
- > decent traditional asm, which is not surprising due to Perlis's
- observation
- > #99, but for casual users, esp reader, they are non-trivially better.
- I don't consider casual users the target audience for assembler languages,
- neither for writing nor for reading. There are plenty of higher level
- programming languages that provide more traditional syntax for arithmetic
- operations and much more. Assembler is not for that, its main target is to
- be the low level machine-oriented language, where there's basically no
- lower level language (well, aside from binary code, but programming in
- binary code is almost not applicable to humans). In a language like that,
- you must be very explicit and very precise as to what the machine must do,
- and any ambiguity and interpretation freedom is for the worse.
- I don't dispute that there are implementations of more human-friendly
- assemblers. I'm saying I don't think this is a good idea.
- By: rwessel ([email protected]), March 14, 2022 6:32 am
- Room: [25]Moderated Discussions
- Andrey ([email protected]) on March 14, 2022 5:36 am
- wrote:
- > Michael S ([email protected]) on March 14, 2022 3:08
- am wrote:
- > > Andrey ([email protected]) on March 14, 2022 1:27
- am wrote:
- > > > Michael S ([email protected]) on March 13, 2022
- 8:14 am wrote:
- > > > > Adrian ([email protected]) on March 12, 2022 12:01 pm wrote:
- > > > > > David Hess ([email protected]) on March 12, 2022
- 10:39 am wrote:
- > > > > > >
- > > > > > > Even ADD usually has a variation which includes carry, and
- assuming the ADD width from
- > > > > > > the operands is not always unambiguous. Even x86 assembly
- required an extra notation
- > > > > > > to handle that, while 8080 did not. I do not remember now how
- Z80 handled it; Z80
- > > > > > > used different mnemonics than 8080 and must have determined
- context like x86.
- > > > > > >
- > > > > > > Macro assemblers solved these problems long ago but perhaps
- not in the way modern programmers are
- > > > > > > used to. From my perspective of an assembly programmer, I
- could list similar problems with C notation,
- > > > > > > and in the past some non-standard specialized C compilers
- addressed issues like this.
- > > > > > >
- > > > > >
- > > > > >
- > > > > > In an assembly language that does not use the traditional
- assembly instruction
- > > > > > format, but it uses expressions, like e.g. in C, you need more
- operators, to cover
- > > > > > all the operations that are possible between operands of a given
- type.
- > > > > >
- > > > > > Those operators may use keywords, like the mnemonics of a
- traditional language, e.g.
- > > > > > ADD and ADC, or, in a programming language that accepts Unicode
- source files, like any
- > > > > > modern programming language should, in my opinion, then there
- are plenty of symbols available
- > > > > > for operators, e.g. one could use "+" for ADD and "+" in a
- circle for ADC.
- > > > > >
- > > > > > Actually such a notation is not new, it was used in the
- documentation of various CPUs, in the past.
- > > > > >
- > > > >
- > > > > What's wrong with "R1=R2+R3+CarryFlag" ?
- > > >
- > > > The problem with it is I can see three operations in this notation,
- while there's supposed to be a
- > > > single instruction for it. There is an ambiguity as to how this
- notation is translated into instructions,
- > > > unless you hardcode in specification the correspondence between
- exact expressions and machine instructions.
- > > > And at that point, how is it better than the instruction mnemonics
- we use today?
- > >
- > > It's better because the meaning is easier to remember. Especially for
- casual reader.
- > > It's probably not better for asm programmer that write asm on
- particular ISA 200 hours per month.
- > > And it's marginally worse for antiquated compiler like gcc that goes
- through asm stage during compilation.
- > >
- > > >
- > > > Also, unless you put restrictions on the expressions and their
- interpretation, there is an ambiguity
- > > > on the result of this expression. Integer addition is transitive, so
- should the compiler interpret
- > > > it as "R1=(R2+R3)+CarryFlag" or "R1=R2+(R3+CarryFlag)"? If you put
- the requirement to interpret
- > > > the expression left-to-right then what about "R1=CarryFlag+R2+R3"?
- Next you put the requirement
- > > > that CarryFlag must go last, but then how is it better than "adc R2,
- R3, R1"? Also, if your target
- > > > ISA does not support non-destructive instructions, you will have an
- ambiguity with "R1=R2+R3" as
- > > > the compiler will have to either insert a move instruction or reject
- this expression, while this
- > > > is naturally solved by instruction mnemonics, which would only
- support two operands.
- > > >
- > > > Instruction mnemonics are better because they are not ambiguous
- > > > like that. From the programmer's perspective,
- > > > they provide the minimum granularity of operations performed by the
- machine. This is not only important
- > > > from the program interpretation standpoint, but also the definition
- of the program state at the point
- > > > of interruption, and visibility of operation effects to other CPUs
- and devices.
- > > >
- > >
- > > You're thinking in terms of compiler while I am talking about
- assembler. Most of the things you mentioned
- > > above are just syntax errors that would produce [hopefully
- intelligible] error messages.
- > >
- > > And it's not a pure theory, "algebraic" assemblers exist in real
- world. For some architectures,
- > > e.g. for majority of Analog Devices families of DSPs, they are the
- only existing assemblers.
- > > As I said above, for heavy human users they are neither better nor
- worse than
- > > decent traditional asm, which is not surprising due to Perlis's
- observation
- > > #99, but for casual users, esp reader, they are non-trivially better.
- >
- > I don't consider casual users the target audience for assembler
- languages, neither for writing nor for reading.
- > There are plenty of higher level programming languages that provide more
- traditional syntax for arithmetic operations
- > and much more. Assembler is not for that, its main target is to be the
- low level machine-oriented language,
- > where there's basically no lower level language (well, aside from binary
- code, but programming in binary code
- > is almost not applicable to humans). In a language like that, you must
- be very explicit and very precise as
- > to what the machine must do, and any ambiguity and interpretation
- freedom is for the worse.
- >
- > I don't dispute that there are implementations of more human-friendly
- > assemblers. I'm saying I don't think this is a good idea.
- In the past good assembler facilities for more "casual" programming were
- more important as assembler programming was much more common, and unlike
- today, it often included entire applications, where you ended up with tons
- of more boilerplate-ish code.
- Still a decent macro facilities and other aids are still occasionally
- useful, unfortunately they tend to be more afterthoughts these days (and
- often a more than a bit half-baked). I've more than once resorted to a HLL
- program to generate some code (say with significant unrolling, or such)
- rather than using facilities built into the assembler.
- By: Jukka Larja ([email protected]), March 14, 2022 7:10
- am
- Room: [25]Moderated Discussions
- Andrey ([email protected]) on March 14, 2022 5:36 am
- wrote:
- > I don't consider casual users the target audience for assembler
- languages, neither for writing nor for reading.
- That may well be, but I don't know anyone who writes assembler (I could
- add "pretty much ever", but frankly, even that would be bit of an
- exaggeration). However, everyone who writes C(++) for game industry should
- be able to read assembly. And I imagine situation is pretty similar for
- most C(++) programmers (otherwise they are likely to use something
- friendlier).
- So personally I'm thinking that readability of assembler is an order of
- magnitude more important than writability, and that large part of those
- readers are "casual", at least when compared to someone who spents
- significant time writing assembler for work.
- But this is all based on my use case of assembler. If current (in my
- opinion horrible and extremely unreadable) syntax is superior for writing,
- then I'd suggest friendlier syntax (and especially naming) as an option in
- debugger (and in Godbolt :D ). In a perfect world, that is. I don't think
- there's enough demand for anything like that.
- -JLarja
- By: Adrian ([email protected]), March 11, 2022 1:06 pm
- Room: [25]Moderated Discussions
- Tim ([email protected]) on March 11, 2022 10:56 am wrote:
- > I always wanted my assembly (and I have written a fair amount, although
- not much lately) to be
- > closer to a high level language. Instead of
- >
- > ADD R1,R2
- >
- > Which could be "add r1 to r2", or "add R2 to R1" depending on the
- assembler, just write:
- >
- > R1 += R2
- >
- > For a load:
- >
- > R1 = [R1+offset]
- >
- > and so on.
- >
- > For the more complex things (add packed single), a simple algebraic
- statement is not going
- > to work, so make it a function call like syntax:
- >
- > R1 = add_packed_single(R1, R2)
- >
- > Of course there are limitations on what is semantically allowed, but if
- somebody wants to write:
- >
- > R3 = add_packed_single(R1, R2)
- >
- > The assembler *could* be smart enough to move R1 to R3 first, then do
- the add.
- >
- > The result is something that is still as efficient and low level as
- assembler (still pretty
- > much one instruction per statement), but readable by programmers that
- are familiar with C like
- > languages.
- You are not the only one.
- I also prefer to write assembly in a way similar to your examples and to
- use a preprocessor to generate a standard assembly file.
- A more elaborate tool of this type was the qhasm assembler of D. J.
- Bernstein.
- A preliminary version of it was published in 2007.
- An example of the syntax used by qhasm:
- [26]https://cr.yp.to/qhasm/amd64/20070122-poly1305.q
- By: Andrey ([email protected]), March 11, 2022 4:01 pm
- Room: [25]Moderated Discussions
- Tim ([email protected]) on March 11, 2022 10:56 am wrote:
- > I always wanted my assembly (and I have written a fair amount, although
- not much lately) to be
- > closer to a high level language. Instead of
- >
- > ADD R1,R2
- >
- > Which could be "add r1 to r2", or "add R2 to R1" depending on the
- assembler, just write:
- >
- > R1 += R2
- >
- > For a load:
- >
- > R1 = [R1+offset]
- >
- > and so on.
- >
- > For the more complex things (add packed single), a simple algebraic
- statement is not going
- > to work, so make it a function call like syntax:
- >
- > R1 = add_packed_single(R1, R2)
- >
- > Of course there are limitations on what is semantically allowed, but if
- somebody wants to write:
- >
- > R3 = add_packed_single(R1, R2)
- >
- > The assembler *could* be smart enough to move R1 to R3 first, then do
- the add.
- >
- > The result is something that is still as efficient and low level as
- assembler (still pretty
- > much one instruction per statement), but readable by programmers that
- are familiar with C like
- > languages.
- Why don't you just write in C?
- Assembler is useful in cases when you want exact instructions and their
- order. For example, there may be many ways to do arithmetic operations (in
- x86, add/sub/mul, lea, shifts), and different instructions are useful in
- different circumstances (like lea not affecting flags, meaning they are
- preserved from prior instructions; the other way around is also useful if
- you want to test the result of the arithmetic instruction). Another
- example is atomics and memory ordering guarantees which are maintained by
- specific instructions and their order. Yet another example is emitting
- very specific instruction sequences (some of which may look stupid,
- inefficient or useless) that have special semantics on hardware. Think
- workarounds for hardware bugs and vulnerabilities. So you do want to be
- very explicit about generated instructions in assembler.
- By: Adrian ([email protected]), March 12, 2022 2:24 am
- Room: [25]Moderated Discussions
- Andrey ([email protected]) on March 11, 2022 3:01 pm
- wrote:
- > Tim ([email protected]) on March 11, 2022 10:56 am wrote:
- > > I always wanted my assembly (and I have written a fair amount,
- although not much lately) to be
- > > closer to a high level language. Instead of
- > >
- > > ADD R1,R2
- > >
- > > Which could be "add r1 to r2", or "add R2 to R1" depending on the
- assembler, just write:
- > >
- > > R1 += R2
- > >
- > > For a load:
- > >
- > > R1 = [R1+offset]
- > >
- > > and so on.
- > >
- > > For the more complex things (add packed single), a simple algebraic
- statement is not going
- > > to work, so make it a function call like syntax:
- > >
- > > R1 = add_packed_single(R1, R2)
- > >
- > > Of course there are limitations on what is semantically allowed, but
- if somebody wants to write:
- > >
- > > R3 = add_packed_single(R1, R2)
- > >
- > > The assembler *could* be smart enough to move R1 to R3 first, then do
- the add.
- > >
- > > The result is something that is still as efficient and low level as
- assembler (still pretty
- > > much one instruction per statement), but readable by programmers that
- are familiar with C like
- > > languages.
- >
- > Why don't you just write in C?
- >
- > Assembler is useful in cases when you want exact instructions and their
- order. For example, there may be
- > many ways to do arithmetic operations (in x86, add/sub/mul, lea,
- shifts), and different instructions are useful
- > in different circumstances (like lea not affecting flags, meaning they
- are preserved from prior instructions;
- > the other way around is also useful if you want to test the result of
- the arithmetic instruction). Another
- > example is atomics and memory ordering guarantees which are maintained
- by specific instructions and their
- > order. Yet another example is emitting very specific instruction
- sequences (some of which may look stupid,
- > inefficient or useless) that have special semantics on hardware. Think
- workarounds for hardware bugs and vulnerabilities.
- > So you do want to be very explicit about generated instructions in
- assembler.
- >
- Assembler is required precisely for what you say.
- Nevertheless, the ability of specifying exactly a sequence of machine
- instructions is something that it is completely independent from a
- requirement of writing each machine instruction only as a mnemonic
- followed by a list of operands.
- It is possible to use any syntax that is used by any other kind of
- programming languages, but nonetheless define rules that will determine
- unambiguously the sequence of machine instructions that is generated.
- I have already given in my other post an example program written for the
- qhasm of D.J. Bernstein, which does not look at all like a traditional
- assembly language, but it is close to a language like C.
- Nonetheless, it specifies exactly the sequence of machine instructions,
- like any other assembly language.
- By: anon2 ([email protected]), March 11, 2022 5:37 pm
- Room: [25]Moderated Discussions
- Tim ([email protected]) on March 11, 2022 10:56 am wrote:
- > I always wanted my assembly (and I have written a fair amount, although
- not much lately) to be
- > closer to a high level language. Instead of
- >
- > ADD R1,R2
- >
- > Which could be "add r1 to r2", or "add R2 to R1" depending on the
- assembler, just write:
- >
- > R1 += R2
- Little different than ADD R1,R2. It really takes all of about one hour of
- serious assembly programming for the source destination ordering to become
- something you don't need to think about.
- >
- > For a load:
- >
- > R1 = [R1+offset]
- What kind of load would that give you, and how would you perform other
- types?
- Specifying instruction is superior here.
- >
- > and so on.
- >
- > For the more complex things (add packed single), a simple algebraic
- statement is not going
- > to work, so make it a function call like syntax:
- >
- > R1 = add_packed_single(R1, R2)
- >
- > Of course there are limitations on what is semantically allowed, but if
- somebody wants to write:
- >
- > R3 = add_packed_single(R1, R2)
- >
- > The assembler *could* be smart enough to move R1 to R3 first, then do
- the add.
- You can do all this with a macro assembler like gas. Well not this exact
- semantics but close.
- > The result is something that is still as efficient and low level as
- assembler (still pretty
- > much one instruction per statement), but readable by programmers that
- are familiar with C like
- > languages.
- Most use of assembly these days wants to know the exact machine
- instructions executed.
- The days of writing tens of thousands of lines of asm in applicatoins are
- gone and never coming back, for good reason. Write anything
- performance-critical in a high level language like C.
- Most of the remaining few reasons for asm in performance critical places
- are well-contained compute kernels that have no logic besides the
- mathematical algorithm, and tend to be very microarchitecture specific so
- you don't really want a high level assembler to pick or schedule your
- instructions or allocate your registers anyway.
- By: rwessel ([email protected]), March 11, 2022 7:44 pm
- Room: [25]Moderated Discussions
- Tim ([email protected]) on March 11, 2022 10:56 am wrote:
- > I always wanted my assembly (and I have written a fair amount, although
- not much lately) to be
- > closer to a high level language. Instead of
- >
- > ADD R1,R2
- >
- > Which could be "add r1 to r2", or "add R2 to R1" depending on the
- assembler, just write:
- >
- > R1 += R2
- >
- > For a load:
- >
- > R1 = [R1+offset]
- >
- > and so on.
- >
- > For the more complex things (add packed single), a simple algebraic
- statement is not going
- > to work, so make it a function call like syntax:
- >
- > R1 = add_packed_single(R1, R2)
- >
- > Of course there are limitations on what is semantically allowed, but if
- somebody wants to write:
- >
- > R3 = add_packed_single(R1, R2)
- >
- > The assembler *could* be smart enough to move R1 to R3 first, then do
- the add.
- >
- > The result is something that is still as efficient and low level as
- assembler (still pretty
- > much one instruction per statement), but readable by programmers that
- are familiar with C like
- > languages.
- This is less than helpful, but there was an assembler that looked more
- like arithmetic expressions, along the lines you suggested. 1960s, but I
- can't remember which system it was. I was thinking CDC 6600 family, but
- that's wrong. You'd code an add like:
- r1=r2+r3
- By: Heikki Kultala ([email protected]), March 9, 2022
- 11:31 pm
- Room: [25]Moderated Discussions
- -.- ([email protected]) on March 9, 2022 5:39 am wrote:
- > Plenty of weird names in many assembly dialects, to be honest.
- > PALIGNR in x86 or EXT in AArch64 aren't obvious unless you already know
- what the instruction does.
- >
- > Perhaps it's time to move away from compact assembly instruction names?
- When they are using in RISC-V is totally wrong words, the problem is not
- "compactness" of the asm syntax.
- In common terminology:
- Conditional move means 3-operand instruction (input, condition, result)
- Select means 4-operand instruction (Input1, input2, select, result)
- Gather means vector load from memory with vector addressing.
- Shuffle means reordering of data inside the vector registers.
- By: Adrian ([email protected]), March 10, 2022 7:33 am
- Room: [25]Moderated Discussions
- Heikki Kultala ([email protected]) on March 9, 2022
- 10:31 pm wrote:
- > -.- ([email protected]) on March 9, 2022 5:39 am wrote:
- > > Plenty of weird names in many assembly dialects, to be honest.
- > > PALIGNR in x86 or EXT in AArch64 aren't obvious unless you already
- know what the instruction does.
- > >
- > > Perhaps it's time to move away from compact assembly instruction
- names?
- >
- > When they are using in RISC-V is totally wrong words, the problem is not
- "compactness" of the asm syntax.
- >
- > In common terminology:
- > Conditional move means 3-operand instruction (input, condition, result)
- > Select means 4-operand instruction (Input1, input2, select, result)
- >
- > Gather means vector load from memory with vector addressing.
- > Shuffle means reordering of data inside the vector registers.
- >
- Yes, you are perfectly right.
- I agree that failing to follow the traditional meaning of these operations
- is bad.
- By: anonymou5 ([email protected]), March 10, 2022 12:59 pm
- Room: [25]Moderated Discussions
- > Yes, you are perfectly right.
- >
- > I agree that failing to follow the traditional meaning of these
- operations is bad.
- If it bothers you enough, then join the RISC-V camp, and try to change
- things.
- Another possibility: use macros, to name things differently.
- By: rwessel ([email protected]), March 11, 2022 10:42 am
- Room: [25]Moderated Discussions
- anonymou5 ([email protected]) on March 10, 2022 11:59 am wrote:
- > > Yes, you are perfectly right.
- > >
- > > I agree that failing to follow the traditional meaning of these
- operations is bad.
- >
- > If it bothers you enough, then join the RISC-V camp, and try to change
- things.
- >
- > Another possibility: use macros, to name things differently.
- I suspect that idea will (and should) get the same reception as people who
- do:
- #define begin {
- #define end }
- in C. And for mostly the same reasons.
- By: Anon ([email protected]), March 11, 2022 11:44 am
- Room: [25]Moderated Discussions
- rwessel ([email protected]) on March 11, 2022 9:42 am wrote:
- > I suspect that idea will (and should) get the same reception as people
- who do:
- >
- > #define begin {
- > #define end }
- >
- > in C. And for mostly the same reasons.
- One thing I hate more than C {} is begin/end, some people are hard to
- understand.
- By: Adrian ([email protected]), March 11, 2022 1:45 pm
- Room: [25]Moderated Discussions
- Anon ([email protected]) on March 11, 2022 10:44 am wrote:
- > rwessel ([email protected]) on March 11, 2022 9:42 am wrote:
- > > I suspect that idea will (and should) get the same reception as people
- who do:
- > >
- > > #define begin {
- > > #define end }
- > >
- > > in C. And for mostly the same reasons.
- >
- > One thing I hate more than C {} is begin/end, some people are hard to
- understand.
- I also consider that replacing "{" and "}" with "begin" and "end" is
- stupid.
- On the other hand, having distinct keywords or symbols used as separators
- in different kinds of statements or expressions, like in Algol 68, is a
- definite improvement over the Pascal or C method of using a single kind of
- statement brackets, which results in programs with an excessive number of
- brackets, which are very difficult to read without using an editor which
- highlights matching parentheses.
- While the highlighting of matching brackets/parentheses is helpful, the
- need of checking them still slows you a lot.
- So in personal projects, where team programming rules do not matter, I
- like definitions such as:
- #define for for(
- #define loop ){
- #define next }
- This solves common problems, like having a long string of "}", a part
- closing "if" and a part closing "for", and it is difficult to distinguish
- which are which.
- It also solves what I consider a serious defect in C/C++, having to use
- parentheses for the control expressions of if/while/for/switch. The
- parentheses are needed only because the following braces are optional.
- However in most cases you have to put braces anyway, but you still have to
- write the redundant parentheses. The braces should have been mandatory and
- no parentheses should have been used.
- By: Anon ([email protected]), March 11, 2022 2:33 pm
- Room: [25]Moderated Discussions
- Adrian ([email protected]) on March 11, 2022 12:45 pm wrote:
- > It also solves what I consider a serious defect in C/C++, having to use
- parentheses for the control
- > expressions of if/while/for/switch. The parentheses are needed only
- because the following braces are
- > optional. However in most cases you have to put braces anyway, but you
- still have to write the redundant
- > parentheses. The braces should have been mandatory and no parentheses
- should have been used.
- That's what Rust did, but the braces still annoys me because after the
- opening brace there is always a new line, I think, after a if, for or
- while a line break should be mandatory so we only need a block terminator.
- Oh, and the ";", terminating an expression at line break is far more
- common than continuing it.
- By: Andrey ([email protected]), March 11, 2022 4:09 pm
- Room: [25]Moderated Discussions
- Anon ([email protected]) on March 11, 2022 1:33 pm wrote:
- > Adrian ([email protected]) on March 11, 2022 12:45 pm wrote:
- > > It also solves what I consider a serious defect in C/C++, having to
- use parentheses for the control
- > > expressions of if/while/for/switch. The parentheses are needed only
- because the following braces are
- > > optional. However in most cases you have to put braces anyway, but you
- still have to write the redundant
- > > parentheses. The braces should have been mandatory and no parentheses
- should have been used.
- >
- > That's what Rust did, but the braces still annoys me because after the
- opening brace there is always a new line,
- > I think, after a if, for or while a line break should be mandatory so we
- only need a block terminator.
- > Oh, and the ";", terminating an expression at line break is far more
- common than continuing it.
- C/C++ are whitespace-neutral (and newline characters are whitespace),
- which I consider a big advantage. Even if you maintain one expression per
- line, this is still useful in macros, whether defined by you or system
- headers.
- By: Adrian ([email protected]), March 12, 2022 2:41 am
- Room: [25]Moderated Discussions
- Andrey ([email protected]) on March 11, 2022 3:09 pm
- wrote:
- > Anon ([email protected]) on March 11, 2022 1:33 pm wrote:
- > > Adrian ([email protected]) on March 11, 2022 12:45 pm wrote:
- > > > It also solves what I consider a serious defect in C/C++, having to
- use parentheses for the control
- > > > expressions of if/while/for/switch. The parentheses are needed only
- because the following braces are
- > > > optional. However in most cases you have to put braces anyway, but
- you still have to write the redundant
- > > > parentheses. The braces should have been mandatory and no
- parentheses should have been used.
- > >
- > > That's what Rust did, but the braces still annoys me because
- > > after the opening brace there is always a new line,
- > > I think, after a if, for or while a line break should be mandatory so
- we only need a block terminator.
- > > Oh, and the ";", terminating an expression at line break is far more
- common than continuing it.
- >
- > C/C++ are whitespace-neutral (and newline characters are whitespace),
- which
- > I consider a big advantage. Even if you maintain one expression per
- line, this
- > is still useful in macros, whether defined by you or system headers.
- >
- In 1965, CPL, the ancestor of C/C++, handled much better the issue of
- whitespace and statement termination.
- Any statement could be terminated by either a new line or a semicolon,
- except that a new line was not considered as a statement terminator when
- it occurred at a program point where a statement terminator is illegal.
- (the usefulness of the exception is debatable, it saves typing, but it
- might allow some bugs)
- The CPL rule combined the previous rules used by Algol 60 (semicolon) and
- Fortran (new line). The CPL rule has been inherited by the UNIX shell.
- When semicolon and new line are synonymous, that minimizes the need of
- typing terminators, while still allowing both for free formatting of the
- program text and for writing any kind of macros.
- By: Andrey ([email protected]), March 12, 2022 4:57 am
- Room: [25]Moderated Discussions
- Adrian ([email protected]) on March 12, 2022 1:41 am wrote:
- > Andrey ([email protected]) on March 11, 2022 3:09 pm
- wrote:
- > > Anon ([email protected]) on March 11, 2022 1:33 pm wrote:
- > > > Adrian ([email protected]) on March 11, 2022 12:45 pm wrote:
- > > > > It also solves what I consider a serious defect in C/C++, having
- to use parentheses for the control
- > > > > expressions of if/while/for/switch. The parentheses are needed
- only because the following braces are
- > > > > optional. However in most cases you have to put braces anyway, but
- you still have to write the redundant
- > > > > parentheses. The braces should have been mandatory and no
- parentheses should have been used.
- > > >
- > > > That's what Rust did, but the braces still annoys me because
- > > > after the opening brace there is always a new line,
- > > > I think, after a if, for or while a line break should be mandatory
- so we only need a block terminator.
- > > > Oh, and the ";", terminating an expression at line break is far more
- common than continuing it.
- > >
- > > C/C++ are whitespace-neutral (and newline characters are whitespace),
- which
- > > I consider a big advantage. Even if you maintain one expression per
- line, this
- > > is still useful in macros, whether defined by you or system headers.
- > >
- >
- >
- > In 1965, CPL, the ancestor of C/C++, handled much better the issue of
- whitespace and statement termination.
- >
- > Any statement could be terminated by either a new line or a semicolon,
- except that a new line was not considered
- > as a statement terminator when it occurred at a program point where a
- statement terminator is illegal.
- > (the usefulness of the exception is debatable, it saves typing, but it
- might allow some bugs)
- >
- > The CPL rule combined the previous rules used by Algol 60 (semicolon)
- and
- > Fortran (new line). The CPL rule has been inherited by the UNIX shell.
- >
- > When semicolon and new line are synonymous, that minimizes the need of
- typing terminators, while
- > still allowing both for free formatting of the program text and for
- writing any kind of macros.
- This does not work in all contexts. For example:
- struct foo
- {
- int value;
- }
- object = {10};
- I'm fairly sure there are other contexts as well.
- There is also a matter of further language extensibility. New language
- constructs are easier to introduce and teach when the syntax rules are
- simple and unambiguous. Granted, C/C++ syntax is not exactly simple as it
- is, but introducing whitespace sensibility certainly doesn't make it
- simpler. An unconditional rule "a statement or declaration ends with
- semicolon" is easier to learn and follow than "a statement or declaration
- ends with semicolon or newline if X, Y or Z conditions are satisfied".
- By: Anon ([email protected]), March 12, 2022 5:01 am
- Room: [25]Moderated Discussions
- Andrey ([email protected]) on March 12, 2022 3:57 am
- wrote:
- > This does not work in all contexts. For example:
- >
- > struct foo
- > {
- > int value;
- > }
- > object = {10};
- >
- > I'm fairly sure there are other contexts as well.
- >
- > There is also a matter of further language extensibility. New language
- constructs are easier to introduce
- > and teach when the syntax rules are simple and unambiguous. Granted,
- C/C++ syntax is not exactly simple
- > as it is, but introducing whitespace sensibility certainly doesn't make
- it simpler. An unconditional
- > rule "a statement or declaration ends with semicolon" is easier to learn
- and follow than "a statement
- > or declaration ends with semicolon or newline if X, Y or Z conditions
- are satisfied".
- >
- "A statement or declaration ends with a newline" sounds simple to me.
- By: rwessel ([email protected]), March 12, 2022 7:12 am
- Room: [25]Moderated Discussions
- Anon ([email protected]) on March 12, 2022 4:01 am wrote:
- > Andrey ([email protected]) on March 12, 2022 3:57 am
- wrote:
- > > This does not work in all contexts. For example:
- > >
- > > struct foo
- > > {
- > > int value;
- > > }
- > > object = {10};
- > >
- > > I'm fairly sure there are other contexts as well.
- > >
- > > There is also a matter of further language extensibility. New language
- constructs are easier to introduce
- > > and teach when the syntax rules are simple and unambiguous. Granted,
- C/C++ syntax is not exactly simple
- > > as it is, but introducing whitespace sensibility certainly doesn't
- make it simpler. An unconditional
- > > rule "a statement or declaration ends with semicolon" is easier to
- learn and follow than "a statement
- > > or declaration ends with semicolon or newline if X, Y or Z conditions
- are satisfied".
- > >
- >
- > "A statement or declaration ends with a newline" sounds simple to me.
- Sure, but then you need a way to specify a continuation for statements you
- can't fit on a line. We have that in C too, in the preprocessor.
- And obviously that debate goes back to the dawn, with Fortran and Cobol
- taking different directions (and with complications in both cases).
- I think that by now we should have learned that significant whitespace in
- a programming language is mostly a mistake. Obviously people disagree,
- hence Python.
- By: Anon ([email protected]), March 12, 2022 1:50 pm
- Room: [25]Moderated Discussions
- rwessel ([email protected]) on March 12, 2022 6:12 am wrote:
- > Sure, but then you need a way to specify a continuation for statements
- > you can't fit on a line. We have that in C too, in the preprocessor.
- Basic uses "_", I don't like it because it is hard to see, things at the
- end of the line are harder to see than at start, "_" makes it worse by
- being a small sign, "" used in C preprocessor is better, but a symbol at
- the start of the next line to say it is a continuation of the previous
- lines would be easier to see.
- > I think that by now we should have learned that significant whitespace
- in a programming
- > language is mostly a mistake. Obviously people disagree, hence Python.
- The biggest problem with Python is that tab and normal space have the same
- meaning but different visual sizes, if tabs didn't exist there would be
- far less complains about Python, and, in my opinion, marking the end of a
- block is far more important than marking the end of a statement.
- By: Adrian ([email protected]), March 12, 2022 5:50 am
- Room: [25]Moderated Discussions
- Andrey ([email protected]) on March 12, 2022 3:57 am
- wrote:
- > Adrian ([email protected]) on March 12, 2022 1:41 am wrote:
- > > Andrey ([email protected]) on March 11, 2022 3:09
- pm wrote:
- > > > Anon ([email protected]) on March 11, 2022 1:33 pm wrote:
- > > > > Adrian ([email protected]) on March 11, 2022 12:45 pm wrote:
- > > > > > It also solves what I consider a serious defect in C/C++, having
- to use parentheses for the control
- > > > > > expressions of if/while/for/switch. The parentheses are needed
- only because the following braces are
- > > > > > optional. However in most cases you have to put braces anyway,
- but you still have to write the redundant
- > > > > > parentheses. The braces should have been mandatory and no
- parentheses should have been used.
- > > > >
- > > > > That's what Rust did, but the braces still annoys me because
- > > > > after the opening brace there is always a new line,
- > > > > I think, after a if, for or while a line break should be mandatory
- so we only need a block terminator.
- > > > > Oh, and the ";", terminating an expression at line break is far
- more common than continuing it.
- > > >
- > > > C/C++ are whitespace-neutral (and newline characters are
- whitespace), which
- > > > I consider a big advantage. Even if you maintain one expression per
- line, this
- > > > is still useful in macros, whether defined by you or system headers.
- > > >
- > >
- > >
- > > In 1965, CPL, the ancestor of C/C++, handled much better the issue of
- whitespace and statement termination.
- > >
- > > Any statement could be terminated by either a new line or
- > > a semicolon, except that a new line was not considered
- > > as a statement terminator when it occurred at a program point where a
- statement terminator is illegal.
- > > (the usefulness of the exception is debatable, it saves typing, but it
- might allow some bugs)
- > >
- > > The CPL rule combined the previous rules used by Algol 60 (semicolon)
- and
- > > Fortran (new line). The CPL rule has been inherited by the UNIX shell.
- > >
- > > When semicolon and new line are synonymous, that minimizes the need of
- typing terminators, while
- > > still allowing both for free formatting of the program text and for
- writing any kind of macros.
- >
- > This does not work in all contexts. For example:
- >
- > struct foo
- > {
- > int value;
- > }
- > object = {10};
- >
- > I'm fairly sure there are other contexts as well.
- >
- > There is also a matter of further language extensibility. New language
- constructs are easier to introduce
- > and teach when the syntax rules are simple and unambiguous. Granted,
- C/C++ syntax is not exactly simple
- > as it is, but introducing whitespace sensibility certainly doesn't make
- it simpler. An unconditional
- > rule "a statement or declaration ends with semicolon" is easier to learn
- and follow than "a statement
- > or declaration ends with semicolon or newline if X, Y or Z conditions
- are satisfied".
- >
- C has many syntactic quirks and making new line synonymous with semicolon
- in it will obviously not work without other changes.
- However in a clean syntax it is trivial to avoid any problems due to that.
- I have already said that the exception included in the CPL rule was
- probably an attempt to be too clever.
- When the simpler rule that semicolon and new line are synonymous (which
- also requires a character like backslash for line continuations) is used,
- that is simple enough in my opinion and it leads to programs that are
- easier to read and write.
- In general I agree that it is bad to depend on white space, but, like for
- anything else, the extreme variant is bad.
- During a half of century, millions of semicolons have been typed and they
- have added pointless visual noise to program texts, for what?
- To satisfy some fetish for the lack of significance of white space?
- Even this theory is wrong, because white space is significant in C as a
- separator, even if it does not matter what kind of white space that is.
- It cannot be said that the early languages, like Fortran, were more
- dependent on white space significance than C. While new line was
- distinguished from other white space by being a statement terminator, the
- other kinds of white space were ignored completely, so it did not matter
- at all where you inserted blanks in the program text, unlike in C, where
- it matters.
- Making the blank significant was good, because it simplified parsing, but
- making the new line insignificant was bad, by requiring lots of extra
- characters to be written and read without any advantage from this.
- By: Linus Torvalds ([email protected]), March 10,
- 2022 1:25 pm
- Room: [25]Moderated Discussions
- Adrian ([email protected]) on March 10, 2022 6:33 am wrote:
- >
- > I agree that failing to follow the traditional meaning of these
- operations is bad.
- Well, at least it's not IBM.
- The company where NIH was a way of life, and vowels were an enemy to be
- defeated.
- Bit 0 is the left-most (ie most significant) bit, of course, so it means
- different things depending on context (ie when loading a word from memory
- "bit 0 of the loaded word" means the high bit of the word, and is loaded
- into bit 32 of the 64-bit register, with bits 0:31 being filled with a
- copy of it).
- "I'm not wrong - it's the rest of the world that is confused" is an IBM
- motto.
- W u mny ltrs whn f d th trck?
- Linus
- By: Ian Ameline ([email protected]), March 10, 2022 3:34 pm
- Room: [25]Moderated Discussions
- Linus Torvalds ([email protected]) on March 10,
- 2022 12:25 pm wrote:
- > Adrian ([email protected]) on March 10, 2022 6:33 am wrote:
- > >
- > > I agree that failing to follow the traditional meaning of these
- operations is bad.
- >
- > Well, at least it's not IBM.
- >
- > The company where NIH was a way of life, and vowels were an enemy to be
- defeated.
- >
- > Bit 0 is the left-most (ie most significant) bit, of course, so it means
- different things depending on
- > context (ie when loading a word from memory "bit 0 of the loaded word"
- means the high bit of the word,
- > and is loaded into bit 32 of the 64-bit register, with bits 0:31 being
- filled with a copy of it).
- >
- > "I'm not wrong - it's the rest of the world that is confused" is an IBM
- motto.
- >
- > W u mny ltrs whn f d th trck?
- >
- > Linus
- When I worked at IBM on compilers (x86 optimizing back-end), there was one
- very senior compiler code generation guru (who shall remain nameless) who
- used to frequently ( and loudly) say that someone was "full of shit" if he
- or she disagreed with his positions. Eventually HR got involved and
- suggested he use the term "confused" instead of "full of shit". From then
- on everyone used "confused", and everyone knew it meant "full of shit".
- :-) So whenever I hear someone from IBM (especially the research division)
- use the term "confused", I know what they really mean. :-)
- By: gallier2 ([email protected]), March 11, 2022 12:42 am
- Room: [25]Moderated Discussions
- Linus Torvalds ([email protected]) on March 10,
- 2022 12:25 pm wrote:
- > Adrian ([email protected]) on March 10, 2022 6:33 am wrote:
- > >
- > > I agree that failing to follow the traditional meaning of these
- operations is bad.
- >
- > Well, at least it's not IBM.
- >
- > The company where NIH was a way of life, and vowels were an enemy to be
- defeated.
- >
- > Bit 0 is the left-most (ie most significant) bit, of course, so it means
- different things depending on
- > context (ie when loading a word from memory "bit 0 of the loaded word"
- means the high bit of the word,
- > and is loaded into bit 32 of the 64-bit register, with bits 0:31 being
- filled with a copy of it).
- Texas Instruments also has the Bit0 as highest bit, which is really a
- stupid convention as depending on the bus width can designate completely
- different lines (see TI-99/4A documentation).
- >
- > "I'm not wrong - it's the rest of the world that is confused" is an IBM
- motto.
- >
- > W u mny ltrs whn f d th trck?
- >
- > Linus
- By: konrad.schwarz ([email protected]), March 11, 2022 5:26 am
- Room: [25]Moderated Discussions
- Linus Torvalds ([email protected]) on March 10,
- 2022 12:25 pm wrote:
- > Bit 0 is the left-most (ie most significant) bit, of course, so it means
- different things depending on
- > context (ie when loading a word from memory "bit 0 of the loaded word"
- means the high bit of the word,
- > and is loaded into bit 32 of the 64-bit register, with bits 0:31 being
- filled with a copy of it).
- The IBM bit-numbering convention is logically consistent with big-endian
- addressing
- of multi-byte integers.
- A big-endian machine places the most-significant byte (or minimal
- addressable storage unit)
- at offset 0 from the start of the word, with consecutively less
- significant digits
- placed in successively higher offsets.
- The same rule is applied to bits.
- Mathematically, this is the difference between denoting a fixed length
- polynomial as
- n i n (n - i)
- sum a x vs. sum a x
- i = 0 i i = 0 i
- and I've seen mathematicians use the second notation. It in fact
- matches western numerical conventions (most significant digits come first
- when reading from left to right).
- The disadvantage of big-endian is that you have to know n beforehand;
- accessing a variable with incorrect size will lead to completely
- false results, whereas if the values taken by the variable happen
- to require fewer words than allocated, little endian machines
- will still see the correct values.
- The advantage of big-endian is that memory dumps are much easier
- to scan & decipher for humans trained to use western numbers.
- By: konrad.schwarz ([email protected]), March 11, 2022 5:31 am
- Room: [25]Moderated Discussions
- Improved ASCII math:
- n i n (n - i)
- sum a x vs. sum a x
- i = 0 i i = 0 i
- By: Adrian ([email protected]), March 11, 2022 6:25 am
- Room: [25]Moderated Discussions
- konrad.schwarz ([email protected]) on March 11, 2022 4:26 am
- wrote:
- > Linus Torvalds ([email protected]) on March 10,
- 2022 12:25 pm wrote:
- > > Bit 0 is the left-most (ie most significant) bit, of course, so it
- means different things depending on
- > > context (ie when loading a word from memory "bit 0 of the loaded word"
- means the high bit of the word,
- > > and is loaded into bit 32 of the 64-bit register, with bits 0:31 being
- filled with a copy of it).
- >
- > The IBM bit-numbering convention is logically consistent with big-endian
- addressing
- > of multi-byte integers.
- >
- > A big-endian machine places the most-significant byte (or minimal
- addressable storage unit)
- > at offset 0 from the start of the word, with consecutively less
- significant digits
- > placed in successively higher offsets.
- >
- > The same rule is applied to bits.
- >
- > Mathematically, this is the difference between denoting a fixed length
- polynomial as
- >
- > n i n (n - i)
- > sum a x vs. sum a x
- > i = 0 i i = 0 i
- >
- > and I've seen mathematicians use the second notation. It in fact
- > matches western numerical conventions (most significant digits come
- first
- > when reading from left to right).
- >
- > The disadvantage of big-endian is that you have to know n beforehand;
- > accessing a variable with incorrect size will lead to completely
- > false results, whereas if the values taken by the variable happen
- > to require fewer words than allocated, little endian machines
- > will still see the correct values.
- >
- > The advantage of big-endian is that memory dumps are much easier
- > to scan & decipher for humans trained to use western numbers.
- Yes, even if I consider little-endian as more convenient, I have always
- appreciated IBM for being consistently big-endian.
- I believe that the worst are the CPU architectures that are big-endian,
- but which number the bits in reverse order, with bit 0 as the LSB (e.g.
- Motorola).
- By: cqwrteur ([email protected]), March 11, 2022 12:57 pm
- Room: [25]Moderated Discussions
- Adrian ([email protected]) on March 11, 2022 5:25 am wrote:
- > konrad.schwarz ([email protected]) on March 11, 2022 4:26 am
- wrote:
- > > Linus Torvalds ([email protected]) on March
- 10, 2022 12:25 pm wrote:
- > > > Bit 0 is the left-most (ie most significant) bit, of course, so it
- means different things depending on
- > > > context (ie when loading a word from memory "bit 0 of the loaded
- word" means the high bit of the word,
- > > > and is loaded into bit 32 of the 64-bit register, with bits 0:31
- being filled with a copy of it).
- > >
- > > The IBM bit-numbering convention is logically consistent with
- big-endian addressing
- > > of multi-byte integers.
- > >
- > > A big-endian machine places the most-significant byte (or minimal
- addressable storage unit)
- > > at offset 0 from the start of the word, with consecutively less
- significant digits
- > > placed in successively higher offsets.
- > >
- > > The same rule is applied to bits.
- > >
- > > Mathematically, this is the difference between denoting a fixed length
- polynomial as
- > >
- > > n i n (n - i)
- > > sum a x vs. sum a x
- > > i = 0 i i = 0 i
- > >
- > > and I've seen mathematicians use the second notation. It in fact
- > > matches western numerical conventions (most significant digits come
- first
- > > when reading from left to right).
- > >
- > > The disadvantage of big-endian is that you have to know n beforehand;
- > > accessing a variable with incorrect size will lead to completely
- > > false results, whereas if the values taken by the variable happen
- > > to require fewer words than allocated, little endian machines
- > > will still see the correct values.
- > >
- > > The advantage of big-endian is that memory dumps are much easier
- > > to scan & decipher for humans trained to use western numbers.
- >
- >
- > Yes, even if I consider little-endian as more convenient, I have
- > always appreciated IBM for being consistently big-endian.
- >
- > I believe that the worst are the CPU architectures that are big-endian,
- but which
- > number the bits in reverse order, with bit 0 as the LSB (e.g. Motorola).
- >
- >
- >
- >
- >
- >
- LOL. This forum complains about Risc-V being madness when rust is a truly
- garbage which is 10000000000000x worse than Risc-v with CVE plagued.
- HAHA. what a bunch of hypocrite. Probably C and C++ violate human rights?
- By: Linus Torvalds ([email protected]), March 11,
- 2022 1:28 pm
- Room: [25]Moderated Discussions
- konrad.schwarz ([email protected]) on March 11, 2022 4:26 am
- wrote:
- >
- > The IBM bit-numbering convention is logically consistent with big-endian
- addressing
- > of multi-byte integers.
- It's actually not.
- It's only consistent in documentation.
- When you write out special register bits, and you do the usual arabic
- numeral-inspired ordering, then numbering 0 at the left makes sense.
- But then when actually writing code and running code, suddenly the bit
- ordering doesn't make any sense at all when you start shifting bits
- around. Not in memory, and not in registers.
- Starting at MSB doesn't make sense in an ALU either. Arguably the most
- fundamental of all operations - add - goes from LSB to MSB.
- It's not just that "least significant bit is well-defined from an
- addressing standpoint" (both in memory and in registers and in the ALU),
- but it's also that small integers are way more fundamental than large
- ones. Even IBM makes it easier to add by 1, than to add by the MSB. And
- that's despite the architecture having special instructions to generate
- bitmasks.
- There's a reason C people use "1 << shift" to generate bitmasks. And no,
- that reason is not "it's a C idiom". It's deeper than that. It goes to the
- whole fundamental issue of "1" being a very very special number (not just
- in computers, in mathematics).
- You can argue that big-endian byte ordering is dying out due to market
- pressure. But big-endian bit ordering is just fundamentally wrong.
- (I will also argue that big-endian byte ordering is also inferior, and it
- wasn't just market forces, but that argument is decades old and nobody
- ever won it apart from a "the market decided". But I think that
- "big-endian bit ordering doesn't make sense" is actually part of the whole
- "big-endian byte ordering was a failure").
- And yes, arabic numerals positioning system is odd too. And no, "Arabic is
- written right-to-left" doesn't explain it either, since it came from
- India. But you can see the numeral order oddities when you line up numbers
- (right-justified, because LSB is fundamentally more important), and in
- various languages too (ie "five and twenty" in German, or even "fifteen"
- in English).
- Big-endian: just say no.
- Linus
- By: hobold ([email protected]), March 11, 2022 5:29 pm
- Room: [25]Moderated Discussions
- Linus Torvalds ([email protected]) on March 11,
- 2022 12:28 pm wrote:
- [...]
- > And no, "Arabic is written right-to-left"
- > doesn't explain it either, since it came from India.
- It does explain some of the confusion. Decimal integers kind of have an
- invisible/implied decimal point next to their least significant digit,
- which anchors the positional scale factor of each digit. That anchor is
- usually to the right of the decimal integer (in English and other European
- languages).
- If the number in question is a decimal fraction however, then the integral
- part and the fractional part are both anchored at the decimal point, and
- kind of have different reading directions.
- The few languages I know (all closely related of the Indo-European family)
- acknowledge this by using redundant words like "million", "thousand", etc.
- to give additional positional landmarks when speaking integer numbers (or
- the integral part) from left to right, but only list digits when speaking
- the fractional part (from left to right) after the decimal point. That is,
- when the direction of text and the direction of numbers happen to both
- align to what the speaker is used to, then no redundancy is required for
- clarification.
- If you store a short ASCII string in a multibyte register, then the
- reading direction of a little endian integer value is different from the
- reading direction of a text string.
- In other words, if we all used scientific notation of numbers all the
- time, then big endian would look as if it were the "natural" byte order
- wherever European languages dominate. Except for the integral exponent
- when it is larger than a single byte. :-)
- By: RIIR ([email protected]), March 11, 2022 8:19 pm
- Room: [25]Moderated Discussions
- hobold ([email protected]) on March 11, 2022 4:29 pm
- wrote:
- > Linus Torvalds ([email protected]) on March 11,
- 2022 12:28 pm wrote:
- > [...]
- > > And no, "Arabic is written right-to-left"
- > > doesn't explain it either, since it came from India.
- >
- > It does explain some of the confusion. Decimal integers kind of have an
- invisible/implied decimal point
- > next to their least significant digit, which anchors the positional
- scale factor of each digit. That
- > anchor is usually to the right of the decimal integer (in English and
- other European languages).
- >
- > If the number in question is a decimal fraction however, then the
- integral part and the fractional
- > part are both anchored at the decimal point, and kind of have different
- reading directions.
- >
- > The few languages I know (all closely related of the Indo-European
- family) acknowledge this by using redundant
- > words like "million", "thousand", etc. to give additional positional
- landmarks when speaking integer numbers
- > (or the integral part) from left to right, but only list digits when
- speaking the fractional part (from left
- > to right) after the decimal point. That is, when the direction of text
- and the direction of numbers happen
- > to both align to what the speaker is used to, then no redundancy is
- required for clarification.
- >
- > If you store a short ASCII string in a multibyte register, then the
- reading direction of
- > a little endian integer value is different from the reading direction of
- a text string.
- >
- > In other words, if we all used scientific notation of numbers all the
- time, then big
- > endian would look as if it were the "natural" byte order wherever
- European languages
- > dominate. Except for the integral exponent when it is larger than a
- single byte. :-)
- C and C++ violate human rights. Deal with it.
- Rewrite Linux kernel in Rust.
- RIIR
- By: anonymou5 ([email protected]), March 12, 2022 2:48 am
- Room: [25]Moderated Discussions
- RIIR ([email protected]) on March 11, 2022 7:19 pm wrote:
- > C and C++ violate human rights. Deal with it.
- >
- > Rewrite Linux kernel in Rust.
- when supergluing your hands to your keyboard in protest, don't inhale the
- fumes ;-)
- By: Konrad Schwarz ([email protected]), March 12, 2022 2:31 am
- Room: [25]Moderated Discussions
- Linus Torvalds ([email protected]) on March 11,
- 2022 12:28 pm wrote:
- > konrad.schwarz ([email protected]) on March 11, 2022 4:26 am
- wrote:
- > >
- > > The IBM bit-numbering convention is logically consistent with
- big-endian addressing
- > > of multi-byte integers.
- >
- > It's actually not.
- >
- > It's only consistent in documentation.
- >
- > When you write out special register bits, and you do the usual arabic
- > numeral-inspired ordering, then numbering 0 at the left makes sense.
- >
- > But then when actually writing code and running code, suddenly the bit
- ordering doesn't make
- > any sense at all when you start shifting bits around. Not in memory, and
- not in registers.
- It's unfortunate that my ASCII math drawing came out so poorly in HTML.
- The key point is that in the big-endian notation for the polynomial,
- the coefficient has index i, whereas the exponent has the value (n - i).
- To work in a big-endian system, you have to know the size of the integer
- beforehand.
- Of course, you ultimately have to know this in a little-endian system too,
- so
- this is not a fundamental disadvantage of a big-endian system.
- In practice, to make documentation and code match, in a big-endian
- system, you need to introduce a macro that converts documented
- bit number `i' into shift-width `(n - i)'.
- > Starting at MSB doesn't make sense in an ALU either. Arguably the
- > most fundamental of all operations - add - goes from LSB to MSB.
- >
- > It's not just that "least significant bit is well-defined from an
- addressing standpoint" (both
- > in memory and in registers and in the ALU), but it's also that small
- integers are way more
- > fundamental than large ones. Even IBM makes it easier to add by 1, than
- to add by the MSB.
- > And that's despite the architecture having special instructions to
- generate bitmasks.
- This completely irrelevant to the numbering convention used to identify
- digits.
- > There's a reason C people use "1 of "1" being a very very special number
- (not just in computers, in mathematics).
- I realize of course that on a RISC-style machine the size of literals
- is limited and that smaller literals can often be more compactly encoded.
- However, numbering the most significant bit `zero' doesn't actually
- change any of the values used, except if the hardware designer happens
- to fill hardware registers from the most significant bit downwards;
- and even then, the literals available to shift instructions encompass
- the word size in bits -- but immediate fields for boolean instructions
- are not so lucky.
- By: rwessel ([email protected]), March 12, 2022 7:04 am
- Room: [25]Moderated Discussions
- Konrad Schwarz ([email protected]) on March 12, 2022 1:31 am
- wrote:
- > Linus Torvalds ([email protected]) on March 11,
- 2022 12:28 pm wrote:
- > > konrad.schwarz ([email protected]) on March 11, 2022 4:26 am
- wrote:
- > > >
- > > > The IBM bit-numbering convention is logically consistent with
- big-endian addressing
- > > > of multi-byte integers.
- > >
- > > It's actually not.
- > >
- > > It's only consistent in documentation.
- > >
- > > When you write out special register bits, and you do the usual arabic
- > > numeral-inspired ordering, then numbering 0 at the left makes sense.
- > >
- > > But then when actually writing code and running code, suddenly the bit
- ordering doesn't make
- > > any sense at all when you start shifting bits around. Not in memory,
- and not in registers.
- >
- > It's unfortunate that my ASCII math drawing came out so poorly in HTML.
- > The key point is that in the big-endian notation for the polynomial,
- > the coefficient has index i, whereas the exponent has the value (n - i).
- >
- > To work in a big-endian system, you have to know the size of the integer
- beforehand.
- >
- > Of course, you ultimately have to know this in a little-endian system
- too, so
- > this is not a fundamental disadvantage of a big-endian system.
- >
- > In practice, to make documentation and code match, in a big-endian
- > system, you need to introduce a macro that converts documented
- > bit number `i' into shift-width `(n - i)'.
- >
- > > Starting at MSB doesn't make sense in an ALU either. Arguably the
- > > most fundamental of all operations - add - goes from LSB to MSB.
- > >
- > > It's not just that "least significant bit is well-defined from an
- addressing standpoint" (both
- > > in memory and in registers and in the ALU), but it's also that small
- integers are way more
- > > fundamental than large ones. Even IBM makes it easier to add by 1,
- than to add by the MSB.
- > > And that's despite the architecture having special instructions to
- generate bitmasks.
- >
- > This completely irrelevant to the numbering convention used to identify
- digits.
- >
- > > There's a reason C people use "1 of "1" being a very very
- > > special number (not just in computers, in mathematics).
- >
- > I realize of course that on a RISC-style machine the size of literals
- > is limited and that smaller literals can often be more compactly
- encoded.
- >
- > However, numbering the most significant bit `zero' doesn't actually
- > change any of the values used, except if the hardware designer happens
- > to fill hardware registers from the most significant bit downwards;
- > and even then, the literals available to shift instructions encompass
- > the word size in bits -- but immediate fields for boolean instructions
- > are not so lucky.
- On Z there are a few (new-ish) bit manipulation instructions that expose
- the nominal bit order*, at least to an extent. Arguably some of the vector
- instructions do as well, when addressing individual elements of the
- vectors.
- In some cases that's only a definitional matter - Find Leftmost One is
- defined to return the bit position of the first one bit - which happens to
- be exactly the same value as returned by (say) x86 count-leading-zeros.
- But for the most part, it's not really visible (obviously the overall
- big-endian architecture is, but the bit number, not so much).
- *For example, in Rotate Then Insert Selected Bits the fourth and fifth
- operands specify the starting and ending bit position to copy from the
- second to first operand after the rotation of the first operand as
- specified by the third operand.
- By: dmcq ([email protected]), March 12, 2022 12:18 pm
- Room: [25]Moderated Discussions
- Linus Torvalds ([email protected]) on March 11,
- 2022 12:28 pm wrote:
- > konrad.schwarz ([email protected]) on March 11, 2022 4:26 am
- wrote:
- > >
- > > The IBM bit-numbering convention is logically consistent with
- big-endian addressing
- > > of multi-byte integers.
- >
- > It's actually not.
- >
- > It's only consistent in documentation.
- >
- > When you write out special register bits, and you do the usual arabic
- > numeral-inspired ordering, then numbering 0 at the left makes sense.
- >
- > But then when actually writing code and running code, suddenly the bit
- ordering doesn't make
- > any sense at all when you start shifting bits around. Not in memory, and
- not in registers.
- >
- > Starting at MSB doesn't make sense in an ALU either. Arguably the
- > most fundamental of all operations - add - goes from LSB to MSB.
- >
- > It's not just that "least significant bit is well-defined from an
- addressing standpoint" (both
- > in memory and in registers and in the ALU), but it's also that small
- integers are way more
- > fundamental than large ones. Even IBM makes it easier to add by 1, than
- to add by the MSB.
- > And that's despite the architecture having special instructions to
- generate bitmasks.
- >
- > There's a reason C people use "1 < is not "it's a C idiom". It's deeper
- than that. It goes to the whole fundamental issue
- > of "1" being a very very special number (not just in computers, in
- mathematics).
- >
- > You can argue that big-endian byte ordering is dying out due to market
- > pressure. But big-endian bit ordering is just fundamentally wrong.
- >
- > (I will also argue that big-endian byte ordering is also inferior, and
- it wasn't just market forces, but that
- > argument is decades old and nobody ever won it apart from a "the market
- decided". But I think that "big-endian
- > bit ordering doesn't make sense" is actually part of the whole
- "big-endian byte ordering was a failure").
- >
- > And yes, arabic numerals positioning system is odd too. And no, "Arabic
- is written right-to-left"
- > doesn't explain it either, since it came from India. But you can see the
- numeral order oddities
- > when you line up numbers (right-justified, because LSB is fundamentally
- more important), and in
- > various languages too (ie "five and twenty" in German, or even "fifteen"
- in English).
- >
- > Big-endian: just say no.
- >
- > Linus
- I've done quite a bit of IBM assembler amongst others, and I never felt
- any problem with their documentation. It's the one's that list ascending
- bytes or words from left to right but number the bits right to left that
- annoy me.
- By: ** ([email protected]), March 12, 2022 2:20 pm
- Room: [25]Moderated Discussions
- Linus Torvalds ([email protected]) on March 11,
- 2022 12:28 pm wrote:
- > konrad.schwarz ([email protected]) on March 11, 2022 4:26 am
- wrote:
- > >
- > > The IBM bit-numbering convention is logically consistent with
- big-endian addressing
- > > of multi-byte integers.
- >
- > It's actually not.
- >
- > It's only consistent in documentation.
- >
- > When you write out special register bits, and you do the usual arabic
- > numeral-inspired ordering, then numbering 0 at the left makes sense.
- >
- > But then when actually writing code and running code, suddenly the bit
- ordering doesn't make
- > any sense at all when you start shifting bits around. Not in memory, and
- not in registers.
- >
- > Starting at MSB doesn't make sense in an ALU either. Arguably the
- > most fundamental of all operations - add - goes from LSB to MSB.
- >
- > It's not just that "least significant bit is well-defined from an
- addressing standpoint" (both
- > in memory and in registers and in the ALU), but it's also that small
- integers are way more
- > fundamental than large ones. Even IBM makes it easier to add by 1, than
- to add by the MSB.
- > And that's despite the architecture having special instructions to
- generate bitmasks.
- >
- > There's a reason C people use "1 of "1" being a very very special number
- (not just in computers, in mathematics).
- >
- > You can argue that big-endian byte ordering is dying out due to market
- > pressure. But big-endian bit ordering is just fundamentally wrong.
- >
- > (I will also argue that big-endian byte ordering is also inferior, and
- it wasn't just market forces, but that
- > argument is decades old and nobody ever won it apart from a "the market
- decided". But I think that "big-endian
- > bit ordering doesn't make sense" is actually part of the whole
- "big-endian byte ordering was a failure").
- >
- > And yes, arabic numerals positioning system is odd too. And no, "Arabic
- is written right-to-left"
- > doesn't explain it either, since it came from India. But you can see the
- numeral order oddities
- > when you line up numbers (right-justified, because LSB is fundamentally
- more important), and in
- > various languages too (ie "five and twenty" in German, or even "fifteen"
- in English).
- >
- > Big-endian: just say no.
- >
- > Linus
- I guess, the above text is just another attempt to "rant" against
- something, without touching what is fundamental.
- Any ordering (any permutation) of bits inside of an 8-bit byte (including
- a predefined/static random ordering) is OK as long as the machine
- instruction is a single-cycle instruction. This includes ADD, SUB, CMP,
- MOV, SHL and SHR instructions.
- Bit-order and byte-order only matters for multi-cycle instructions.
- Obviously, it matters for arbitrary-precision numbers.
- A single-cycle machine instruction does not care about bit-order neither
- about byte-order as long as the number of bits (the width of the
- instruction's operands) is a constant/fixed quantity that is known in
- advance and as long as the positions of bits and bytes in the operands are
- known in advance.
- The bit-order and byte-order of numbers not larger than 64 bit (that is:
- int8_t, uint32_t, etc) is only helping the people reading, writing,
- manipulating the numbers or working with the numbers (that is:
- programmers, CPU designers, etc) - it doesn't matter to the machine.
- For example, a CPU's physical register file could, in principle, be using
- any particular random bit order (any permutation of bit positions inside
- of a byte, any permutation of bytes inside of a word).
- ----
- Secondly, the subject that seems to be completely escaping your attention
- is that the profitability/fitness/usefulness of a bit ordering is,
- intuitively, very closely tied to compressibility: the more the data is
- compressed, the less a particular bit ordering matters.
- -atom
- By: Heikki Kultala ([email protected]), March 13, 2022
- 12:28 am
- Room: [25]Moderated Discussions
- ** ([email protected]) on March 12, 2022 1:20 pm wrote:
- > Linus Torvalds ([email protected]) on March 11,
- 2022 12:28 pm wrote:
- > > konrad.schwarz ([email protected]) on March 11, 2022 4:26 am
- wrote:
- > > >
- > > > The IBM bit-numbering convention is logically consistent with
- big-endian addressing
- > > > of multi-byte integers.
- > >
- > > It's actually not.
- > >
- > > It's only consistent in documentation.
- > >
- > > When you write out special register bits, and you do the usual arabic
- > > numeral-inspired ordering, then numbering 0 at the left makes sense.
- > >
- > > But then when actually writing code and running code, suddenly the bit
- ordering doesn't make
- > > any sense at all when you start shifting bits around. Not in memory,
- and not in registers.
- > >
- > > Starting at MSB doesn't make sense in an ALU either. Arguably the
- > > most fundamental of all operations - add - goes from LSB to MSB.
- > >
- > > It's not just that "least significant bit is well-defined from an
- addressing standpoint" (both
- > > in memory and in registers and in the ALU), but it's also that small
- integers are way more
- > > fundamental than large ones. Even IBM makes it easier to add by 1,
- than to add by the MSB.
- > > And that's despite the architecture having special instructions to
- generate bitmasks.
- > >
- > > There's a reason C people use "1 of "1" being a very very
- > > special number (not just in computers, in mathematics).
- > >
- > > You can argue that big-endian byte ordering is dying out due to market
- > > pressure. But big-endian bit ordering is just fundamentally wrong.
- > >
- > > (I will also argue that big-endian byte ordering is also
- > > inferior, and it wasn't just market forces, but that
- > > argument is decades old and nobody ever won it apart from
- > > a "the market decided". But I think that "big-endian
- > > bit ordering doesn't make sense" is actually part of the whole
- "big-endian byte ordering was a failure").
- > >
- > > And yes, arabic numerals positioning system is odd too. And no,
- "Arabic is written right-to-left"
- > > doesn't explain it either, since it came from India. But you can see
- the numeral order oddities
- > > when you line up numbers (right-justified, because LSB is
- fundamentally more important), and in
- > > various languages too (ie "five and twenty" in German, or even
- "fifteen" in English).
- > >
- > > Big-endian: just say no.
- > >
- > > Linus
- >
- > I guess, the above text is just another attempt to "rant"
- > against something, without touching what is fundamental.
- >
- > Any ordering (any permutation) of bits inside of an 8-bit byte
- (including a predefined/static
- > random ordering) is OK as long as the machine instruction is a
- single-cycle instruction.
- > This includes ADD, SUB, CMP, MOV, SHL and SHR instructions.
- >
- > Bit-order and byte-order only matters for multi-cycle instructions.
- > Obviously, it matters for arbitrary-precision numbers.
- This is the most clueless claim in this forum during this year.
- Instruction set is an abstraction which should not care about how many
- cycles are spent for execution of an instruction.
- > A single-cycle machine instruction does not care about bit-order neither
- about byte-order as long as
- > the number of bits (the width of the instruction's operands) is a
- constant/fixed quantity that is known
- > in advance and as long as the positions of bits and bytes in the
- operands are known in advance.
- .. which is an insanely stupid assumption.
- Generic memcpy routines are used to copy ALL DATA TYPES.
- Same file IO load/store routines are used for ALL DATA TYPES
- etc.
- By: Joern Engel ([email protected]), March 13, 2022 12:08
- am
- Room: [25]Moderated Discussions
- Linus Torvalds ([email protected]) on March 11,
- 2022 12:28 pm wrote:
- > and in
- > various languages too (ie "five and twenty" in German, or even "fifteen"
- in English).
- Actually, some older English books use the German order as well. It
- appears as if most European languages were confused on that issue and it
- is a relatively recent development that most languages use big-endian
- order and base-10. Mostly. German is pdp-endian or something similar and
- French with "four-score ten and seven" is just weird. Official French at
- least, some dialects are less weird.
- > Big-endian: just say no.
- Should we use numbers like "five and twenty and three hundred and four
- thousand" now? It would be consistent. ;)
- By: Heikki Kultala ([email protected]), March 13, 2022
- 12:31 am
- Room: [25]Moderated Discussions
- Joern Engel ([email protected]) on March 12, 2022 11:08 pm
- wrote:
- > Linus Torvalds ([email protected]) on March 11,
- 2022 12:28 pm wrote:
- > > and in
- > > various languages too (ie "five and twenty" in German, or even
- "fifteen" in English).
- >
- > Actually, some older English books use the German order as well. It
- appears as if most European languages
- > were confused on that issue and it is a relatively recent development
- that most languages use big-endian
- > order and base-10. Mostly. German is pdp-endian or something similar and
- French with "four-score
- > ten and seven" is just weird. Official French at least, some dialects
- are less weird.
- >
- > > Big-endian: just say no.
- >
- > Should we use numbers like "five and twenty and three hundred
- > and four thousand" now? It would be consistent. ;)
- No need to say those tens , hundreds and thousands when using little
- endian. Can just say only those digits.
- The need to say those is big endian overhead crap.
- By: Anne O. Nymous ([email protected]), March 13, 2022 3:40 am
- Room: [25]Moderated Discussions
- Heikki Kultala ([email protected]) on March 12, 2022
- 11:31 pm wrote:
- > Joern Engel ([email protected]) on March 12, 2022 11:08
- pm wrote:
- > > Linus Torvalds ([email protected]) on March
- 11, 2022 12:28 pm wrote:
- > > > and in
- > > > various languages too (ie "five and twenty" in German, or even
- "fifteen" in English).
- > >
- > > Actually, some older English books use the German order as well. It
- appears as if most European languages
- > > were confused on that issue and it is a relatively recent development
- that most languages use big-endian
- > > order and base-10. Mostly. German is pdp-endian or something similar
- and French with "four-score
- > > ten and seven" is just weird. Official French at least, some dialects
- are less weird.
- > >
- > > > Big-endian: just say no.
- > >
- > > Should we use numbers like "five and twenty and three hundred
- > > and four thousand" now? It would be consistent. ;)
- >
- > No need to say those tens , hundreds and thousands when using little
- endian. Can just say only those digits.
- >
- > The need to say those is big endian overhead crap.
- >
- Not tp derail the discussion, there are quite some uses of numbers where
- order of magnitude is more important than individual positions, so people
- can and will ignore the fine-detail after getting an idea about the order
- of magnitude...
- From a german perspective the Einer vor Zehner inversion is mostly mildly
- weird in transcribing numbers from dictation as you need to wait for the
- zehner before entering/writing the number. My take is that is a left-over
- from a time when numbers were hard and numbers above 10 rarely used, but
- that is based on thin air and a vivid imagination, no science involved ;)
- By: dmcq ([email protected]), March 13, 2022 2:30 pm
- Room: [25]Moderated Discussions
- Heikki Kultala ([email protected]) on March 13, 2022
- 12:31 am wrote:
- > Joern Engel ([email protected]) on March 12, 2022 11:08
- pm wrote:
- > > Linus Torvalds ([email protected]) on March
- 11, 2022 12:28 pm wrote:
- > > > and in
- > > > various languages too (ie "five and twenty" in German, or even
- "fifteen" in English).
- > >
- > > Actually, some older English books use the German order as well. It
- appears as if most European languages
- > > were confused on that issue and it is a relatively recent development
- that most languages use big-endian
- > > order and base-10. Mostly. German is pdp-endian or something similar
- and French with "four-score
- > > ten and seven" is just weird. Official French at least, some dialects
- are less weird.
- > >
- > > > Big-endian: just say no.
- > >
- > > Should we use numbers like "five and twenty and three hundred
- > > and four thousand" now? It would be consistent. ;)
- >
- > No need to say those tens , hundreds and thousands when using little
- endian. Can just say only those digits.
- >
- > The need to say those is big endian overhead crap.
- It makes very little difference what order they are said in sayin 5723 as
- five seven two three or three two seven five are just as informative - or
- uninformative. If one is just interested in the highest two digits and the
- exponent you have to remember an then forget the digits and count the
- number of digits at the same time in little endian mode. In big endian
- mode you get the digits immediately and can then count how mant digits
- follow. Saying hundreds or thousands gets rid of a lot of potential
- errors.
- By: gallier2 ([email protected]), March 14, 2022 8:09 am
- Room: [25]Moderated Discussions
- Joern Engel ([email protected]) on March 13, 2022 12:08 am
- wrote:
- > Linus Torvalds ([email protected]) on March 11,
- 2022 12:28 pm wrote:
- > > and in
- > > various languages too (ie "five and twenty" in German, or even
- "fifteen" in English).
- >
- > Actually, some older English books use the German order as well. It
- appears as if most European languages
- > were confused on that issue and it is a relatively recent development
- that most languages use big-endian
- > order and base-10. Mostly. German is pdp-endian or something similar and
- French with "four-score
- > ten and seven" is just weird. Official French at least, some dialects
- are less weird.
- Blame the Celts, they were the folks counting to twenty. They were
- probably barefoot when they learnt to count. At least leave us the few
- Gallic heritage there is in French.
- >
- > > Big-endian: just say no.
- >
- > Should we use numbers like "five and twenty and three hundred
- > and four thousand" now? It would be consistent. ;)
- By: -.- ([email protected]), March 10, 2022 9:00 pm
- Room: [25]Moderated Discussions
- Heikki Kultala ([email protected]) on March 9, 2022
- 10:31 pm wrote:
- > In common terminology:
- > Conditional move means 3-operand instruction (input, condition, result)
- > Select means 4-operand instruction (Input1, input2, select, result)
- So what would you call a non-destructive 'conditional move'?
- Or if your ISA doesn't support 4-operand instructions, what would a
- 3-operand 'select' be?
- > Gather means vector load from memory with vector addressing.
- So what about a register gather?
- > Shuffle means reordering of data inside the vector registers.
- ARM calls it a 'Table vector lookup'.
- x86 uses both 'shuffle' and 'permute' to describe the operation (even with
- some references to 'index'/'table', e.g. VPERMT2B vs VPERMI2B)
- The one thing certain about software engineering is that no-one can truly
- agree on correct terminology.
- Having said that, I do prefer 'shuffle' and use that myself (and I think
- it's more widely adopted), but there doesn't seem to be a complete
- consensus of its appropriate naming.
- By: Anon ([email protected]), March 10, 2022 9:42 pm
- Room: [25]Moderated Discussions
- -.- ([email protected]) on March 10, 2022 8:00 pm wrote:
- > So what would you call a non-destructive 'conditional move'?
- select
- > Or if your ISA doesn't support 4-operand instructions, what would a
- 3-operand 'select' be?
- cmov
- > So what about a register gather?
- permute
- By: Heikki Kultala ([email protected]), March 10,
- 2022 10:59 pm
- Room: [25]Moderated Discussions
- -.- ([email protected]) on March 10, 2022 8:00 pm wrote:
- > Heikki Kultala ([email protected]) on March 9, 2022
- 10:31 pm wrote:
- > > In common terminology:
- > > Conditional move means 3-operand instruction (input, condition,
- result)
- > > Select means 4-operand instruction (Input1, input2, select, result)
- >
- > So what would you call a non-destructive 'conditional move'?
- select
- > Or if your ISA doesn't support 4-operand instructions, what would a
- 3-operand 'select' be?
- cmov
- > > Gather means vector load from memory with vector addressing.
- >
- > So what about a register gather?
- permute or shuffle
- > The one thing certain about software engineering is that no-one can
- truly agree on correct terminology.
- >
- > Having said that, I do prefer 'shuffle' and use that myself (and I think
- it's more widely
- > adopted), but there doesn't seem to be a complete consensus of its
- appropriate naming.
- That there is multiple terms for same thing is not a problem. The terms
- still always means the same thing.
- That same term is used for DIFFERENT thins is a problem. That adds
- confusion. And that's what RISC-V guys are doing.
- By: -.- ([email protected]), March 11, 2022 1:21 am
- Room: [25]Moderated Discussions
- Heikki Kultala ([email protected]) on March 10, 2022
- 9:59 pm wrote:
- > > So what would you call a non-destructive 'conditional move'?
- >
- > select
- >
- > > Or if your ISA doesn't support 4-operand instructions, what would a
- 3-operand 'select' be?
- >
- > cmov
- Ah, so you'd prefer to give instructions different names depending on if
- they're destructive or not.
- So what would you name a constructive add?
- A destructive add?
- Let me guess: add and accumulate?
- How about constructive and destructive multiply?
- > That there is multiple terms for same thing is not a problem. The terms
- still always means the same thing.
- >
- > That same term is used for DIFFERENT thins is a problem. That
- > adds confusion. And that's what RISC-V guys are doing.
- Well, we're doing a gather, but instead of sourcing from memory, we're
- sourcing from a register (or multiple registers).
- Who said that gather must also source from memory?
- By: rwessel ([email protected]), March 11, 2022 10:56 am
- Room: [25]Moderated Discussions
- -.- ([email protected]) on March 11, 2022 12:21 am wrote:
- > Heikki Kultala ([email protected]) on March 10,
- 2022 9:59 pm wrote:
- > > > So what would you call a non-destructive 'conditional move'?
- > >
- > > select
- > >
- > > > Or if your ISA doesn't support 4-operand instructions, what would a
- 3-operand 'select' be?
- > >
- > > cmov
- >
- > Ah, so you'd prefer to give instructions different names depending on if
- they're destructive or not.
- >
- > So what would you name a constructive add?
- > A destructive add?
- >
- > Let me guess: add and accumulate?
- >
- > How about constructive and destructive multiply?
- >
- > > That there is multiple terms for same thing is not a problem. The
- terms still always means the same thing.
- > >
- > > That same term is used for DIFFERENT thins is a problem. That
- > > adds confusion. And that's what RISC-V guys are doing.
- >
- > Well, we're doing a gather, but instead of sourcing from memory,
- > we're sourcing from a register (or multiple registers).
- > Who said that gather must also source from memory?
- Z has grown many of those over six decades. Three operand cmov ended up as
- load-on-condition (which actually makes a fair bit of sense), select is
- the common four-operand instruction. As S/360 started as a (almost)
- exclusively two-operand ISA, the three operand forms of things like add
- are part of the "distinct operand" facility, and usually get a "K" suffix.
- Thus two-operand add register-to-register is AR, the three-operand form is
- ARK.
- By: Anon ([email protected]), March 11, 2022 12:07 pm
- Room: [25]Moderated Discussions
- -.- ([email protected]) on March 11, 2022 12:21 am wrote:
- > Ah, so you'd prefer to give instructions different names depending on if
- they're destructive or not.
- It makes sense, where they matter.
- And in the case of cmov it matter, because it is a predication, select
- will* always change state, cmov may not change state, add and mul always
- change state.
- * Except when the registers are the same or the values are the same,
- obviously.
- By: -.- ([email protected]), March 11, 2022 9:29 pm
- Room: [25]Moderated Discussions
- Anon ([email protected]) on March 11, 2022 11:07 am wrote:
- > It makes sense, where they matter.
- To you perhaps, but giving out different names for the same action,
- differing only in constructive/destructive behaviour, and only for this
- one instance, seems like weird logic to me.
- Feel free to disagree - the point I'm making is that there can be many
- different opinions out there, and the one you have isn't some universal
- truth.
- By: Andrey ([email protected]), March 10, 2022 9:55 am
- Room: [25]Moderated Discussions
- -.- ([email protected]) on March 9, 2022 5:39 am wrote:
- > Plenty of weird names in many assembly dialects, to be honest.
- > PALIGNR in x86 or EXT in AArch64 aren't obvious unless you already know
- what the instruction does.
- >
- > Perhaps it's time to move away from compact assembly instruction names?
- I'd say the number
- > of people writing assembly is relatively small compared to the number of
- people reading
- > it, and being less compact could help beginners understand the code more
- easily.
- > We're no longer stuck with technology where long names are problematic.
- > We aren't using 80 character wide screens any more.
- > Why not make opcode names longer and more descriptive? You could always
- keep a
- > more compact version to cater to the few assembly writers without
- autocomplete.
- >
- > I just don't see why assembly syntax today still has to follow the
- design principles of ~50 years ago.
- Assembler is still generated by certain compilers as an intermediate
- output. I'm not sure making instructions more verbose would measurably
- affect compile times and resource consumption, but that's still something
- to consider.
- By: Matt Sayler ([email protected]), March 10, 2022 2:56 pm
- Room: [25]Moderated Discussions
- Andrey ([email protected]) on March 10, 2022 8:55 am
- wrote:
- > Assembler is still generated by certain compilers as an intermediate
- output.
- > I'm not sure making instructions more verbose would measurably affect
- compile
- > times and resource consumption, but that's still something to consider.
- Is there any drawback to having two supported names? dense/traditional vs.
- verbose&easier to understand at a glance? At input, either would be
- supported. At output, choose your poison based on preference.
- Surely someone has proposed this before. A quick search didn't turn up
- anything, but I'm positive I've encountered the idea.
- By: Andrey ([email protected]), March 10, 2022 6:01 pm
- Room: [25]Moderated Discussions
- Matt Sayler ([email protected]) on March 10, 2022 1:56 pm
- wrote:
- > Andrey ([email protected]) on March 10, 2022 8:55 am
- wrote:
- > > Assembler is still generated by certain compilers as an intermediate
- output.
- > > I'm not sure making instructions more verbose would measurably affect
- compile
- > > times and resource consumption, but that's still something to
- consider.
- >
- > Is there any drawback to having two supported names?
- Other than doubling the number of instruction names to support and
- remember? That is in addition to other dialect differences we have today
- (e.g. Intel vs. AT&T x86).
- Honestly, I don't think instruction naming is the biggest problem with
- assembler, when it comes to humans reading/writing it. Certainly not
- something that is worth inventing two names per instruction. It'd be
- better if other stuff, like operand order and register, constant and
- addressing mode syntax were better unified. Special syntax like the one
- used for AVX-512 instructions also isn't helping.
- By: Matt Sayler ([email protected]), March 11, 2022 10:10
- am
- Room: [25]Moderated Discussions
- Andrey ([email protected]) on March 10, 2022 5:01 pm
- wrote:
- > Matt Sayler ([email protected]) on March 10, 2022 1:56 pm
- wrote:
- > > Andrey ([email protected]) on March 10, 2022 8:55
- am wrote:
- > > > Assembler is still generated by certain compilers as an intermediate
- output.
- > > > I'm not sure making instructions more verbose would measurably
- affect compile
- > > > times and resource consumption, but that's still something to
- consider.
- > >
- > > Is there any drawback to having two supported names?
- >
- > Other than doubling the number of instruction names to support and
- remember? That is
- > in addition to other dialect differences we have today (e.g. Intel vs.
- AT&T x86).
- >
- > Honestly, I don't think instruction naming is the biggest problem with
- assembler, when it comes to humans
- > reading/writing it. Certainly not something that is worth inventing two
- names per instruction. It'd
- > be better if other stuff, like operand order and register, constant and
- addressing mode syntax were
- > better unified. Special syntax like the one used for AVX-512
- instructions also isn't helping.
- Fair, but as assembly is relegated to narrower use cases over time,
- there's value in separating out the important parts from the merely
- historical ones.
- There's an argument to be made for "systems languages," sure. However, I'm
- just saying the cost of having 2 names for opcodes is minuscule in
- comparison to the costs of everything else. The only question would be:
- does it add anything?
- If I were involved with a new ISA, I'd definitely look into this as part
- of the spec because it feels like low-hanging fruit.
- By: -.- ([email protected]), March 10, 2022 9:03 pm
- Room: [25]Moderated Discussions
- Andrey ([email protected]) on March 10, 2022 8:55 am
- wrote:
- > Assembler is still generated by certain compilers as an intermediate
- output.
- > I'm not sure making instructions more verbose would measurably affect
- compile
- > times and resource consumption, but that's still something to consider.
- Well, if it's anything to go by, there already the x86 instruction,
- VGF2P8AFFINEINVQB, if long instructions would be problematic.
- Of course, if naming is such an issue, the compiler could just jump
- straight to machine code (if it isn't already), or even develop some
- internal compact representation.
- In reality, it's highly unlikely that length of instructions plays any
- significance in compilation time - I'd say optimisation passes probably
- contribute way more.
- By: Andrey ([email protected]), March 11, 2022 4:01 am
- Room: [25]Moderated Discussions
- -.- ([email protected]) on March 10, 2022 8:03 pm wrote:
- > Andrey ([email protected]) on March 10, 2022 8:55 am
- wrote:
- > > Assembler is still generated by certain compilers as an intermediate
- output.
- > > I'm not sure making instructions more verbose would measurably affect
- compile
- > > times and resource consumption, but that's still something to
- consider.
- >
- > Well, if it's anything to go by, there already the x86 instruction,
- > VGF2P8AFFINEINVQB, if long instructions would be problematic.
- How often that instruction appears in the generated code? Compared to
- something like mov, add, mul, cmp, jmp or ret, I don't think it adds much
- weight to the generated output.
- > Of course, if naming is such an issue, the compiler could just jump
- straight to machine
- > code (if it isn't already), or even develop some internal compact
- representation.
- Generating assembler output is a valid design choice that has its pros and
- cons. First and foremost, it allows to reuse the assembler tool, which has
- to be implemented anyway and isn't quite trivial in its own right.
- > In reality, it's highly unlikely that length of instructions plays any
- significance
- > in compilation time - I'd say optimisation passes probably contribute
- way more.
- Probably. Still, I don't find the argument for more verbose instruction
- names compelling enough. There are some more cryptic outliers that could
- be better, but in general I don't find that much of a problem.
- By: sr ([email protected]), March 9, 2022 12:26 pm
- Room: [25]Moderated Discussions
- Heikki Kultala ([email protected]) on March 9, 2022
- 12:35 am wrote:
- > In the V-extension, they have an instruction named "vrgather".
- >
- > But that instruction is not a gather load instruction. This instructoin
- is just a shuffle instruction.
- >
- > What have the guys deciding the naming of these instructions have been
- smoking?
- >
- Risc-V V is vector instruction set, not SIMD instruction set. That
- instruction is better known as load vector index -instruction in vector
- CPU - loads non-continuous data from index register locations into vector
- register. So it is a very powerful gather instruction. Why do you consider
- it just a shuffle instruction?
Advertisement
Add Comment
Please, Sign In to add comment