assembler_alias.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // Copyright 2024 CloudWeGo Authors
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. package x86_64
  17. func alias_INT3(p *Program, vv ...interface{}) *Instruction {
  18. if len(vv) == 0 {
  19. return p.INT(3)
  20. } else {
  21. panic("instruction INT3 takes no operands")
  22. }
  23. }
  24. func alias_VCMPEQPS(p *Program, vv ...interface{}) *Instruction {
  25. if len(vv) >= 3 {
  26. return p.VCMPPS(0x00, vv[0], vv[1], vv[2], vv[3:]...)
  27. } else {
  28. panic("instruction VCMPEQPS takes 3 or 4 operands")
  29. }
  30. }
  31. func alias_VCMPTRUEPS(p *Program, vv ...interface{}) *Instruction {
  32. if len(vv) >= 3 {
  33. return p.VCMPPS(0x0f, vv[0], vv[1], vv[2], vv[3:]...)
  34. } else {
  35. panic("instruction VCMPTRUEPS takes 3 or 4 operands")
  36. }
  37. }
  38. var _InstructionAliases = map[string]_InstructionEncoder {
  39. "int3" : alias_INT3,
  40. "retq" : Instructions["ret"],
  41. "movabsq" : Instructions["movq"],
  42. "vcmpeqps" : alias_VCMPEQPS,
  43. "vcmptrueps" : alias_VCMPTRUEPS,
  44. }