alu_string.go 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // Code generated by "stringer -output alu_string.go -type=Source,Endianness,ALUOp"; DO NOT EDIT.
  2. package asm
  3. import "strconv"
  4. func _() {
  5. // An "invalid array index" compiler error signifies that the constant values have changed.
  6. // Re-run the stringer command to generate them again.
  7. var x [1]struct{}
  8. _ = x[InvalidSource-255]
  9. _ = x[ImmSource-0]
  10. _ = x[RegSource-8]
  11. }
  12. const (
  13. _Source_name_0 = "ImmSource"
  14. _Source_name_1 = "RegSource"
  15. _Source_name_2 = "InvalidSource"
  16. )
  17. func (i Source) String() string {
  18. switch {
  19. case i == 0:
  20. return _Source_name_0
  21. case i == 8:
  22. return _Source_name_1
  23. case i == 255:
  24. return _Source_name_2
  25. default:
  26. return "Source(" + strconv.FormatInt(int64(i), 10) + ")"
  27. }
  28. }
  29. func _() {
  30. // An "invalid array index" compiler error signifies that the constant values have changed.
  31. // Re-run the stringer command to generate them again.
  32. var x [1]struct{}
  33. _ = x[InvalidEndian-255]
  34. _ = x[LE-0]
  35. _ = x[BE-8]
  36. }
  37. const (
  38. _Endianness_name_0 = "LE"
  39. _Endianness_name_1 = "BE"
  40. _Endianness_name_2 = "InvalidEndian"
  41. )
  42. func (i Endianness) String() string {
  43. switch {
  44. case i == 0:
  45. return _Endianness_name_0
  46. case i == 8:
  47. return _Endianness_name_1
  48. case i == 255:
  49. return _Endianness_name_2
  50. default:
  51. return "Endianness(" + strconv.FormatInt(int64(i), 10) + ")"
  52. }
  53. }
  54. func _() {
  55. // An "invalid array index" compiler error signifies that the constant values have changed.
  56. // Re-run the stringer command to generate them again.
  57. var x [1]struct{}
  58. _ = x[InvalidALUOp-255]
  59. _ = x[Add-0]
  60. _ = x[Sub-16]
  61. _ = x[Mul-32]
  62. _ = x[Div-48]
  63. _ = x[Or-64]
  64. _ = x[And-80]
  65. _ = x[LSh-96]
  66. _ = x[RSh-112]
  67. _ = x[Neg-128]
  68. _ = x[Mod-144]
  69. _ = x[Xor-160]
  70. _ = x[Mov-176]
  71. _ = x[ArSh-192]
  72. _ = x[Swap-208]
  73. }
  74. const _ALUOp_name = "AddSubMulDivOrAndLShRShNegModXorMovArShSwapInvalidALUOp"
  75. var _ALUOp_map = map[ALUOp]string{
  76. 0: _ALUOp_name[0:3],
  77. 16: _ALUOp_name[3:6],
  78. 32: _ALUOp_name[6:9],
  79. 48: _ALUOp_name[9:12],
  80. 64: _ALUOp_name[12:14],
  81. 80: _ALUOp_name[14:17],
  82. 96: _ALUOp_name[17:20],
  83. 112: _ALUOp_name[20:23],
  84. 128: _ALUOp_name[23:26],
  85. 144: _ALUOp_name[26:29],
  86. 160: _ALUOp_name[29:32],
  87. 176: _ALUOp_name[32:35],
  88. 192: _ALUOp_name[35:39],
  89. 208: _ALUOp_name[39:43],
  90. 255: _ALUOp_name[43:55],
  91. }
  92. func (i ALUOp) String() string {
  93. if str, ok := _ALUOp_map[i]; ok {
  94. return str
  95. }
  96. return "ALUOp(" + strconv.FormatInt(int64(i), 10) + ")"
  97. }